repo_name
stringlengths
6
69
path
stringlengths
6
178
copies
stringclasses
278 values
size
stringlengths
4
7
content
stringlengths
671
917k
license
stringclasses
15 values
MaxG87/awesome
lib/awful/layout/suit/spiral.lua
14
2147
--------------------------------------------------------------------------- --- Dwindle and spiral layouts -- -- @author Uli Schlachter &lt;psychon@znc.in&gt; -- @copyright 2009 Uli Schlachter -- @copyright 2008 Julien Danjou -- @release @AWESOME_VERSION@ -- -- @module awful.layout.suit.spiral --------------------------------------------------------------------------- -- Grab environment we need local ipairs = ipairs local math = math local spiral = {} local function do_spiral(p, _spiral) local wa = p.workarea local cls = p.clients local n = #cls local old_width, old_height = wa.width, 2 * wa.height for k, c in ipairs(cls) do if k % 2 == 0 then wa.width, old_width = math.ceil(old_width / 2), wa.width if k ~= n then wa.height, old_height = math.floor(wa.height / 2), wa.height end else wa.height, old_height = math.ceil(old_height / 2), wa.height if k ~= n then wa.width, old_width = math.floor(wa.width / 2), wa.width end end if k % 4 == 0 and _spiral then wa.x = wa.x - wa.width elseif k % 2 == 0 then wa.x = wa.x + old_width elseif k % 4 == 3 and k < n and _spiral then wa.x = wa.x + math.ceil(old_width / 2) end if k % 4 == 1 and k ~= 1 and _spiral then wa.y = wa.y - wa.height elseif k % 2 == 1 and k ~= 1 then wa.y = wa.y + old_height elseif k % 4 == 0 and k < n and _spiral then wa.y = wa.y + math.ceil(old_height / 2) end local g = { x = wa.x, y = wa.y, width = wa.width, height = wa.height } p.geometries[c] = g end end --- Dwindle layout spiral.dwindle = {} spiral.dwindle.name = "dwindle" function spiral.dwindle.arrange(p) return do_spiral(p, false) end --- Spiral layout spiral.name = "spiral" function spiral.arrange(p) return do_spiral(p, true) end return spiral -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
gpl-2.0
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/artisan/engineeringITinkering/aDroidBattery.lua
1
3761
--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. aDroidBattery = Object:new { objectName = "A Droid Battery", stfName = "droid_battery", stfFile = "obj_n", objectCRC = 3508567807, groupName = "craftArtisanEngineeringGroupA", -- Group schematic is awarded in (See skills table) craftingToolTab = 524288, -- (See DraftSchemticImplementation.h) complexity = 7, size = 4, xpType = "crafting_general", xp = 30, assemblySkill = "general_assembly", experimentingSkill = "general_experimentation", ingredientTemplateNames = "craft_item_ingredients_n, craft_item_ingredients_n, craft_item_ingredients_n", ingredientTitleNames = "battery_enclosure, charge_retention, thermal_shielding", ingredientSlotType = "0, 0, 0", resourceTypes = "metal, metal, ore", resourceQuantities = "8, 5, 5", combineTypes = "0, 0, 0", contribution = "100, 100, 100", numberExperimentalProperties = "1, 1, 1, 1", experimentalProperties = "XX, XX, XX, CD", experimentalWeights = "1, 1, 1, 1", experimentalGroupTitles = "null, null, null, exp_quality", experimentalSubGroupTitles = "null, null, hitpoints, charge", experimentalMin = "0, 0, 1000, 1", experimentalMax = "0, 0, 1000, 5", experimentalPrecision = "0, 0, 0, 0", tanoAttributes = "objecttype=8211:objectcrc=209388269:stfFile=obj_n:stfName=droid_battery:stfDetail=:itemmask=65535::", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "", customizationDefaults = "", customizationSkill = "clothing_customization" } DraftSchematics:addDraftSchematic(aDroidBattery, 3508567807)--- Add to global DraftSchematics table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/tatooine/npcs/valarian/valarianHenchman.lua
1
4564
--Copyright (C) 2008 <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. valarianHenchman = Creature:new { objectName = "valarianHenchman", -- Lua Object Name creatureType = "NPC", faction = "valarian", factionPoints = 20, gender = "", speciesName = "valarian_henchman", stfName = "mob/creature_names", objectCRC = 2870201143, socialGroup = "valarian", level = 9, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 825, healthMin = 675, strength = 0, constitution = 0, actionMax = 825, actionMin = 675, quickness = 0, stamina = 0, mindMax = 825, mindMin = 675, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 1, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 0, ferocity = 0, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 80, weaponMaxDamage = 90, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "valarianAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(valarianHenchman, 2870201143) -- Add to Global Table
lgpl-3.0
BakaBBQ/siki.lua
flagLists.lua
1
3013
flagListFrame = 0 flagListFrame = loveframes.Create("frame") flagListFrame:SetName("Flag Lists") flagListFrame:SetSize(love.graphics.getWidth() / 4 * 3 / 2, love.graphics.getHeight() / 3) flagListFrame:SetPos(love.graphics.getWidth() / 4 + love.graphics.getWidth() / 4 * 3 / 2, love.graphics.getHeight() - love.graphics.getHeight() / 3) flagListFrame:SetDraggable(false) flagListFrame:ShowCloseButton(false) local flaglist = loveframes.Create("columnlist", flagListFrame) flaglist.defaultcolumnwidth = (flagListFrame:GetWidth() - 10) / 2 flaglist:SetPos(5,30) flaglist:SetSize(flagListFrame:GetWidth() - 10, flagListFrame:GetHeight() - 60) flaglist:AddColumn("Flag Data") flaglist:AddColumn("Flag Value") flaglist.OnRowClicked = function(parent, row, rowdata) print('row clicked') for k, v in ipairs(rowdata) do print("" ..k.. ": " ..v) end flagKey:SetText(rowdata[1]) flagValue:SetText(rowdata[2]) end local ay = flagListFrame:GetHeight() - 28 local addFlagButton = loveframes.Create("button", flagListFrame) addFlagButton:SetSize(18, addFlagButton:GetHeight()) addFlagButton:SetText("+") addFlagButton:SetPos(5, flagListFrame:GetHeight() - 28) addFlagButton.OnClick = function(object) if currentFrameData then addNewFlag() refreshFlagList() end end local deleteFlagButton = loveframes.Create("button", flagListFrame) deleteFlagButton:SetSize(addFlagButton:GetSize()) deleteFlagButton:SetText("-") deleteFlagButton:SetPos(addFlagButton:GetX() + 23, flagListFrame:GetHeight() - 28) deleteFlagButton.OnClick = function(object) if flaglist:GetSelectedRows()[1] then getCurrentFlags()[flaglist:GetSelectedRows()[1].columndata[1]] = nil -- get rid of the flag in the model refreshFlagList() -- then simply refresh end end flagKey = loveframes.Create("textinput", flagListFrame) flagKey:SetPos(deleteFlagButton:GetX() + 24 + 22, ay) flagKey:SetSize((flagListFrame:GetWidth() - 60) / 2, addFlagButton:GetHeight()) flagKey.OnTextChanged = function(object, text) if flaglist:GetSelectedRows()[1] then local r = flaglist:GetSelectedRows() getCurrentFlags()[r[1].columndata[1]] = nil r[1].columndata[1] = flagKey:GetText() getCurrentFlags()[flagKey:GetText()] = flagValue:GetText() end end flagValue = loveframes.Create("textinput", flagListFrame) flagValue:SetPos(deleteFlagButton:GetX() + 24 + 26 + flagKey:GetWidth(), ay) flagValue:SetSize(flagKey:GetSize()) flagValue.OnTextChanged = function(object, text) if flaglist:GetSelectedRows()[1] then local r = flaglist:GetSelectedRows() r[1].columndata[2] = flagValue:GetText() getCurrentFlags()[flagKey:GetText()] = flagValue:GetText() end end function getCurrentFlags() return currentFrameData['flags'] end function refreshFlagList() flaglist:Clear() for k, v in pairs(getCurrentFlags()) do flaglist:AddRow(k, v) end flagKey:Clear() flagValue:Clear() end function addNewFlag() print(getCurrentFlags()["NewFlag"]) getCurrentFlags()["NewFlag"] = "Demo Value" end
mit
gabrielPeart/keys
VSCOKeys.lrdevplugin/Info.lua
11
1580
--[[---------------------------------------------------------------------------- VSCO Keys for Adobe Lightroom Copyright (C) 2015 Visual Supply Company Licensed under GNU GPLv2 (or any later version). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ------------------------------------------------------------------------------]] return { LrSdkVersion = 4.0, LrSdkMinimumVersion = 3.0, -- minimum SDK version required by this plug-in LrToolkitIdentifier = 'com.VSCO.vscokeys', LrPluginName = LOC "$$$/VSCO/PluginName=VSCO Keys", LrInitPlugin = "Init.lua", LrForceInitPlugin = true, LrShutdownPlugin = "Shutdown.lua", -- LrEnablePlugin = "Init.lua", -- LrDisablePlugin = "Shutdown.lua", -- LrShutdownApp = "Terminate.lua", -- Add the menu item to the File menu. LrExportMenuItems = { title = "Activate Keys LR3", file = "ActivateKeys.lua", }, VERSION = { major=1, minor=0, revision=7, build=0, }, }
gpl-2.0
Xeltor/ovale
dist/Health.lua
1
13564
local __exports = LibStub:NewLibrary("ovale/Health", 80300) if not __exports then return end local __class = LibStub:GetLibrary("tslib").newClass local aceEvent = LibStub:GetLibrary("AceEvent-3.0", true) local sub = string.sub local tonumber = tonumber local wipe = wipe local UnitHealth = UnitHealth local UnitHealthMax = UnitHealthMax local UnitGetTotalAbsorbs = UnitGetTotalAbsorbs local UnitGetTotalHealAbsorbs = UnitGetTotalHealAbsorbs local CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo local huge = math.huge local INFINITY = huge local CLEU_DAMAGE_EVENT = { DAMAGE_SHIELD = true, DAMAGE_SPLIT = true, RANGE_DAMAGE = true, SPELL_BUILDING_DAMAGE = true, SPELL_DAMAGE = true, SPELL_PERIODIC_DAMAGE = true, SWING_DAMAGE = true, ENVIRONMENTAL_DAMAGE = true } local CLEU_HEAL_EVENT = { SPELL_HEAL = true, SPELL_PERIODIC_HEAL = true } __exports.OvaleHealthClass = __class(nil, { constructor = function(self, ovaleGuid, baseState, ovale, ovaleOptions, ovaleDebug, ovaleProfiler, requirement) self.ovaleGuid = ovaleGuid self.baseState = baseState self.ovale = ovale self.ovaleOptions = ovaleOptions self.requirement = requirement self.health = {} self.maxHealth = {} self.absorb = {} self.healAbsorb = {} self.totalDamage = {} self.totalHealing = {} self.firstSeen = {} self.lastUpdated = {} self.OnInitialize = function() self.module:RegisterEvent("PLAYER_REGEN_DISABLED", self.PLAYER_REGEN_DISABLED) self.module:RegisterEvent("PLAYER_REGEN_ENABLED", self.PLAYER_REGEN_ENABLED) if self.ovaleOptions.db.profile.apparence.frequentHealthUpdates then self.module:RegisterEvent("UNIT_HEALTH_FREQUENT", self.UpdateHealth) else self.module:RegisterEvent("UNIT_HEALTH", self.UpdateHealth) end self.module:RegisterEvent("UNIT_MAXHEALTH", self.UpdateHealth) self.module:RegisterEvent("UNIT_ABSORB_AMOUNT_CHANGED", self.UpdateAbsorb) self.module:RegisterEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", self.UpdateAbsorb) self.module:RegisterMessage("Ovale_UnitChanged", self.Ovale_UnitChanged) self.requirement:RegisterRequirement("health_pct", self.RequireHealthPercentHandler) self.requirement:RegisterRequirement("pet_health_pct", self.RequireHealthPercentHandler) self.requirement:RegisterRequirement("target_health_pct", self.RequireHealthPercentHandler) end self.OnDisable = function() self.requirement:UnregisterRequirement("health_pct") self.requirement:UnregisterRequirement("pet_health_pct") self.requirement:UnregisterRequirement("target_health_pct") self.module:UnregisterEvent("PLAYER_REGEN_ENABLED") self.module:UnregisterEvent("PLAYER_TARGET_CHANGED") self.module:UnregisterEvent("UNIT_HEALTH_FREQUENT") self.module:UnregisterEvent("UNIT_HEALTH") self.module:UnregisterEvent("UNIT_MAXHEALTH") self.module:UnregisterEvent("UNIT_ABSORB_AMOUNT_CHANGED") self.module:UnregisterEvent("UNIT_HEAL_ABSORB_AMOUNT_CHANGED") self.module:UnregisterMessage("Ovale_UnitChanged") end self.COMBAT_LOG_EVENT_UNFILTERED = function(event, ...) local timestamp, cleuEvent, _, _, _, _, _, destGUID, _, _, _, arg12, arg13, _, arg15 = CombatLogGetCurrentEventInfo() self.profiler:StartProfiling("OvaleHealth_COMBAT_LOG_EVENT_UNFILTERED") local healthUpdate = false if CLEU_DAMAGE_EVENT[cleuEvent] then local amount if cleuEvent == "SWING_DAMAGE" then amount = arg12 elseif cleuEvent == "ENVIRONMENTAL_DAMAGE" then amount = arg13 else amount = arg15 end self.tracer:Debug(cleuEvent, destGUID, amount) local total = self.totalDamage[destGUID] or 0 self.totalDamage[destGUID] = total + amount healthUpdate = true elseif CLEU_HEAL_EVENT[cleuEvent] then local amount = arg15 self.tracer:Debug(cleuEvent, destGUID, amount) local total = self.totalHealing[destGUID] or 0 self.totalHealing[destGUID] = total + amount healthUpdate = true end if healthUpdate then if not self.firstSeen[destGUID] then self.firstSeen[destGUID] = timestamp end self.lastUpdated[destGUID] = timestamp end self.profiler:StopProfiling("OvaleHealth_COMBAT_LOG_EVENT_UNFILTERED") end self.PLAYER_REGEN_DISABLED = function(event) self.module:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", self.COMBAT_LOG_EVENT_UNFILTERED) end self.PLAYER_REGEN_ENABLED = function(event) self.module:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") wipe(self.totalDamage) wipe(self.totalHealing) wipe(self.firstSeen) wipe(self.lastUpdated) end self.Ovale_UnitChanged = function(event, unitId, guid) self.profiler:StartProfiling("Ovale_UnitChanged") if unitId == "target" or unitId == "focus" then self.tracer:Debug(event, unitId, guid) self.UpdateHealth("UNIT_HEALTH_FREQUENT", unitId) self.UpdateHealth("UNIT_MAXHEALTH", unitId) self.UpdateAbsorb("UNIT_ABSORB_AMOUNT_CHANGED", unitId) self.UpdateAbsorb("UNIT_HEAL_ABSORB_AMOUNT_CHANGED", unitId) end self.profiler:StopProfiling("Ovale_UnitChanged") end self.UpdateAbsorb = function(event, unitId) if not unitId then return end self.profiler:StartProfiling("OvaleHealth_UpdateAbsorb") local func local db if event == "UNIT_ABSORB_AMOUNT_CHANGED" then func = UnitGetTotalAbsorbs db = self.absorb elseif event == "UNIT_HEAL_ABSORB_AMOUNT_CHANGED" then func = UnitGetTotalHealAbsorbs db = self.absorb else self.ovale:OneTimeMessage("Warning: Invalid event (%s) in UpdateAbsorb.", event) return end local amount = func(unitId) if amount >= 0 then local guid = self.ovaleGuid:UnitGUID(unitId) self.tracer:Debug(event, unitId, guid, amount) if guid then db[guid] = amount end end self.profiler:StopProfiling("OvaleHealth_UpdateHealth") end self.UpdateHealth = function(event, unitId) if not unitId then return end self.profiler:StartProfiling("OvaleHealth_UpdateHealth") local func local db if event == "UNIT_HEALTH_FREQUENT" or event == "UNIT_HEALTH" then func = UnitHealth db = self.health elseif event == "UNIT_MAXHEALTH" then func = UnitHealthMax db = self.maxHealth else self.ovale:OneTimeMessage("Warning: Invalid event (%s) in UpdateHealth.", event) return end local amount = func(unitId) if amount then local guid = self.ovaleGuid:UnitGUID(unitId) self.tracer:Debug(event, unitId, guid, amount) if guid then if amount > 0 then db[guid] = amount else db[guid] = nil self.firstSeen[guid] = nil self.lastUpdated[guid] = nil end end end self.profiler:StopProfiling("OvaleHealth_UpdateHealth") end self.RequireHealthPercentHandler = function(spellId, atTime, requirement, tokens, index, targetGUID) local verified = false local threshold = tokens[index] index = index + 1 if threshold then local isBang = false if sub(threshold, 1, 1) == "!" then isBang = true threshold = sub(threshold, 2) end local thresholdValue = tonumber(threshold) or 0 local guid, unitId if sub(requirement, 1, 7) == "target_" then if targetGUID then guid = targetGUID local result = self.ovaleGuid:GUIDUnit(guid) unitId = result or "target" else unitId = self.baseState.next.defaultTarget or "target" end elseif sub(requirement, 1, 4) == "pet_" then unitId = "pet" else unitId = "player" end guid = guid or self.ovaleGuid:UnitGUID(unitId) local health = self:UnitHealth(unitId, guid) or 0 local maxHealth = self:UnitHealthMax(unitId, guid) local healthPercent if maxHealth == 0 then healthPercent = 100 else healthPercent = (health / maxHealth * 100) or 100 end if not isBang and healthPercent <= thresholdValue or isBang and healthPercent > thresholdValue then verified = true end local result = verified and "passed" or "FAILED" if isBang then self.tracer:Log(" Require %s health > %f%% (%f) at time=%f: %s", unitId, threshold, healthPercent, atTime, result) else self.tracer:Log(" Require %s health <= %f%% (%f) at time=%f: %s", unitId, threshold, healthPercent, atTime, result) end else self.ovale:OneTimeMessage("Warning: requirement '%s' is missing a threshold argument.", requirement) end return verified, requirement, index end self.module = ovale:createModule("OvaleHealth", self.OnInitialize, self.OnDisable, aceEvent) self.tracer = ovaleDebug:create(self.module:GetName()) self.profiler = ovaleProfiler:create(self.module:GetName()) end, UnitHealth = function(self, unitId, guid) return self:UnitAmount(UnitHealth, self.health, unitId, guid) end, UnitHealthMax = function(self, unitId, guid) return self:UnitAmount(UnitHealthMax, self.maxHealth, unitId, guid) end, UnitAbsorb = function(self, unitId, guid) return self:UnitAmount(UnitGetTotalAbsorbs, self.absorb, unitId, guid) end, UnitHealAbsorb = function(self, unitId, guid) return self:UnitAmount(UnitGetTotalHealAbsorbs, self.healAbsorb, unitId, guid) end, UnitAmount = function(self, func, db, unitId, guid) local amount if unitId then guid = guid or self.ovaleGuid:UnitGUID(unitId) if guid then if (unitId == "focus" or unitId == "target") and db[guid] ~= nil then amount = db[guid] else amount = func(unitId) if amount ~= nil then db[guid] = amount else amount = 0 end end else amount = 0 end else amount = 0 end return amount end, UnitTimeToDie = function(self, unitId, effectiveHealth, guid) self.profiler:StartProfiling("OvaleHealth_UnitTimeToDie") local timeToDie = INFINITY guid = guid or self.ovaleGuid:UnitGUID(unitId) if guid then local health = self:UnitHealth(unitId, guid) or 0 if effectiveHealth then health = health + self:UnitAbsorb(unitId, guid) - self:UnitHealAbsorb(unitId, guid) end local maxHealth = self:UnitHealthMax(unitId, guid) if health and maxHealth > 0 then if health == 0 then timeToDie = 0 self.firstSeen[guid] = nil self.lastUpdated[guid] = nil elseif maxHealth > 5 then local firstSeen, lastUpdated = self.firstSeen[guid], self.lastUpdated[guid] local damage = self.totalDamage[guid] or 0 local healing = self.totalHealing[guid] or 0 if firstSeen and lastUpdated and lastUpdated > firstSeen and damage > healing then timeToDie = health * (lastUpdated - firstSeen) / (damage - healing) end end end end self.profiler:StopProfiling("OvaleHealth_UnitTimeToDie") return timeToDie end, CleanState = function(self) end, InitializeState = function(self) end, ResetState = function(self) end, })
mit
TheAnswer/FirstTest
bin/scripts/slashcommands/generic/lfg.lua
1
2409
--Copyright (C) 2007 <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. --true = 1, false = 0 LfgSlashCommand = { name = "lfg", alternativeNames = "", animation = "", invalidStateMask = 2097152, --glowingJedi, invalidPostures = "", target = 2, targeType = 0, disabled = 0, maxRangeToTarget = 0, --adminLevel = 0, addToCombatQueue = 0, } AddLfgSlashCommand(LfgSlashCommand)
lgpl-3.0
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/EventAssetsManagerEx.lua
1
1546
-------------------------------- -- @module EventAssetsManagerEx -- @extend EventCustom -- @parent_module cc -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getAssetsManagerEx -- @param self -- @return AssetsManagerEx#AssetsManagerEx ret (return value: cc.AssetsManagerEx) -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getAssetId -- @param self -- @return string#string ret (return value: string) -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getCURLECode -- @param self -- @return int#int ret (return value: int) -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getMessage -- @param self -- @return string#string ret (return value: string) -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getCURLMCode -- @param self -- @return int#int ret (return value: int) -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getPercentByFile -- @param self -- @return float#float ret (return value: float) -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getEventCode -- @param self -- @return int#int ret (return value: int) -------------------------------- -- -- @function [parent=#EventAssetsManagerEx] getPercent -- @param self -- @return float#float ret (return value: float) return nil
apache-2.0
mazlixek/Elevators
enemy.lua
1
7902
local physics = require "physics" local player = require "player" local playerYtop = display.newText( "SCORE: ", 0+display.screenOriginX+10, 10+display.screenOriginY+30, native.systemFont, 16) local enemyY = display.newText( "SCORE: ", 0+display.screenOriginX+40, 10+display.screenOriginY+30, native.systemFont, 16) local playerYbottom = display.newText( "SCORE: ", 0+display.screenOriginX+70, 10+display.screenOriginY+30, native.systemFont, 16) -- sprite start local sheetOptions = { width = 19, height = 51, numFrames = 16 } local sheet_enemy = graphics.newImageSheet("images/enemy.png", sheetOptions) -- sequences table local sequences_enemy = { -- consecutive frames sequence { name = "stayingLeft", frames = {1}, loopCount = 1, loopDirection = "forward" }, { name = "stayingRight", frames = {2}, loopCount = 1, loopDirection = "forward" }, { name = "goingLeft", frames = {1,13,15}, time = 240, loopCount = 0, loopDirection = "forward" }, { name = "goingRight", frames = {2,14,16}, time = 240, loopCount = 0, loopDirection = "forward" }, { name = "fireGoingLeft", frames = {7,1}, time = 240, loopCount = 1, loopDirection = "forward" }, { name = "fireGoingRight", frames = {8,2}, time = 240, loopCount = 1, loopDirection = "forward" }, { name = "die", frames = {3,10,4,9}, time = 200, loopCount = 0, loopDirection = "forward" }, { name = "duckLeft", frames = {5}, loopCount = 1, loopDirection = "forward" }, { name = "duckRight", frames = {6}, loopCount = 1, loopDirection = "forward" }, { name = "fireDuckLeft", frames = {11,5}, time = 1500, loopCount = 1, loopDirection = "forward" }, { name = "fireDuckRight", frames = {12,6}, time = 1500, loopCount = 1, loopDirection = "forward" } } --sprite end local enemy = {} local sceneGroup = nil function enemy:setSceneGroup(scene) sceneGroup = scene end function enemy:new() local shootingDelay = 3000 local reloading = false local enemy = display.newSprite( sheet_enemy, sequences_enemy ) enemy.myName = "enemy" -- add physics to the crate physics.addBody( enemy, "dynamic", { friction=0.3, bounce=0} ) enemy.isFixedRotation = true enemy.isDucking = false enemy.isFiring = false enemy.isMoving = false function enemy:shoot() if not reloading then reloading = true projectile = display.newRect(enemy.x, 0, 10, 3 ) projectile.myName = "enemyBullet" physics.addBody(projectile, 'dynamic', { friction=0.3, bounce=0, isSensor=true}) projectile.gravityScale = 0 projectile.isBullet = true projectile.rotation = 0 projectile:setFillColor(1,0,0) if string.find(enemy.sequence, "Duck") then projectile.y = enemy.y-10 else projectile.y = enemy.y end if string.find(enemy.sequence, "goingRight") then projectile.anchorX = 10 projectile.anchorY = 2 enemy:setSequence("fireGoingRight") projectile:setLinearVelocity( 200, 0 ) end if string.find(enemy.sequence, "goingLeft") then projectile.anchorX = 0 projectile.anchorY = 2 enemy:setSequence("fireGoingLeft") projectile:setLinearVelocity( -200, 0 ) end if string.find(enemy.sequence, "stayingRight") then projectile.anchorX = 10 projectile.anchorY = 2 enemy:setSequence("fireGoingRight") projectile:setLinearVelocity( 200, 0 ) end if string.find(enemy.sequence, "stayingLeft") then projectile.anchorX = 0 projectile.anchorY = 0 enemy:setSequence("fireGoingLeft") projectile:setLinearVelocity( -200, 0 ) end if string.find(enemy.sequence, "duckRight") then projectile.anchorX = 10 projectile.anchorY = 2 enemy:setSequence("fireDuckRight") projectile:setLinearVelocity( 200, 0 ) end if string.find(enemy.sequence, "duckLeft") then projectile.anchorX = 0 projectile.anchorY = 2 enemy:setSequence("fireDuckLeft") projectile:setLinearVelocity( -200, 0 ) end if string.find(enemy.sequence, "jumpRight") then projectile.anchorX = 0 projectile.anchorY = 2 enemy:setSequence("fireJumpRight") projectile:setLinearVelocity( 200, 0 ) end if string.find(enemy.sequence, "jumpLeft") then projectile.anchorX = 10 projectile.anchorY = 2 enemy:setSequence("fireJumpLeft") projectile:setLinearVelocity( -200, 0 ) end sceneGroup:insert(projectile) --timer.performWithDelay(400, function() if string.find(enemy.sequence, "Right") then enemy:setSequence("goingRight") else enemy:setSequence("goingLeft") end end, 1) timer.performWithDelay(shootingDelay, function() reloading = false end, 1) end end function huntPlayer() if enemy.x ~= nil and enemy.sequence ~= "die" then --pokud nejsou na stejnem patre if not (player.y-player.height/2 < enemy.y and player.y+player.height/2 > enemy.y) then if player.x > enemy.x then enemy.x = enemy.x + 1 if enemy.sequence ~= "goingRight" then enemy:setSequence("goingRight") end end if player.x < enemy.x then if enemy.sequence ~= "goingLeft" then enemy:setSequence("goingLeft") end enemy.x = enemy.x - 1 end end if (player.y-player.height/2 < enemy.y and player.y+player.height/2 > enemy.y) then if player.x > enemy.x then if enemy.sequence ~= "stayingRight" then enemy:setSequence("stayingRight") end end if player.x < enemy.x then if enemy.sequence ~= "stayingLeft" then enemy:setSequence("stayingLeft") end end end playerYtop.text = math.floor(player.y-player.height/2) enemyY.text = math.floor(enemy.y) playerYbottom.text = math.floor(player.y+player.height/2) if player.y-player.height/2 < enemy.y and player.y+player.height/2 > enemy.y then enemy:shoot() end enemy:play() --print(enemy.sequence) end end Runtime:addEventListener("enterFrame", huntPlayer) return enemy end return enemy
gpl-3.0
thkhxm/TGame
LuaEncoder/luajit/jit/bcsave.lua
87
18141
---------------------------------------------------------------------------- -- LuaJIT module to save/list bytecode. -- -- Copyright (C) 2005-2015 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- -- This module saves or lists the bytecode for an input file. -- It's run by the -b command line option. -- ------------------------------------------------------------------------------ local jit = require("jit") assert(jit.version_num == 20004, "LuaJIT core/library version mismatch") local bit = require("bit") -- Symbol name prefix for LuaJIT bytecode. local LJBC_PREFIX = "luaJIT_BC_" ------------------------------------------------------------------------------ local function usage() io.stderr:write[[ Save LuaJIT bytecode: luajit -b[options] input output -l Only list bytecode. -s Strip debug info (default). -g Keep debug info. -n name Set module name (default: auto-detect from input name). -t type Set output file type (default: auto-detect from output name). -a arch Override architecture for object files (default: native). -o os Override OS for object files (default: native). -e chunk Use chunk string as input. -- Stop handling options. - Use stdin as input and/or stdout as output. File types: c h obj o raw (default) ]] os.exit(1) end local function check(ok, ...) if ok then return ok, ... end io.stderr:write("luajit: ", ...) io.stderr:write("\n") os.exit(1) end local function readfile(input) if type(input) == "function" then return input end if input == "-" then input = nil end return check(loadfile(input)) end local function savefile(name, mode) if name == "-" then return io.stdout end return check(io.open(name, mode)) end ------------------------------------------------------------------------------ local map_type = { raw = "raw", c = "c", h = "h", o = "obj", obj = "obj", } local map_arch = { x86 = true, x64 = true, arm = true, ppc = true, ppcspe = true, mips = true, mipsel = true, } local map_os = { linux = true, windows = true, osx = true, freebsd = true, netbsd = true, openbsd = true, dragonfly = true, solaris = true, } local function checkarg(str, map, err) str = string.lower(str) local s = check(map[str], "unknown ", err) return s == true and str or s end local function detecttype(str) local ext = string.match(string.lower(str), "%.(%a+)$") return map_type[ext] or "raw" end local function checkmodname(str) check(string.match(str, "^[%w_.%-]+$"), "bad module name") return string.gsub(str, "[%.%-]", "_") end local function detectmodname(str) if type(str) == "string" then local tail = string.match(str, "[^/\\]+$") if tail then str = tail end local head = string.match(str, "^(.*)%.[^.]*$") if head then str = head end str = string.match(str, "^[%w_.%-]+") else str = nil end check(str, "cannot derive module name, use -n name") return string.gsub(str, "[%.%-]", "_") end ------------------------------------------------------------------------------ local function bcsave_tail(fp, output, s) local ok, err = fp:write(s) if ok and output ~= "-" then ok, err = fp:close() end check(ok, "cannot write ", output, ": ", err) end local function bcsave_raw(output, s) local fp = savefile(output, "wb") bcsave_tail(fp, output, s) end local function bcsave_c(ctx, output, s) local fp = savefile(output, "w") if ctx.type == "c" then fp:write(string.format([[ #ifdef _cplusplus extern "C" #endif #ifdef _WIN32 __declspec(dllexport) #endif const char %s%s[] = { ]], LJBC_PREFIX, ctx.modname)) else fp:write(string.format([[ #define %s%s_SIZE %d static const char %s%s[] = { ]], LJBC_PREFIX, ctx.modname, #s, LJBC_PREFIX, ctx.modname)) end local t, n, m = {}, 0, 0 for i=1,#s do local b = tostring(string.byte(s, i)) m = m + #b + 1 if m > 78 then fp:write(table.concat(t, ",", 1, n), ",\n") n, m = 0, #b + 1 end n = n + 1 t[n] = b end bcsave_tail(fp, output, table.concat(t, ",", 1, n).."\n};\n") end local function bcsave_elfobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; uint16_t type, machine; uint32_t version; uint32_t entry, phofs, shofs; uint32_t flags; uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; } ELF32header; typedef struct { uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; uint16_t type, machine; uint32_t version; uint64_t entry, phofs, shofs; uint32_t flags; uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; } ELF64header; typedef struct { uint32_t name, type, flags, addr, ofs, size, link, info, align, entsize; } ELF32sectheader; typedef struct { uint32_t name, type; uint64_t flags, addr, ofs, size; uint32_t link, info; uint64_t align, entsize; } ELF64sectheader; typedef struct { uint32_t name, value, size; uint8_t info, other; uint16_t sectidx; } ELF32symbol; typedef struct { uint32_t name; uint8_t info, other; uint16_t sectidx; uint64_t value, size; } ELF64symbol; typedef struct { ELF32header hdr; ELF32sectheader sect[6]; ELF32symbol sym[2]; uint8_t space[4096]; } ELF32obj; typedef struct { ELF64header hdr; ELF64sectheader sect[6]; ELF64symbol sym[2]; uint8_t space[4096]; } ELF64obj; ]] local symname = LJBC_PREFIX..ctx.modname local is64, isbe = false, false if ctx.arch == "x64" then is64 = true elseif ctx.arch == "ppc" or ctx.arch == "ppcspe" or ctx.arch == "mips" then isbe = true end -- Handle different host/target endianess. local function f32(x) return x end local f16, fofs = f32, f32 if ffi.abi("be") ~= isbe then f32 = bit.bswap function f16(x) return bit.rshift(bit.bswap(x), 16) end if is64 then local two32 = ffi.cast("int64_t", 2^32) function fofs(x) return bit.bswap(x)*two32 end else fofs = f32 end end -- Create ELF object and fill in header. local o = ffi.new(is64 and "ELF64obj" or "ELF32obj") local hdr = o.hdr if ctx.os == "bsd" or ctx.os == "other" then -- Determine native hdr.eosabi. local bf = assert(io.open("/bin/ls", "rb")) local bs = bf:read(9) bf:close() ffi.copy(o, bs, 9) check(hdr.emagic[0] == 127, "no support for writing native object files") else hdr.emagic = "\127ELF" hdr.eosabi = ({ freebsd=9, netbsd=2, openbsd=12, solaris=6 })[ctx.os] or 0 end hdr.eclass = is64 and 2 or 1 hdr.eendian = isbe and 2 or 1 hdr.eversion = 1 hdr.type = f16(1) hdr.machine = f16(({ x86=3, x64=62, arm=40, ppc=20, ppcspe=20, mips=8, mipsel=8 })[ctx.arch]) if ctx.arch == "mips" or ctx.arch == "mipsel" then hdr.flags = 0x50001006 end hdr.version = f32(1) hdr.shofs = fofs(ffi.offsetof(o, "sect")) hdr.ehsize = f16(ffi.sizeof(hdr)) hdr.shentsize = f16(ffi.sizeof(o.sect[0])) hdr.shnum = f16(6) hdr.shstridx = f16(2) -- Fill in sections and symbols. local sofs, ofs = ffi.offsetof(o, "space"), 1 for i,name in ipairs{ ".symtab", ".shstrtab", ".strtab", ".rodata", ".note.GNU-stack", } do local sect = o.sect[i] sect.align = fofs(1) sect.name = f32(ofs) ffi.copy(o.space+ofs, name) ofs = ofs + #name+1 end o.sect[1].type = f32(2) -- .symtab o.sect[1].link = f32(3) o.sect[1].info = f32(1) o.sect[1].align = fofs(8) o.sect[1].ofs = fofs(ffi.offsetof(o, "sym")) o.sect[1].entsize = fofs(ffi.sizeof(o.sym[0])) o.sect[1].size = fofs(ffi.sizeof(o.sym)) o.sym[1].name = f32(1) o.sym[1].sectidx = f16(4) o.sym[1].size = fofs(#s) o.sym[1].info = 17 o.sect[2].type = f32(3) -- .shstrtab o.sect[2].ofs = fofs(sofs) o.sect[2].size = fofs(ofs) o.sect[3].type = f32(3) -- .strtab o.sect[3].ofs = fofs(sofs + ofs) o.sect[3].size = fofs(#symname+1) ffi.copy(o.space+ofs+1, symname) ofs = ofs + #symname + 2 o.sect[4].type = f32(1) -- .rodata o.sect[4].flags = fofs(2) o.sect[4].ofs = fofs(sofs + ofs) o.sect[4].size = fofs(#s) o.sect[5].type = f32(1) -- .note.GNU-stack o.sect[5].ofs = fofs(sofs + ofs + #s) -- Write ELF object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) bcsave_tail(fp, output, s) end local function bcsave_peobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint16_t arch, nsects; uint32_t time, symtabofs, nsyms; uint16_t opthdrsz, flags; } PEheader; typedef struct { char name[8]; uint32_t vsize, vaddr, size, ofs, relocofs, lineofs; uint16_t nreloc, nline; uint32_t flags; } PEsection; typedef struct __attribute((packed)) { union { char name[8]; uint32_t nameref[2]; }; uint32_t value; int16_t sect; uint16_t type; uint8_t scl, naux; } PEsym; typedef struct __attribute((packed)) { uint32_t size; uint16_t nreloc, nline; uint32_t cksum; uint16_t assoc; uint8_t comdatsel, unused[3]; } PEsymaux; typedef struct { PEheader hdr; PEsection sect[2]; // Must be an even number of symbol structs. PEsym sym0; PEsymaux sym0aux; PEsym sym1; PEsymaux sym1aux; PEsym sym2; PEsym sym3; uint32_t strtabsize; uint8_t space[4096]; } PEobj; ]] local symname = LJBC_PREFIX..ctx.modname local is64 = false if ctx.arch == "x86" then symname = "_"..symname elseif ctx.arch == "x64" then is64 = true end local symexport = " /EXPORT:"..symname..",DATA " -- The file format is always little-endian. Swap if the host is big-endian. local function f32(x) return x end local f16 = f32 if ffi.abi("be") then f32 = bit.bswap function f16(x) return bit.rshift(bit.bswap(x), 16) end end -- Create PE object and fill in header. local o = ffi.new("PEobj") local hdr = o.hdr hdr.arch = f16(({ x86=0x14c, x64=0x8664, arm=0x1c0, ppc=0x1f2, mips=0x366, mipsel=0x366 })[ctx.arch]) hdr.nsects = f16(2) hdr.symtabofs = f32(ffi.offsetof(o, "sym0")) hdr.nsyms = f32(6) -- Fill in sections and symbols. o.sect[0].name = ".drectve" o.sect[0].size = f32(#symexport) o.sect[0].flags = f32(0x00100a00) o.sym0.sect = f16(1) o.sym0.scl = 3 o.sym0.name = ".drectve" o.sym0.naux = 1 o.sym0aux.size = f32(#symexport) o.sect[1].name = ".rdata" o.sect[1].size = f32(#s) o.sect[1].flags = f32(0x40300040) o.sym1.sect = f16(2) o.sym1.scl = 3 o.sym1.name = ".rdata" o.sym1.naux = 1 o.sym1aux.size = f32(#s) o.sym2.sect = f16(2) o.sym2.scl = 2 o.sym2.nameref[1] = f32(4) o.sym3.sect = f16(-1) o.sym3.scl = 2 o.sym3.value = f32(1) o.sym3.name = "@feat.00" -- Mark as SafeSEH compliant. ffi.copy(o.space, symname) local ofs = #symname + 1 o.strtabsize = f32(ofs + 4) o.sect[0].ofs = f32(ffi.offsetof(o, "space") + ofs) ffi.copy(o.space + ofs, symexport) ofs = ofs + #symexport o.sect[1].ofs = f32(ffi.offsetof(o, "space") + ofs) -- Write PE object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) bcsave_tail(fp, output, s) end local function bcsave_machobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint32_t magic, cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags; } mach_header; typedef struct { mach_header; uint32_t reserved; } mach_header_64; typedef struct { uint32_t cmd, cmdsize; char segname[16]; uint32_t vmaddr, vmsize, fileoff, filesize; uint32_t maxprot, initprot, nsects, flags; } mach_segment_command; typedef struct { uint32_t cmd, cmdsize; char segname[16]; uint64_t vmaddr, vmsize, fileoff, filesize; uint32_t maxprot, initprot, nsects, flags; } mach_segment_command_64; typedef struct { char sectname[16], segname[16]; uint32_t addr, size; uint32_t offset, align, reloff, nreloc, flags; uint32_t reserved1, reserved2; } mach_section; typedef struct { char sectname[16], segname[16]; uint64_t addr, size; uint32_t offset, align, reloff, nreloc, flags; uint32_t reserved1, reserved2, reserved3; } mach_section_64; typedef struct { uint32_t cmd, cmdsize, symoff, nsyms, stroff, strsize; } mach_symtab_command; typedef struct { int32_t strx; uint8_t type, sect; int16_t desc; uint32_t value; } mach_nlist; typedef struct { uint32_t strx; uint8_t type, sect; uint16_t desc; uint64_t value; } mach_nlist_64; typedef struct { uint32_t magic, nfat_arch; } mach_fat_header; typedef struct { uint32_t cputype, cpusubtype, offset, size, align; } mach_fat_arch; typedef struct { struct { mach_header hdr; mach_segment_command seg; mach_section sec; mach_symtab_command sym; } arch[1]; mach_nlist sym_entry; uint8_t space[4096]; } mach_obj; typedef struct { struct { mach_header_64 hdr; mach_segment_command_64 seg; mach_section_64 sec; mach_symtab_command sym; } arch[1]; mach_nlist_64 sym_entry; uint8_t space[4096]; } mach_obj_64; typedef struct { mach_fat_header fat; mach_fat_arch fat_arch[4]; struct { mach_header hdr; mach_segment_command seg; mach_section sec; mach_symtab_command sym; } arch[4]; mach_nlist sym_entry; uint8_t space[4096]; } mach_fat_obj; ]] local symname = '_'..LJBC_PREFIX..ctx.modname local isfat, is64, align, mobj = false, false, 4, "mach_obj" if ctx.arch == "x64" then is64, align, mobj = true, 8, "mach_obj_64" elseif ctx.arch == "arm" then isfat, mobj = true, "mach_fat_obj" else check(ctx.arch == "x86", "unsupported architecture for OSX") end local function aligned(v, a) return bit.band(v+a-1, -a) end local be32 = bit.bswap -- Mach-O FAT is BE, supported archs are LE. -- Create Mach-O object and fill in header. local o = ffi.new(mobj) local mach_size = aligned(ffi.offsetof(o, "space")+#symname+2, align) local cputype = ({ x86={7}, x64={0x01000007}, arm={7,12,12,12} })[ctx.arch] local cpusubtype = ({ x86={3}, x64={3}, arm={3,6,9,11} })[ctx.arch] if isfat then o.fat.magic = be32(0xcafebabe) o.fat.nfat_arch = be32(#cpusubtype) end -- Fill in sections and symbols. for i=0,#cpusubtype-1 do local ofs = 0 if isfat then local a = o.fat_arch[i] a.cputype = be32(cputype[i+1]) a.cpusubtype = be32(cpusubtype[i+1]) -- Subsequent slices overlap each other to share data. ofs = ffi.offsetof(o, "arch") + i*ffi.sizeof(o.arch[0]) a.offset = be32(ofs) a.size = be32(mach_size-ofs+#s) end local a = o.arch[i] a.hdr.magic = is64 and 0xfeedfacf or 0xfeedface a.hdr.cputype = cputype[i+1] a.hdr.cpusubtype = cpusubtype[i+1] a.hdr.filetype = 1 a.hdr.ncmds = 2 a.hdr.sizeofcmds = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)+ffi.sizeof(a.sym) a.seg.cmd = is64 and 0x19 or 0x1 a.seg.cmdsize = ffi.sizeof(a.seg)+ffi.sizeof(a.sec) a.seg.vmsize = #s a.seg.fileoff = mach_size-ofs a.seg.filesize = #s a.seg.maxprot = 1 a.seg.initprot = 1 a.seg.nsects = 1 ffi.copy(a.sec.sectname, "__data") ffi.copy(a.sec.segname, "__DATA") a.sec.size = #s a.sec.offset = mach_size-ofs a.sym.cmd = 2 a.sym.cmdsize = ffi.sizeof(a.sym) a.sym.symoff = ffi.offsetof(o, "sym_entry")-ofs a.sym.nsyms = 1 a.sym.stroff = ffi.offsetof(o, "sym_entry")+ffi.sizeof(o.sym_entry)-ofs a.sym.strsize = aligned(#symname+2, align) end o.sym_entry.type = 0xf o.sym_entry.sect = 1 o.sym_entry.strx = 1 ffi.copy(o.space+1, symname) -- Write Macho-O object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, mach_size)) bcsave_tail(fp, output, s) end local function bcsave_obj(ctx, output, s) local ok, ffi = pcall(require, "ffi") check(ok, "FFI library required to write this file type") if ctx.os == "windows" then return bcsave_peobj(ctx, output, s, ffi) elseif ctx.os == "osx" then return bcsave_machobj(ctx, output, s, ffi) else return bcsave_elfobj(ctx, output, s, ffi) end end ------------------------------------------------------------------------------ local function bclist(input, output) local f = readfile(input) require("jit.bc").dump(f, savefile(output, "w"), true) end local function bcsave(ctx, input, output) local f = readfile(input) local s = string.dump(f, ctx.strip) local t = ctx.type if not t then t = detecttype(output) ctx.type = t end if t == "raw" then bcsave_raw(output, s) else if not ctx.modname then ctx.modname = detectmodname(input) end if t == "obj" then bcsave_obj(ctx, output, s) else bcsave_c(ctx, output, s) end end end local function docmd(...) local arg = {...} local n = 1 local list = false local ctx = { strip = true, arch = jit.arch, os = string.lower(jit.os), type = false, modname = false, } while n <= #arg do local a = arg[n] if type(a) == "string" and string.sub(a, 1, 1) == "-" and a ~= "-" then table.remove(arg, n) if a == "--" then break end for m=2,#a do local opt = string.sub(a, m, m) if opt == "l" then list = true elseif opt == "s" then ctx.strip = true elseif opt == "g" then ctx.strip = false else if arg[n] == nil or m ~= #a then usage() end if opt == "e" then if n ~= 1 then usage() end arg[1] = check(loadstring(arg[1])) elseif opt == "n" then ctx.modname = checkmodname(table.remove(arg, n)) elseif opt == "t" then ctx.type = checkarg(table.remove(arg, n), map_type, "file type") elseif opt == "a" then ctx.arch = checkarg(table.remove(arg, n), map_arch, "architecture") elseif opt == "o" then ctx.os = checkarg(table.remove(arg, n), map_os, "OS name") else usage() end end end else n = n + 1 end end if list then if #arg == 0 or #arg > 2 then usage() end bclist(arg[1], arg[2] or "-") else if #arg ~= 2 then usage() end bcsave(ctx, arg[1], arg[2]) end end ------------------------------------------------------------------------------ -- Public module functions. module(...) start = docmd -- Process -b command line option.
apache-2.0
Racinettee/reef
source/LuaJIT-2.0.4/src/jit/bcsave.lua
87
18141
---------------------------------------------------------------------------- -- LuaJIT module to save/list bytecode. -- -- Copyright (C) 2005-2015 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- -- This module saves or lists the bytecode for an input file. -- It's run by the -b command line option. -- ------------------------------------------------------------------------------ local jit = require("jit") assert(jit.version_num == 20004, "LuaJIT core/library version mismatch") local bit = require("bit") -- Symbol name prefix for LuaJIT bytecode. local LJBC_PREFIX = "luaJIT_BC_" ------------------------------------------------------------------------------ local function usage() io.stderr:write[[ Save LuaJIT bytecode: luajit -b[options] input output -l Only list bytecode. -s Strip debug info (default). -g Keep debug info. -n name Set module name (default: auto-detect from input name). -t type Set output file type (default: auto-detect from output name). -a arch Override architecture for object files (default: native). -o os Override OS for object files (default: native). -e chunk Use chunk string as input. -- Stop handling options. - Use stdin as input and/or stdout as output. File types: c h obj o raw (default) ]] os.exit(1) end local function check(ok, ...) if ok then return ok, ... end io.stderr:write("luajit: ", ...) io.stderr:write("\n") os.exit(1) end local function readfile(input) if type(input) == "function" then return input end if input == "-" then input = nil end return check(loadfile(input)) end local function savefile(name, mode) if name == "-" then return io.stdout end return check(io.open(name, mode)) end ------------------------------------------------------------------------------ local map_type = { raw = "raw", c = "c", h = "h", o = "obj", obj = "obj", } local map_arch = { x86 = true, x64 = true, arm = true, ppc = true, ppcspe = true, mips = true, mipsel = true, } local map_os = { linux = true, windows = true, osx = true, freebsd = true, netbsd = true, openbsd = true, dragonfly = true, solaris = true, } local function checkarg(str, map, err) str = string.lower(str) local s = check(map[str], "unknown ", err) return s == true and str or s end local function detecttype(str) local ext = string.match(string.lower(str), "%.(%a+)$") return map_type[ext] or "raw" end local function checkmodname(str) check(string.match(str, "^[%w_.%-]+$"), "bad module name") return string.gsub(str, "[%.%-]", "_") end local function detectmodname(str) if type(str) == "string" then local tail = string.match(str, "[^/\\]+$") if tail then str = tail end local head = string.match(str, "^(.*)%.[^.]*$") if head then str = head end str = string.match(str, "^[%w_.%-]+") else str = nil end check(str, "cannot derive module name, use -n name") return string.gsub(str, "[%.%-]", "_") end ------------------------------------------------------------------------------ local function bcsave_tail(fp, output, s) local ok, err = fp:write(s) if ok and output ~= "-" then ok, err = fp:close() end check(ok, "cannot write ", output, ": ", err) end local function bcsave_raw(output, s) local fp = savefile(output, "wb") bcsave_tail(fp, output, s) end local function bcsave_c(ctx, output, s) local fp = savefile(output, "w") if ctx.type == "c" then fp:write(string.format([[ #ifdef _cplusplus extern "C" #endif #ifdef _WIN32 __declspec(dllexport) #endif const char %s%s[] = { ]], LJBC_PREFIX, ctx.modname)) else fp:write(string.format([[ #define %s%s_SIZE %d static const char %s%s[] = { ]], LJBC_PREFIX, ctx.modname, #s, LJBC_PREFIX, ctx.modname)) end local t, n, m = {}, 0, 0 for i=1,#s do local b = tostring(string.byte(s, i)) m = m + #b + 1 if m > 78 then fp:write(table.concat(t, ",", 1, n), ",\n") n, m = 0, #b + 1 end n = n + 1 t[n] = b end bcsave_tail(fp, output, table.concat(t, ",", 1, n).."\n};\n") end local function bcsave_elfobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; uint16_t type, machine; uint32_t version; uint32_t entry, phofs, shofs; uint32_t flags; uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; } ELF32header; typedef struct { uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; uint16_t type, machine; uint32_t version; uint64_t entry, phofs, shofs; uint32_t flags; uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; } ELF64header; typedef struct { uint32_t name, type, flags, addr, ofs, size, link, info, align, entsize; } ELF32sectheader; typedef struct { uint32_t name, type; uint64_t flags, addr, ofs, size; uint32_t link, info; uint64_t align, entsize; } ELF64sectheader; typedef struct { uint32_t name, value, size; uint8_t info, other; uint16_t sectidx; } ELF32symbol; typedef struct { uint32_t name; uint8_t info, other; uint16_t sectidx; uint64_t value, size; } ELF64symbol; typedef struct { ELF32header hdr; ELF32sectheader sect[6]; ELF32symbol sym[2]; uint8_t space[4096]; } ELF32obj; typedef struct { ELF64header hdr; ELF64sectheader sect[6]; ELF64symbol sym[2]; uint8_t space[4096]; } ELF64obj; ]] local symname = LJBC_PREFIX..ctx.modname local is64, isbe = false, false if ctx.arch == "x64" then is64 = true elseif ctx.arch == "ppc" or ctx.arch == "ppcspe" or ctx.arch == "mips" then isbe = true end -- Handle different host/target endianess. local function f32(x) return x end local f16, fofs = f32, f32 if ffi.abi("be") ~= isbe then f32 = bit.bswap function f16(x) return bit.rshift(bit.bswap(x), 16) end if is64 then local two32 = ffi.cast("int64_t", 2^32) function fofs(x) return bit.bswap(x)*two32 end else fofs = f32 end end -- Create ELF object and fill in header. local o = ffi.new(is64 and "ELF64obj" or "ELF32obj") local hdr = o.hdr if ctx.os == "bsd" or ctx.os == "other" then -- Determine native hdr.eosabi. local bf = assert(io.open("/bin/ls", "rb")) local bs = bf:read(9) bf:close() ffi.copy(o, bs, 9) check(hdr.emagic[0] == 127, "no support for writing native object files") else hdr.emagic = "\127ELF" hdr.eosabi = ({ freebsd=9, netbsd=2, openbsd=12, solaris=6 })[ctx.os] or 0 end hdr.eclass = is64 and 2 or 1 hdr.eendian = isbe and 2 or 1 hdr.eversion = 1 hdr.type = f16(1) hdr.machine = f16(({ x86=3, x64=62, arm=40, ppc=20, ppcspe=20, mips=8, mipsel=8 })[ctx.arch]) if ctx.arch == "mips" or ctx.arch == "mipsel" then hdr.flags = 0x50001006 end hdr.version = f32(1) hdr.shofs = fofs(ffi.offsetof(o, "sect")) hdr.ehsize = f16(ffi.sizeof(hdr)) hdr.shentsize = f16(ffi.sizeof(o.sect[0])) hdr.shnum = f16(6) hdr.shstridx = f16(2) -- Fill in sections and symbols. local sofs, ofs = ffi.offsetof(o, "space"), 1 for i,name in ipairs{ ".symtab", ".shstrtab", ".strtab", ".rodata", ".note.GNU-stack", } do local sect = o.sect[i] sect.align = fofs(1) sect.name = f32(ofs) ffi.copy(o.space+ofs, name) ofs = ofs + #name+1 end o.sect[1].type = f32(2) -- .symtab o.sect[1].link = f32(3) o.sect[1].info = f32(1) o.sect[1].align = fofs(8) o.sect[1].ofs = fofs(ffi.offsetof(o, "sym")) o.sect[1].entsize = fofs(ffi.sizeof(o.sym[0])) o.sect[1].size = fofs(ffi.sizeof(o.sym)) o.sym[1].name = f32(1) o.sym[1].sectidx = f16(4) o.sym[1].size = fofs(#s) o.sym[1].info = 17 o.sect[2].type = f32(3) -- .shstrtab o.sect[2].ofs = fofs(sofs) o.sect[2].size = fofs(ofs) o.sect[3].type = f32(3) -- .strtab o.sect[3].ofs = fofs(sofs + ofs) o.sect[3].size = fofs(#symname+1) ffi.copy(o.space+ofs+1, symname) ofs = ofs + #symname + 2 o.sect[4].type = f32(1) -- .rodata o.sect[4].flags = fofs(2) o.sect[4].ofs = fofs(sofs + ofs) o.sect[4].size = fofs(#s) o.sect[5].type = f32(1) -- .note.GNU-stack o.sect[5].ofs = fofs(sofs + ofs + #s) -- Write ELF object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) bcsave_tail(fp, output, s) end local function bcsave_peobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint16_t arch, nsects; uint32_t time, symtabofs, nsyms; uint16_t opthdrsz, flags; } PEheader; typedef struct { char name[8]; uint32_t vsize, vaddr, size, ofs, relocofs, lineofs; uint16_t nreloc, nline; uint32_t flags; } PEsection; typedef struct __attribute((packed)) { union { char name[8]; uint32_t nameref[2]; }; uint32_t value; int16_t sect; uint16_t type; uint8_t scl, naux; } PEsym; typedef struct __attribute((packed)) { uint32_t size; uint16_t nreloc, nline; uint32_t cksum; uint16_t assoc; uint8_t comdatsel, unused[3]; } PEsymaux; typedef struct { PEheader hdr; PEsection sect[2]; // Must be an even number of symbol structs. PEsym sym0; PEsymaux sym0aux; PEsym sym1; PEsymaux sym1aux; PEsym sym2; PEsym sym3; uint32_t strtabsize; uint8_t space[4096]; } PEobj; ]] local symname = LJBC_PREFIX..ctx.modname local is64 = false if ctx.arch == "x86" then symname = "_"..symname elseif ctx.arch == "x64" then is64 = true end local symexport = " /EXPORT:"..symname..",DATA " -- The file format is always little-endian. Swap if the host is big-endian. local function f32(x) return x end local f16 = f32 if ffi.abi("be") then f32 = bit.bswap function f16(x) return bit.rshift(bit.bswap(x), 16) end end -- Create PE object and fill in header. local o = ffi.new("PEobj") local hdr = o.hdr hdr.arch = f16(({ x86=0x14c, x64=0x8664, arm=0x1c0, ppc=0x1f2, mips=0x366, mipsel=0x366 })[ctx.arch]) hdr.nsects = f16(2) hdr.symtabofs = f32(ffi.offsetof(o, "sym0")) hdr.nsyms = f32(6) -- Fill in sections and symbols. o.sect[0].name = ".drectve" o.sect[0].size = f32(#symexport) o.sect[0].flags = f32(0x00100a00) o.sym0.sect = f16(1) o.sym0.scl = 3 o.sym0.name = ".drectve" o.sym0.naux = 1 o.sym0aux.size = f32(#symexport) o.sect[1].name = ".rdata" o.sect[1].size = f32(#s) o.sect[1].flags = f32(0x40300040) o.sym1.sect = f16(2) o.sym1.scl = 3 o.sym1.name = ".rdata" o.sym1.naux = 1 o.sym1aux.size = f32(#s) o.sym2.sect = f16(2) o.sym2.scl = 2 o.sym2.nameref[1] = f32(4) o.sym3.sect = f16(-1) o.sym3.scl = 2 o.sym3.value = f32(1) o.sym3.name = "@feat.00" -- Mark as SafeSEH compliant. ffi.copy(o.space, symname) local ofs = #symname + 1 o.strtabsize = f32(ofs + 4) o.sect[0].ofs = f32(ffi.offsetof(o, "space") + ofs) ffi.copy(o.space + ofs, symexport) ofs = ofs + #symexport o.sect[1].ofs = f32(ffi.offsetof(o, "space") + ofs) -- Write PE object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) bcsave_tail(fp, output, s) end local function bcsave_machobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint32_t magic, cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags; } mach_header; typedef struct { mach_header; uint32_t reserved; } mach_header_64; typedef struct { uint32_t cmd, cmdsize; char segname[16]; uint32_t vmaddr, vmsize, fileoff, filesize; uint32_t maxprot, initprot, nsects, flags; } mach_segment_command; typedef struct { uint32_t cmd, cmdsize; char segname[16]; uint64_t vmaddr, vmsize, fileoff, filesize; uint32_t maxprot, initprot, nsects, flags; } mach_segment_command_64; typedef struct { char sectname[16], segname[16]; uint32_t addr, size; uint32_t offset, align, reloff, nreloc, flags; uint32_t reserved1, reserved2; } mach_section; typedef struct { char sectname[16], segname[16]; uint64_t addr, size; uint32_t offset, align, reloff, nreloc, flags; uint32_t reserved1, reserved2, reserved3; } mach_section_64; typedef struct { uint32_t cmd, cmdsize, symoff, nsyms, stroff, strsize; } mach_symtab_command; typedef struct { int32_t strx; uint8_t type, sect; int16_t desc; uint32_t value; } mach_nlist; typedef struct { uint32_t strx; uint8_t type, sect; uint16_t desc; uint64_t value; } mach_nlist_64; typedef struct { uint32_t magic, nfat_arch; } mach_fat_header; typedef struct { uint32_t cputype, cpusubtype, offset, size, align; } mach_fat_arch; typedef struct { struct { mach_header hdr; mach_segment_command seg; mach_section sec; mach_symtab_command sym; } arch[1]; mach_nlist sym_entry; uint8_t space[4096]; } mach_obj; typedef struct { struct { mach_header_64 hdr; mach_segment_command_64 seg; mach_section_64 sec; mach_symtab_command sym; } arch[1]; mach_nlist_64 sym_entry; uint8_t space[4096]; } mach_obj_64; typedef struct { mach_fat_header fat; mach_fat_arch fat_arch[4]; struct { mach_header hdr; mach_segment_command seg; mach_section sec; mach_symtab_command sym; } arch[4]; mach_nlist sym_entry; uint8_t space[4096]; } mach_fat_obj; ]] local symname = '_'..LJBC_PREFIX..ctx.modname local isfat, is64, align, mobj = false, false, 4, "mach_obj" if ctx.arch == "x64" then is64, align, mobj = true, 8, "mach_obj_64" elseif ctx.arch == "arm" then isfat, mobj = true, "mach_fat_obj" else check(ctx.arch == "x86", "unsupported architecture for OSX") end local function aligned(v, a) return bit.band(v+a-1, -a) end local be32 = bit.bswap -- Mach-O FAT is BE, supported archs are LE. -- Create Mach-O object and fill in header. local o = ffi.new(mobj) local mach_size = aligned(ffi.offsetof(o, "space")+#symname+2, align) local cputype = ({ x86={7}, x64={0x01000007}, arm={7,12,12,12} })[ctx.arch] local cpusubtype = ({ x86={3}, x64={3}, arm={3,6,9,11} })[ctx.arch] if isfat then o.fat.magic = be32(0xcafebabe) o.fat.nfat_arch = be32(#cpusubtype) end -- Fill in sections and symbols. for i=0,#cpusubtype-1 do local ofs = 0 if isfat then local a = o.fat_arch[i] a.cputype = be32(cputype[i+1]) a.cpusubtype = be32(cpusubtype[i+1]) -- Subsequent slices overlap each other to share data. ofs = ffi.offsetof(o, "arch") + i*ffi.sizeof(o.arch[0]) a.offset = be32(ofs) a.size = be32(mach_size-ofs+#s) end local a = o.arch[i] a.hdr.magic = is64 and 0xfeedfacf or 0xfeedface a.hdr.cputype = cputype[i+1] a.hdr.cpusubtype = cpusubtype[i+1] a.hdr.filetype = 1 a.hdr.ncmds = 2 a.hdr.sizeofcmds = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)+ffi.sizeof(a.sym) a.seg.cmd = is64 and 0x19 or 0x1 a.seg.cmdsize = ffi.sizeof(a.seg)+ffi.sizeof(a.sec) a.seg.vmsize = #s a.seg.fileoff = mach_size-ofs a.seg.filesize = #s a.seg.maxprot = 1 a.seg.initprot = 1 a.seg.nsects = 1 ffi.copy(a.sec.sectname, "__data") ffi.copy(a.sec.segname, "__DATA") a.sec.size = #s a.sec.offset = mach_size-ofs a.sym.cmd = 2 a.sym.cmdsize = ffi.sizeof(a.sym) a.sym.symoff = ffi.offsetof(o, "sym_entry")-ofs a.sym.nsyms = 1 a.sym.stroff = ffi.offsetof(o, "sym_entry")+ffi.sizeof(o.sym_entry)-ofs a.sym.strsize = aligned(#symname+2, align) end o.sym_entry.type = 0xf o.sym_entry.sect = 1 o.sym_entry.strx = 1 ffi.copy(o.space+1, symname) -- Write Macho-O object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, mach_size)) bcsave_tail(fp, output, s) end local function bcsave_obj(ctx, output, s) local ok, ffi = pcall(require, "ffi") check(ok, "FFI library required to write this file type") if ctx.os == "windows" then return bcsave_peobj(ctx, output, s, ffi) elseif ctx.os == "osx" then return bcsave_machobj(ctx, output, s, ffi) else return bcsave_elfobj(ctx, output, s, ffi) end end ------------------------------------------------------------------------------ local function bclist(input, output) local f = readfile(input) require("jit.bc").dump(f, savefile(output, "w"), true) end local function bcsave(ctx, input, output) local f = readfile(input) local s = string.dump(f, ctx.strip) local t = ctx.type if not t then t = detecttype(output) ctx.type = t end if t == "raw" then bcsave_raw(output, s) else if not ctx.modname then ctx.modname = detectmodname(input) end if t == "obj" then bcsave_obj(ctx, output, s) else bcsave_c(ctx, output, s) end end end local function docmd(...) local arg = {...} local n = 1 local list = false local ctx = { strip = true, arch = jit.arch, os = string.lower(jit.os), type = false, modname = false, } while n <= #arg do local a = arg[n] if type(a) == "string" and string.sub(a, 1, 1) == "-" and a ~= "-" then table.remove(arg, n) if a == "--" then break end for m=2,#a do local opt = string.sub(a, m, m) if opt == "l" then list = true elseif opt == "s" then ctx.strip = true elseif opt == "g" then ctx.strip = false else if arg[n] == nil or m ~= #a then usage() end if opt == "e" then if n ~= 1 then usage() end arg[1] = check(loadstring(arg[1])) elseif opt == "n" then ctx.modname = checkmodname(table.remove(arg, n)) elseif opt == "t" then ctx.type = checkarg(table.remove(arg, n), map_type, "file type") elseif opt == "a" then ctx.arch = checkarg(table.remove(arg, n), map_arch, "architecture") elseif opt == "o" then ctx.os = checkarg(table.remove(arg, n), map_os, "OS name") else usage() end end end else n = n + 1 end end if list then if #arg == 0 or #arg > 2 then usage() end bclist(arg[1], arg[2] or "-") else if #arg ~= 2 then usage() end bcsave(ctx, arg[1], arg[2]) end end ------------------------------------------------------------------------------ -- Public module functions. module(...) start = docmd -- Process -b command line option.
mit
TheAnswer/FirstTest
bin/scripts/items/objects/clothing/bodysuits/main.lua
1
3003
--Copyright (C) 2007 <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. RunItemLUAFile("objects/clothing/bodysuits/atat.lua"); RunItemLUAFile("objects/clothing/bodysuits/atatQuest.lua"); RunItemLUAFile("objects/clothing/bodysuits/bwing.lua"); RunItemLUAFile("objects/clothing/bodysuits/bwingQuest.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit1.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit6.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit8.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit12.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit13.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit14.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit15.lua"); RunItemLUAFile("objects/clothing/bodysuits/bodysuit16.lua"); RunItemLUAFile("objects/clothing/bodysuits/sarlacc.lua"); RunItemLUAFile("objects/clothing/bodysuits/tieFighter.lua"); RunItemLUAFile("objects/clothing/bodysuits/tieFighterQuest.lua");
lgpl-3.0
nullifye/tg-bot-pi
tg_bot/plugins/webshot.lua
1
1461
return function(msg) cmd = "pi:webshot" if args[1]==cmd then if #args == 2 then if not http_code(args[2], "200 301 302") then send_msg (target, "("..cmd..") '"..args[2].."' is not available", ok_cb, false) return true end send_msg (target, "("..cmd..") processing... may take a moment", ok_cb, false) curr_time = os.time() try = os.execute('curl -s https://screenshotmachine.com/processor.php --connect-timeout '..TIMEOUT..' -d "urlparam='..args[2]..'&size=FULL" -H "Referer: https://screenshotmachine.com/" -H "DNT: 1" -H "Origin: https://screenshotmachine.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36" | sed -n "s/.*href=\'\\([^\']*\\).*/\\1/p" > '..TMP_PATH..'/webshot'..curr_time..'.out') if try then imglink = exec('cat '..TMP_PATH..'/webshot'..curr_time..'.out') imglink = string.gsub(imglink, "\n", "") -- trim newline getvid = os.execute('curl -s "https://screenshotmachine.com/'..imglink..'" -so '..TMP_PATH..'/webshot'..curr_time..'.png') send_document (target, TMP_PATH.."/webshot"..curr_time..".png", ok_cb, false) else send_text (target, "("..cmd..") server takes too long to respond.\ntry again", ok_cb, false) end else send_msg (target, "📝 "..cmd.." <URL>", ok_cb, false) end return true end end
apache-2.0
badboyam/redstorm
plugins/banhammer.lua
106
11894
local function pre_process(msg) -- SERVICE MESSAGE if msg.action and msg.action.type then local action = msg.action.type -- Check if banned user joins chat by link if action == 'chat_add_user_link' then local user_id = msg.from.id print('Checking invited user '..user_id) local banned = is_banned(user_id, msg.to.id) if banned or is_gbanned(user_id) then -- Check it with redis print('User is banned!') local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] is banned and kicked ! ")-- Save to logs kick_user(user_id, msg.to.id) end end -- Check if banned user joins chat if action == 'chat_add_user' then local user_id = msg.action.user.id print('Checking invited user '..user_id) local banned = is_banned(user_id, msg.to.id) if banned or is_gbanned(user_id) then -- Check it with redis print('User is banned!') local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] added a banned user >"..msg.action.user.id)-- Save to logs kick_user(user_id, msg.to.id) local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id redis:incr(banhash) local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id local banaddredis = redis:get(banhash) if banaddredis then if tonumber(banaddredis) == 4 and not is_owner(msg) then kick_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 3 times end if tonumber(banaddredis) == 8 and not is_owner(msg) then ban_user(msg.from.id, msg.to.id)-- Kick user who adds ban ppl more than 7 times local banhash = 'addedbanuser:'..msg.to.id..':'..msg.from.id redis:set(banhash, 0)-- Reset the Counter end end end if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['lock_bots'] then bots_protection = data[tostring(msg.to.id)]['settings']['lock_bots'] end end end if msg.action.user.username ~= nil then if string.sub(msg.action.user.username:lower(), -3) == 'bot' and not is_momod(msg) and bots_protection == "yes" then --- Will kick bots added by normal users local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] added a bot > @".. msg.action.user.username)-- Save to logs kick_user(msg.action.user.id, msg.to.id) end end end -- No further checks return msg end -- banned user is talking ! if msg.to.type == 'chat' then local data = load_data(_config.moderation.data) local group = msg.to.id local texttext = 'groups' --if not data[tostring(texttext)][tostring(msg.to.id)] and not is_realm(msg) then -- Check if this group is one of my groups or not --chat_del_user('chat#id'..msg.to.id,'user#id'..our_id,ok_cb,false) --return --end local user_id = msg.from.id local chat_id = msg.to.id local banned = is_banned(user_id, chat_id) if banned or is_gbanned(user_id) then -- Check it with redis print('Banned user talking!') local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] banned user is talking !")-- Save to logs kick_user(user_id, chat_id) msg.text = '' end end return msg end local function kick_ban_res(extra, success, result) --vardump(result) --vardump(extra) local member_id = result.id local user_id = member_id local member = result.username local chat_id = extra.chat_id local from_id = extra.from_id local get_cmd = extra.get_cmd local receiver = "chat#id"..chat_id if get_cmd == "kick" then if member_id == from_id then return send_large_msg(receiver, "You can't kick yourself") end if is_momod2(member_id, chat_id) and not is_admin2(sender) then return send_large_msg(receiver, "You can't kick mods/owner/admins") end return kick_user(member_id, chat_id) elseif get_cmd == 'ban' then if is_momod2(member_id, chat_id) and not is_admin2(sender) then return send_large_msg(receiver, "You can't ban mods/owner/admins") end send_large_msg(receiver, 'User @'..member..' ['..member_id..'] banned') return ban_user(member_id, chat_id) elseif get_cmd == 'unban' then send_large_msg(receiver, 'User @'..member..' ['..member_id..'] unbanned') local hash = 'banned:'..chat_id redis:srem(hash, member_id) return 'User '..user_id..' unbanned' elseif get_cmd == 'banall' then send_large_msg(receiver, 'User @'..member..' ['..member_id..'] globally banned') return banall_user(member_id, chat_id) elseif get_cmd == 'unbanall' then send_large_msg(receiver, 'User @'..member..' ['..member_id..'] un-globally banned') return unbanall_user(member_id, chat_id) end end local function run(msg, matches) if matches[1]:lower() == 'id' then if msg.to.type == "user" then return "Bot ID: "..msg.to.id.. "\n\nYour ID: "..msg.from.id end if type(msg.reply_id) ~= "nil" then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") id = get_message(msg.reply_id,get_message_callback_id, false) elseif matches[1]:lower() == 'id' then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] used /id ") return "Group ID for " ..string.gsub(msg.to.print_name, "_", " ").. ":\n\n"..msg.to.id end end if matches[1]:lower() == 'kickme' then-- /kickme local receiver = get_receiver(msg) if msg.to.type == 'chat' then local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] left using kickme ")-- Save to logs chat_del_user("chat#id"..msg.to.id, "user#id"..msg.from.id, ok_cb, false) end end if not is_momod(msg) then -- Ignore normal users return end if matches[1]:lower() == "banlist" then -- Ban list ! local chat_id = msg.to.id if matches[2] and is_admin(msg) then chat_id = matches[2] end return ban_list(chat_id) end if matches[1]:lower() == 'ban' then-- /ban if type(msg.reply_id)~="nil" and is_momod(msg) then if is_admin(msg) then local msgr = get_message(msg.reply_id,ban_by_reply_admins, false) else msgr = get_message(msg.reply_id,ban_by_reply, false) end end local user_id = matches[2] local chat_id = msg.to.id if string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return end if not is_admin(msg) and is_momod2(matches[2], msg.to.id) then return "you can't ban mods/owner/admins" end if tonumber(matches[2]) == tonumber(msg.from.id) then return "You can't ban your self !" end local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] baned user ".. matches[2]) ban_user(user_id, chat_id) else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'ban', from_id = msg.from.id } local username = matches[2] local username = string.gsub(matches[2], '@', '') res_user(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'unban' then -- /unban if type(msg.reply_id)~="nil" and is_momod(msg) then local msgr = get_message(msg.reply_id,unban_by_reply, false) end local user_id = matches[2] local chat_id = msg.to.id local targetuser = matches[2] if string.match(targetuser, '^%d+$') then local user_id = targetuser local hash = 'banned:'..chat_id redis:srem(hash, user_id) local name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] unbaned user ".. matches[2]) return 'User '..user_id..' unbanned' else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'unban', from_id = msg.from.id } local username = matches[2] local username = string.gsub(matches[2], '@', '') res_user(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'kick' then if type(msg.reply_id)~="nil" and is_momod(msg) then if is_admin(msg) then local msgr = get_message(msg.reply_id,Kick_by_reply_admins, false) else msgr = get_message(msg.reply_id,Kick_by_reply, false) end end if string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return end if not is_admin(msg) and is_momod2(matches[2], msg.to.id) then return "you can't kick mods/owner/admins" end if tonumber(matches[2]) == tonumber(msg.from.id) then return "You can't kick your self !" end local user_id = matches[2] local chat_id = msg.to.id name = user_print_name(msg.from) savelog(msg.to.id, name.." ["..msg.from.id.."] kicked user ".. matches[2]) kick_user(user_id, chat_id) else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'kick', from_id = msg.from.id } local username = matches[2] local username = string.gsub(matches[2], '@', '') res_user(username, kick_ban_res, cbres_extra) end end if not is_admin(msg) then return end if matches[1]:lower() == 'banall' then -- Global ban if type(msg.reply_id) ~="nil" and is_admin(msg) then return get_message(msg.reply_id,banall_by_reply, false) end local user_id = matches[2] local chat_id = msg.to.id local targetuser = matches[2] if string.match(targetuser, '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return false end banall_user(targetuser) return 'User ['..user_id..' ] globally banned' else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'banall', from_id = msg.from.id } local username = matches[2] local username = string.gsub(matches[2], '@', '') res_user(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == 'unbanall' then -- Global unban local user_id = matches[2] local chat_id = msg.to.id if string.match(matches[2], '^%d+$') then if tonumber(matches[2]) == tonumber(our_id) then return false end unbanall_user(user_id) return 'User ['..user_id..' ] removed from global ban list' else local cbres_extra = { chat_id = msg.to.id, get_cmd = 'unbanall', from_id = msg.from.id } local username = matches[2] local username = string.gsub(matches[2], '@', '') res_user(username, kick_ban_res, cbres_extra) end end if matches[1]:lower() == "gbanlist" then -- Global ban list return banall_list() end end return { patterns = { "^[!/]([Bb]anall) (.*)$", "^[!/]([Bb]anall)$", "^[!/]([Bb]anlist) (.*)$", "^[!/]([Bb]anlist)$", "^[!/]([Gg]banlist)$", "^[!/]([Bb]an) (.*)$", "^[!/]([Kk]ick)$", "^[!/]([Uu]nban) (.*)$", "^[!/]([Uu]nbanall) (.*)$", "^[!/]([Uu]nbanall)$", "^[!/]([Kk]ick) (.*)$", "^[!/]([Kk]ickme)$", "^[!/]([Bb]an)$", "^[!/]([Uu]nban)$", "^[!/]([Ii]d)$", "^([Bb]anall) (.*)$", "^([Bb]anall)$", "^([Bb]anlist) (.*)$", "^([Bb]anlist)$", "^([Gg]banlist)$", "^([Bb]an) (.*)$", "^([Kk]ick)$", "^([Uu]nban) (.*)$", "^([Uu]nbanall) (.*)$", "^([Uu]nbanall)$", "^([Kk]ick) (.*)$", "^([Kk]ickme)$", "^([Bb]an)$", "^([Uu]nban)$", "^([Ii]d)$", "^!!tgservice (.+)$" }, run = run, pre_process = pre_process }
gpl-2.0
Andrettin/Wyrmsun
scripts/world_earth_tiles_germany.lua
1
2784
-- _________ __ __ -- / _____// |_____________ _/ |______ ____ __ __ ______ -- \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ -- / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ -- /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > -- \/ \/ \//_____/ \/ -- ______________________ ______________________ -- T H E W A R B E G I N S -- Stratagus - A free fantasy real time strategy game engine -- -- (c) Copyright 2016-2022 by Andrettin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- DefineWorldMapTile({500, 109}, { World = "earth", CulturalSettlementNames = { "teuton", "Düsseldorf" } }) DefineWorldMapTile({502, 115}, { World = "earth", CulturalSettlementNames = { "teuton", "Kaiserslautern" } }) DefineWorldMapTile({503, 117}, { World = "earth", CulturalSettlementNames = { "teuton", "Rastatt" } }) DefineWorldMapTile({506, 109}, { World = "earth", CulturalSettlementNames = { "teuton", "Kassel" }, FactionCulturalSettlementNames = { "english", "england", "Cassel" } }) DefineWorldMapTile({508, 114}, { World = "earth", CulturalSettlementNames = { "teuton", "Würzburg" } }) DefineWorldMapTile({509, 107}, { World = "earth", CulturalSettlementNames = { "teuton", "Braunschweig" }, FactionCulturalSettlementNames = { "english", "england", "Brunswick" } }) DefineWorldMapTile({515, 109}, { World = "earth", CulturalSettlementNames = { "teuton", "Leipzig" } }) DefineWorldMapTile({520, 109}, { World = "earth", CulturalSettlementNames = { "teuton", "Bautzen" } }) DefineWorldMapTile({521, 108}, { World = "earth", CulturalSettlementNames = { "teuton", "Guben" } }) DefineWorldMapTile({522, 106}, { World = "earth", CulturalSettlementNames = { "teuton", "Küstrin" } }) DefineWorldMapTile({526, 110}, { World = "earth", CulturalSettlementNames = { "teuton", "Breslau" } })
gpl-2.0
bgould/thrift
test/lua/test_basic_server.lua
30
3451
-- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you 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. require('ThriftTest_ThriftTest') require('TSocket') require('TBufferedTransport') require('TFramedTransport') require('THttpTransport') require('TCompactProtocol') require('TJsonProtocol') require('TBinaryProtocol') require('TServer') require('liblualongnumber') -------------------------------------------------------------------------------- -- Handler TestHandler = ThriftTestIface:new{} -- Stops the server function TestHandler:testVoid() end function TestHandler:testString(str) return str end function TestHandler:testBool(bool) return bool end function TestHandler:testByte(byte) return byte end function TestHandler:testI32(i32) return i32 end function TestHandler:testI64(i64) return i64 end function TestHandler:testDouble(d) return d end function TestHandler:testBinary(by) return by end function TestHandler:testStruct(thing) return thing end -------------------------------------------------------------------------------- -- Test local server function teardown() if server then server:close() end end function parseArgs(rawArgs) local opt = { protocol='binary', transport='buffered', port='9090', } for i, str in pairs(rawArgs) do if i > 0 then k, v = string.match(str, '--(%w+)=(%w+)') assert(opt[k] ~= nil, 'Unknown argument') opt[k] = v end end return opt end function testBasicServer(rawArgs) local opt = parseArgs(rawArgs) -- Handler & Processor local handler = TestHandler:new{} assert(handler, 'Failed to create handler') local processor = ThriftTestProcessor:new{ handler = handler } assert(processor, 'Failed to create processor') -- Server Socket local socket = TServerSocket:new{ port = opt.port } assert(socket, 'Failed to create server socket') -- Transport & Factory local transports = { buffered = TBufferedTransportFactory, framed = TFramedTransportFactory, http = THttpTransportFactory, } assert(transports[opt.transport], 'Failed to create framed transport factory') local trans_factory = transports[opt.transport]:new{} local protocols = { binary = TBinaryProtocolFactory, compact = TCompactProtocolFactory, json = TJSONProtocolFactory, } local prot_factory = protocols[opt.protocol]:new{} assert(prot_factory, 'Failed to create binary protocol factory') -- Simple Server server = TSimpleServer:new{ processor = processor, serverTransport = socket, transportFactory = trans_factory, protocolFactory = prot_factory } assert(server, 'Failed to create server') -- Serve server:serve() server = nil end testBasicServer(arg) teardown()
apache-2.0
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/Repeat.lua
1
2113
-------------------------------- -- @module Repeat -- @extend ActionInterval -- @parent_module cc -------------------------------- -- Sets the inner action.<br> -- param action The inner action. -- @function [parent=#Repeat] setInnerAction -- @param self -- @param #cc.FiniteTimeAction action -- @return Repeat#Repeat self (return value: cc.Repeat) -------------------------------- -- Gets the inner action.<br> -- return The inner action. -- @function [parent=#Repeat] getInnerAction -- @param self -- @return FiniteTimeAction#FiniteTimeAction ret (return value: cc.FiniteTimeAction) -------------------------------- -- Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30).<br> -- param action The action needs to repeat.<br> -- param times The repeat times.<br> -- return An autoreleased Repeat object. -- @function [parent=#Repeat] create -- @param self -- @param #cc.FiniteTimeAction action -- @param #unsigned int times -- @return Repeat#Repeat ret (return value: cc.Repeat) -------------------------------- -- -- @function [parent=#Repeat] startWithTarget -- @param self -- @param #cc.Node target -- @return Repeat#Repeat self (return value: cc.Repeat) -------------------------------- -- -- @function [parent=#Repeat] reverse -- @param self -- @return Repeat#Repeat ret (return value: cc.Repeat) -------------------------------- -- -- @function [parent=#Repeat] clone -- @param self -- @return Repeat#Repeat ret (return value: cc.Repeat) -------------------------------- -- -- @function [parent=#Repeat] stop -- @param self -- @return Repeat#Repeat self (return value: cc.Repeat) -------------------------------- -- param dt In seconds. -- @function [parent=#Repeat] update -- @param self -- @param #float dt -- @return Repeat#Repeat self (return value: cc.Repeat) -------------------------------- -- -- @function [parent=#Repeat] isDone -- @param self -- @return bool#bool ret (return value: bool) return nil
apache-2.0
Xeltor/ovale
libs/AceAddon-3.0/AceAddon-3.0.lua
66
25788
--- **AceAddon-3.0** provides a template for creating addon objects. -- It'll provide you with a set of callback functions that allow you to simplify the loading -- process of your addon.\\ -- Callbacks provided are:\\ -- * **OnInitialize**, which is called directly after the addon is fully loaded. -- * **OnEnable** which gets called during the PLAYER_LOGIN event, when most of the data provided by the game is already present. -- * **OnDisable**, which is only called when your addon is manually being disabled. -- @usage -- -- A small (but complete) addon, that doesn't do anything, -- -- but shows usage of the callbacks. -- local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") -- -- function MyAddon:OnInitialize() -- -- do init tasks here, like loading the Saved Variables, -- -- or setting up slash commands. -- end -- -- function MyAddon:OnEnable() -- -- Do more initialization here, that really enables the use of your addon. -- -- Register Events, Hook functions, Create Frames, Get information from -- -- the game that wasn't available in OnInitialize -- end -- -- function MyAddon:OnDisable() -- -- Unhook, Unregister Events, Hide frames that you created. -- -- You would probably only use an OnDisable if you want to -- -- build a "standby" mode, or be able to toggle modules on/off. -- end -- @class file -- @name AceAddon-3.0.lua -- @release $Id: AceAddon-3.0.lua 1084 2013-04-27 20:14:11Z nevcairiel $ local MAJOR, MINOR = "AceAddon-3.0", 12 local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceAddon then return end -- No Upgrade needed. AceAddon.frame = AceAddon.frame or CreateFrame("Frame", "AceAddon30Frame") -- Our very own frame AceAddon.addons = AceAddon.addons or {} -- addons in general AceAddon.statuses = AceAddon.statuses or {} -- statuses of addon. AceAddon.initializequeue = AceAddon.initializequeue or {} -- addons that are new and not initialized AceAddon.enablequeue = AceAddon.enablequeue or {} -- addons that are initialized and waiting to be enabled AceAddon.embeds = AceAddon.embeds or setmetatable({}, {__index = function(tbl, key) tbl[key] = {} return tbl[key] end }) -- contains a list of libraries embedded in an addon -- Lua APIs local tinsert, tconcat, tremove = table.insert, table.concat, table.remove local fmt, tostring = string.format, tostring local select, pairs, next, type, unpack = select, pairs, next, type, unpack local loadstring, assert, error = loadstring, assert, error local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded -- List them here for Mikk's FindGlobals script -- GLOBALS: LibStub, IsLoggedIn, geterrorhandler --[[ xpcall safecall implementation ]] local xpcall = xpcall local function errorhandler(err) return geterrorhandler()(err) end local function CreateDispatcher(argCount) local code = [[ local xpcall, eh = ... local method, ARGS local function call() return method(ARGS) end local function dispatch(func, ...) method = func if not method then return end ARGS = ... return xpcall(call, eh) end return dispatch ]] local ARGS = {} for i = 1, argCount do ARGS[i] = "arg"..i end code = code:gsub("ARGS", tconcat(ARGS, ", ")) return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler) end local Dispatchers = setmetatable({}, {__index=function(self, argCount) local dispatcher = CreateDispatcher(argCount) rawset(self, argCount, dispatcher) return dispatcher end}) Dispatchers[0] = function(func) return xpcall(func, errorhandler) end local function safecall(func, ...) -- we check to see if the func is passed is actually a function here and don't error when it isn't -- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not -- present execution should continue without hinderance if type(func) == "function" then return Dispatchers[select('#', ...)](func, ...) end end -- local functions that will be implemented further down local Enable, Disable, EnableModule, DisableModule, Embed, NewModule, GetModule, GetName, SetDefaultModuleState, SetDefaultModuleLibraries, SetEnabledState, SetDefaultModulePrototype -- used in the addon metatable local function addontostring( self ) return self.name end -- Check if the addon is queued for initialization local function queuedForInitialization(addon) for i = 1, #AceAddon.initializequeue do if AceAddon.initializequeue[i] == addon then return true end end return false end --- Create a new AceAddon-3.0 addon. -- Any libraries you specified will be embeded, and the addon will be scheduled for -- its OnInitialize and OnEnable callbacks. -- The final addon object, with all libraries embeded, will be returned. -- @paramsig [object ,]name[, lib, ...] -- @param object Table to use as a base for the addon (optional) -- @param name Name of the addon object to create -- @param lib List of libraries to embed into the addon -- @usage -- -- Create a simple addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceEvent-3.0") -- -- -- Create a Addon object based on the table of a frame -- local MyFrame = CreateFrame("Frame") -- MyAddon = LibStub("AceAddon-3.0"):NewAddon(MyFrame, "MyAddon", "AceEvent-3.0") function AceAddon:NewAddon(objectorname, ...) local object,name local i=1 if type(objectorname)=="table" then object=objectorname name=... i=2 else name=objectorname end if type(name)~="string" then error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end if self.addons[name] then error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - Addon '%s' already exists."):format(name), 2) end object = object or {} object.name = name local addonmeta = {} local oldmeta = getmetatable(object) if oldmeta then for k, v in pairs(oldmeta) do addonmeta[k] = v end end addonmeta.__tostring = addontostring setmetatable( object, addonmeta ) self.addons[name] = object object.modules = {} object.orderedModules = {} object.defaultModuleLibraries = {} Embed( object ) -- embed NewModule, GetModule methods self:EmbedLibraries(object, select(i,...)) -- add to queue of addons to be initialized upon ADDON_LOADED tinsert(self.initializequeue, object) return object end --- Get the addon object by its name from the internal AceAddon registry. -- Throws an error if the addon object cannot be found (except if silent is set). -- @param name unique name of the addon object -- @param silent if true, the addon is optional, silently return nil if its not found -- @usage -- -- Get the Addon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") function AceAddon:GetAddon(name, silent) if not silent and not self.addons[name] then error(("Usage: GetAddon(name): 'name' - Cannot find an AceAddon '%s'."):format(tostring(name)), 2) end return self.addons[name] end -- - Embed a list of libraries into the specified addon. -- This function will try to embed all of the listed libraries into the addon -- and error if a single one fails. -- -- **Note:** This function is for internal use by :NewAddon/:NewModule -- @paramsig addon, [lib, ...] -- @param addon addon object to embed the libs in -- @param lib List of libraries to embed into the addon function AceAddon:EmbedLibraries(addon, ...) for i=1,select("#", ... ) do local libname = select(i, ...) self:EmbedLibrary(addon, libname, false, 4) end end -- - Embed a library into the addon object. -- This function will check if the specified library is registered with LibStub -- and if it has a :Embed function to call. It'll error if any of those conditions -- fails. -- -- **Note:** This function is for internal use by :EmbedLibraries -- @paramsig addon, libname[, silent[, offset]] -- @param addon addon object to embed the library in -- @param libname name of the library to embed -- @param silent marks an embed to fail silently if the library doesn't exist (optional) -- @param offset will push the error messages back to said offset, defaults to 2 (optional) function AceAddon:EmbedLibrary(addon, libname, silent, offset) local lib = LibStub:GetLibrary(libname, true) if not lib and not silent then error(("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Cannot find a library instance of %q."):format(tostring(libname)), offset or 2) elseif lib and type(lib.Embed) == "function" then lib:Embed(addon) tinsert(self.embeds[addon], libname) return true elseif lib then error(("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Library '%s' is not Embed capable"):format(libname), offset or 2) end end --- Return the specified module from an addon object. -- Throws an error if the addon object cannot be found (except if silent is set) -- @name //addon//:GetModule -- @paramsig name[, silent] -- @param name unique name of the module -- @param silent if true, the module is optional, silently return nil if its not found (optional) -- @usage -- -- Get the Addon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- -- Get the Module -- MyModule = MyAddon:GetModule("MyModule") function GetModule(self, name, silent) if not self.modules[name] and not silent then error(("Usage: GetModule(name, silent): 'name' - Cannot find module '%s'."):format(tostring(name)), 2) end return self.modules[name] end local function IsModuleTrue(self) return true end --- Create a new module for the addon. -- The new module can have its own embeded libraries and/or use a module prototype to be mixed into the module.\\ -- A module has the same functionality as a real addon, it can have modules of its own, and has the same API as -- an addon object. -- @name //addon//:NewModule -- @paramsig name[, prototype|lib[, lib, ...]] -- @param name unique name of the module -- @param prototype object to derive this module from, methods and values from this table will be mixed into the module (optional) -- @param lib List of libraries to embed into the addon -- @usage -- -- Create a module with some embeded libraries -- MyModule = MyAddon:NewModule("MyModule", "AceEvent-3.0", "AceHook-3.0") -- -- -- Create a module with a prototype -- local prototype = { OnEnable = function(self) print("OnEnable called!") end } -- MyModule = MyAddon:NewModule("MyModule", prototype, "AceEvent-3.0", "AceHook-3.0") function NewModule(self, name, prototype, ...) if type(name) ~= "string" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end if type(prototype) ~= "string" and type(prototype) ~= "table" and type(prototype) ~= "nil" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'prototype' - table (prototype), string (lib) or nil expected got '%s'."):format(type(prototype)), 2) end if self.modules[name] then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - Module '%s' already exists."):format(name), 2) end -- modules are basically addons. We treat them as such. They will be added to the initializequeue properly as well. -- NewModule can only be called after the parent addon is present thus the modules will be initialized after their parent is. local module = AceAddon:NewAddon(fmt("%s_%s", self.name or tostring(self), name)) module.IsModule = IsModuleTrue module:SetEnabledState(self.defaultModuleState) module.moduleName = name if type(prototype) == "string" then AceAddon:EmbedLibraries(module, prototype, ...) else AceAddon:EmbedLibraries(module, ...) end AceAddon:EmbedLibraries(module, unpack(self.defaultModuleLibraries)) if not prototype or type(prototype) == "string" then prototype = self.defaultModulePrototype or nil end if type(prototype) == "table" then local mt = getmetatable(module) mt.__index = prototype setmetatable(module, mt) -- More of a Base class type feel. end safecall(self.OnModuleCreated, self, module) -- Was in Ace2 and I think it could be a cool thing to have handy. self.modules[name] = module tinsert(self.orderedModules, module) return module end --- Returns the real name of the addon or module, without any prefix. -- @name //addon//:GetName -- @paramsig -- @usage -- print(MyAddon:GetName()) -- -- prints "MyAddon" function GetName(self) return self.moduleName or self.name end --- Enables the Addon, if possible, return true or false depending on success. -- This internally calls AceAddon:EnableAddon(), thus dispatching a OnEnable callback -- and enabling all modules of the addon (unless explicitly disabled).\\ -- :Enable() also sets the internal `enableState` variable to true -- @name //addon//:Enable -- @paramsig -- @usage -- -- Enable MyModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") -- MyModule:Enable() function Enable(self) self:SetEnabledState(true) -- nevcairiel 2013-04-27: don't enable an addon/module if its queued for init still -- it'll be enabled after the init process if not queuedForInitialization(self) then return AceAddon:EnableAddon(self) end end --- Disables the Addon, if possible, return true or false depending on success. -- This internally calls AceAddon:DisableAddon(), thus dispatching a OnDisable callback -- and disabling all modules of the addon.\\ -- :Disable() also sets the internal `enableState` variable to false -- @name //addon//:Disable -- @paramsig -- @usage -- -- Disable MyAddon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyAddon:Disable() function Disable(self) self:SetEnabledState(false) return AceAddon:DisableAddon(self) end --- Enables the Module, if possible, return true or false depending on success. -- Short-hand function that retrieves the module via `:GetModule` and calls `:Enable` on the module object. -- @name //addon//:EnableModule -- @paramsig name -- @usage -- -- Enable MyModule using :GetModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") -- MyModule:Enable() -- -- -- Enable MyModule using the short-hand -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyAddon:EnableModule("MyModule") function EnableModule(self, name) local module = self:GetModule( name ) return module:Enable() end --- Disables the Module, if possible, return true or false depending on success. -- Short-hand function that retrieves the module via `:GetModule` and calls `:Disable` on the module object. -- @name //addon//:DisableModule -- @paramsig name -- @usage -- -- Disable MyModule using :GetModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") -- MyModule:Disable() -- -- -- Disable MyModule using the short-hand -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyAddon:DisableModule("MyModule") function DisableModule(self, name) local module = self:GetModule( name ) return module:Disable() end --- Set the default libraries to be mixed into all modules created by this object. -- Note that you can only change the default module libraries before any module is created. -- @name //addon//:SetDefaultModuleLibraries -- @paramsig lib[, lib, ...] -- @param lib List of libraries to embed into the addon -- @usage -- -- Create the addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") -- -- Configure default libraries for modules (all modules need AceEvent-3.0) -- MyAddon:SetDefaultModuleLibraries("AceEvent-3.0") -- -- Create a module -- MyModule = MyAddon:NewModule("MyModule") function SetDefaultModuleLibraries(self, ...) if next(self.modules) then error("Usage: SetDefaultModuleLibraries(...): cannot change the module defaults after a module has been registered.", 2) end self.defaultModuleLibraries = {...} end --- Set the default state in which new modules are being created. -- Note that you can only change the default state before any module is created. -- @name //addon//:SetDefaultModuleState -- @paramsig state -- @param state Default state for new modules, true for enabled, false for disabled -- @usage -- -- Create the addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") -- -- Set the default state to "disabled" -- MyAddon:SetDefaultModuleState(false) -- -- Create a module and explicilty enable it -- MyModule = MyAddon:NewModule("MyModule") -- MyModule:Enable() function SetDefaultModuleState(self, state) if next(self.modules) then error("Usage: SetDefaultModuleState(state): cannot change the module defaults after a module has been registered.", 2) end self.defaultModuleState = state end --- Set the default prototype to use for new modules on creation. -- Note that you can only change the default prototype before any module is created. -- @name //addon//:SetDefaultModulePrototype -- @paramsig prototype -- @param prototype Default prototype for the new modules (table) -- @usage -- -- Define a prototype -- local prototype = { OnEnable = function(self) print("OnEnable called!") end } -- -- Set the default prototype -- MyAddon:SetDefaultModulePrototype(prototype) -- -- Create a module and explicitly Enable it -- MyModule = MyAddon:NewModule("MyModule") -- MyModule:Enable() -- -- should print "OnEnable called!" now -- @see NewModule function SetDefaultModulePrototype(self, prototype) if next(self.modules) then error("Usage: SetDefaultModulePrototype(prototype): cannot change the module defaults after a module has been registered.", 2) end if type(prototype) ~= "table" then error(("Usage: SetDefaultModulePrototype(prototype): 'prototype' - table expected got '%s'."):format(type(prototype)), 2) end self.defaultModulePrototype = prototype end --- Set the state of an addon or module -- This should only be called before any enabling actually happend, e.g. in/before OnInitialize. -- @name //addon//:SetEnabledState -- @paramsig state -- @param state the state of an addon or module (enabled=true, disabled=false) function SetEnabledState(self, state) self.enabledState = state end --- Return an iterator of all modules associated to the addon. -- @name //addon//:IterateModules -- @paramsig -- @usage -- -- Enable all modules -- for name, module in MyAddon:IterateModules() do -- module:Enable() -- end local function IterateModules(self) return pairs(self.modules) end -- Returns an iterator of all embeds in the addon -- @name //addon//:IterateEmbeds -- @paramsig local function IterateEmbeds(self) return pairs(AceAddon.embeds[self]) end --- Query the enabledState of an addon. -- @name //addon//:IsEnabled -- @paramsig -- @usage -- if MyAddon:IsEnabled() then -- MyAddon:Disable() -- end local function IsEnabled(self) return self.enabledState end local mixins = { NewModule = NewModule, GetModule = GetModule, Enable = Enable, Disable = Disable, EnableModule = EnableModule, DisableModule = DisableModule, IsEnabled = IsEnabled, SetDefaultModuleLibraries = SetDefaultModuleLibraries, SetDefaultModuleState = SetDefaultModuleState, SetDefaultModulePrototype = SetDefaultModulePrototype, SetEnabledState = SetEnabledState, IterateModules = IterateModules, IterateEmbeds = IterateEmbeds, GetName = GetName, } local function IsModule(self) return false end local pmixins = { defaultModuleState = true, enabledState = true, IsModule = IsModule, } -- Embed( target ) -- target (object) - target object to embed aceaddon in -- -- this is a local function specifically since it's meant to be only called internally function Embed(target, skipPMixins) for k, v in pairs(mixins) do target[k] = v end if not skipPMixins then for k, v in pairs(pmixins) do target[k] = target[k] or v end end end -- - Initialize the addon after creation. -- This function is only used internally during the ADDON_LOADED event -- It will call the **OnInitialize** function on the addon object (if present), -- and the **OnEmbedInitialize** function on all embeded libraries. -- -- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. -- @param addon addon object to intialize function AceAddon:InitializeAddon(addon) safecall(addon.OnInitialize, addon) local embeds = self.embeds[addon] for i = 1, #embeds do local lib = LibStub:GetLibrary(embeds[i], true) if lib then safecall(lib.OnEmbedInitialize, lib, addon) end end -- we don't call InitializeAddon on modules specifically, this is handled -- from the event handler and only done _once_ end -- - Enable the addon after creation. -- Note: This function is only used internally during the PLAYER_LOGIN event, or during ADDON_LOADED, -- if IsLoggedIn() already returns true at that point, e.g. for LoD Addons. -- It will call the **OnEnable** function on the addon object (if present), -- and the **OnEmbedEnable** function on all embeded libraries.\\ -- This function does not toggle the enable state of the addon itself, and will return early if the addon is disabled. -- -- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. -- Use :Enable on the addon itself instead. -- @param addon addon object to enable function AceAddon:EnableAddon(addon) if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end if self.statuses[addon.name] or not addon.enabledState then return false end -- set the statuses first, before calling the OnEnable. this allows for Disabling of the addon in OnEnable. self.statuses[addon.name] = true safecall(addon.OnEnable, addon) -- make sure we're still enabled before continueing if self.statuses[addon.name] then local embeds = self.embeds[addon] for i = 1, #embeds do local lib = LibStub:GetLibrary(embeds[i], true) if lib then safecall(lib.OnEmbedEnable, lib, addon) end end -- enable possible modules. local modules = addon.orderedModules for i = 1, #modules do self:EnableAddon(modules[i]) end end return self.statuses[addon.name] -- return true if we're disabled end -- - Disable the addon -- Note: This function is only used internally. -- It will call the **OnDisable** function on the addon object (if present), -- and the **OnEmbedDisable** function on all embeded libraries.\\ -- This function does not toggle the enable state of the addon itself, and will return early if the addon is still enabled. -- -- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. -- Use :Disable on the addon itself instead. -- @param addon addon object to enable function AceAddon:DisableAddon(addon) if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end if not self.statuses[addon.name] then return false end -- set statuses first before calling OnDisable, this allows for aborting the disable in OnDisable. self.statuses[addon.name] = false safecall( addon.OnDisable, addon ) -- make sure we're still disabling... if not self.statuses[addon.name] then local embeds = self.embeds[addon] for i = 1, #embeds do local lib = LibStub:GetLibrary(embeds[i], true) if lib then safecall(lib.OnEmbedDisable, lib, addon) end end -- disable possible modules. local modules = addon.orderedModules for i = 1, #modules do self:DisableAddon(modules[i]) end end return not self.statuses[addon.name] -- return true if we're disabled end --- Get an iterator over all registered addons. -- @usage -- -- Print a list of all installed AceAddon's -- for name, addon in AceAddon:IterateAddons() do -- print("Addon: " .. name) -- end function AceAddon:IterateAddons() return pairs(self.addons) end --- Get an iterator over the internal status registry. -- @usage -- -- Print a list of all enabled addons -- for name, status in AceAddon:IterateAddonStatus() do -- if status then -- print("EnabledAddon: " .. name) -- end -- end function AceAddon:IterateAddonStatus() return pairs(self.statuses) end -- Following Iterators are deprecated, and their addon specific versions should be used -- e.g. addon:IterateEmbeds() instead of :IterateEmbedsOnAddon(addon) function AceAddon:IterateEmbedsOnAddon(addon) return pairs(self.embeds[addon]) end function AceAddon:IterateModulesOfAddon(addon) return pairs(addon.modules) end -- Event Handling local function onEvent(this, event, arg1) -- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then -- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration while(#AceAddon.initializequeue > 0) do local addon = tremove(AceAddon.initializequeue, 1) -- this might be an issue with recursion - TODO: validate if event == "ADDON_LOADED" then addon.baseName = arg1 end AceAddon:InitializeAddon(addon) tinsert(AceAddon.enablequeue, addon) end if IsLoggedIn() then while(#AceAddon.enablequeue > 0) do local addon = tremove(AceAddon.enablequeue, 1) AceAddon:EnableAddon(addon) end end end end AceAddon.frame:RegisterEvent("ADDON_LOADED") AceAddon.frame:RegisterEvent("PLAYER_LOGIN") AceAddon.frame:SetScript("OnEvent", onEvent) -- upgrade embeded for name, addon in pairs(AceAddon.addons) do Embed(addon, true) end -- 2010-10-27 nevcairiel - add new "orderedModules" table if oldminor and oldminor < 10 then for name, addon in pairs(AceAddon.addons) do addon.orderedModules = {} for module_name, module in pairs(addon.modules) do tinsert(addon.orderedModules, module) end end end
mit
TheAnswer/FirstTest
bin/scripts/items/bluefrog/wookieGarb.lua
1
2495
--Copyright (C) 2007 <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. wookieeGarb = {wookieeGloves1, wookieeGloves2, wookieeGloves3, wookieeGloves4, wookieeHat, wookieeHood1, wookieeHood2, wookieeHood3, wookieeLifedayRobe, wookieeLifedayRobeF, wookieeLifedayRobeM, wookieeShirt1, wookieeShirt2, wookieeShirt3, wookieeShirt4, wookieeShoulderpad1, wookieeShoulderpad2, wookieeSkirt1, wookieeSkirt2, wookieeSkirt3, wookieeSkirt4} addBFItemSet("Wookiee Clothing" , wookieeGarb);
lgpl-3.0
martin-damien/babel
locales/nl_NL.lua
1
1547
LOCALE = { formats = { currency = { symbol = "€", name = "Euro", short_name = "EUR", decimal_symbol = ",", thousand_separator = ".", fract_digits = 2, positive_symbol = "", negative_symbol = "-", positive_format = "%c %p%q", negative_format = "%c %p%q" }, number = { decimal_symbol = ",", thousand_separator = ".", fract_digits = 2, positive_symbol = "", negative_symbol = "-" }, date_time = { long_time = "%H:%i:%s", short_time = "%H:%i", long_date = "%l %d %F %Y", short_date = "%d-%m-%Y", long_date_time = "%l %d %F %Y %H.%i uur", -- The time should not start with a zero: 8.30 uur short_date_time = "%d-%m-%Y %H:%i:%s" }, short_month_names = { "jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec" }, long_month_names = { "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" }, short_day_names = { "ma", "di", "wo", "do", "vr", "za", "zo" }, long_day_names = { "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag", "zondag" } } } return LOCALE
mit
PAPAGENO-devels/papageno
test/benchmarks/Lua/lua-regression-test/grim/dlg_eva.lua
1
11700
CheckFirstTime("dlg_eva.lua") ev1 = Dialog:create() ev1.focus = ha.eva_obj ev1.intro = function(arg1, arg2) -- line 7 ev1.node = "first_eva_node" ha:current_setup(ha_evaws) stop_script(ha.elevator_door_timer) stop_script(ha.elevator_open_too_long) manny:turn_toward_entity(ha.eva_obj.obj_x, ha.eva_obj.obj_y, ha.eva_obj.obj_z) if reaped_bruno then if not ev1.talked_bruno then ev1[3].off = FALSE end ev1[8].off = TRUE ev1[10].off = TRUE ev1[2].off = TRUE ev1[12].off = TRUE ev1[14].off = TRUE met_eva = TRUE end if arg2 == "work_order" then ev1:execute_line(ev1[2]) else if not met_eva then met_eva = TRUE manny:say_line("/hama001/") wait_for_message() eva:say_line("/haev002/") wait_for_message() end if ga.been_there and not met_glottis and not ev1[14].said then ev1[14].off = FALSE else ev1[14].off = TRUE end if co.been_there and not ev1.talked_don and not reaped_bruno then ev1[4].off = FALSE end if ga.work_order.owner == manny and not reaped_bruno then ev1[2].off = FALSE end end end manny.hand_order = function() -- line 66 manny:walkto(ha.eva_obj) if manny.is_holding ~= ga.work_order then shrinkBoxesEnabled = FALSE open_inventory(TRUE, TRUE) manny.is_holding = ga.work_order close_inventory() if GlobalShrinkEnabled then shrinkBoxesEnabled = TRUE end end end ev1[2] = { text = "/hama003/", first_eva_node = TRUE, gesture = manny.hand_order } ev1[2].off = TRUE ev1[2].response = function(arg1) -- line 82 ev1.node = "exit_dialog" stop_script(run_idle) eva:say_line("/haev004/") eva:play_chore(eva_sec_prepare_to_buzz, "eva_sec.cos") sleep_for(1000) eva:wait_for_message() eva:play_chore(eva_sec_buzz, "eva_sec.cos") sleep_for(750) start_sfx("intrcom.wav") wait_for_sound("intrcom.wav") start_sfx("intrbuzz.wav") wait_for_sound("intrbuzz.wav") if co.computer.set_to_sign then cur_puzzle_state[2] = TRUE start_script(cut_scene.lol, cut_scene) else eva:say_line("/haev005/") eva:wait_for_message() co.computer:respond() wait_for_message() eva:say_line("/haev006/") eva:play_chore(eva_sec_s_buzz_back, "eva_sec.cos") eva:wait_for_message() eva:say_line("/haev007/") eva:wait_for_message() start_script(put_away_held_item) if not buzzed_don then buzzed_don = TRUE eva:say_line("/haev008/") wait_for_message() manny:say_line("/hama009/") wait_for_message() eva:say_line("/haev010/") end eva:blend(eva_sec_read_loop, eva_sec_s_buzz_back, 1000, "eva_sec.cos") start_script(run_idle, eva, eva.idle_table, eva_sec_read_loop) end end ev1[3] = { text = "/hama011/", first_eva_node = TRUE } ev1[3].off = TRUE ev1[3].response = function(arg1) -- line 127 arg1.off = TRUE ev1.talked_bruno = TRUE eva:say_line("/haev012/") wait_for_message() eva:say_line("/haev013/") wait_for_message() manny:say_line("/hama014/") wait_for_message() eva:say_line("/haev015/") end ev1[4] = { text = "/hama017/", first_eva_node = TRUE } ev1[4].off = TRUE ev1[4].response = function(arg1) -- line 141 arg1.off = TRUE ev1.talked_don = TRUE eva:say_line("/haev018/") wait_for_message() manny:say_line("/hama019/") wait_for_message() eva:say_line("/haev020/") wait_for_message() eva:say_line("/haev021/") end ev1[5] = { text = "/hama022/", first_eva_node = TRUE } ev1[5].off = TRUE ev1[5].response = function(arg1) -- line 155 if ev1.explained_all then ev1:explain_choice() else ev1.node = "explain2_node" eva:say_line("/haev023/") end end ev1[8] = { text = "/hama024/", first_eva_node = TRUE } ev1[8].response = function(arg1) -- line 165 arg1.off = TRUE ev1[10].off = FALSE eva:say_line("/haev025/") wait_for_message() eva:say_line("/haev026/") end ev1[10] = { text = "/hama027/", first_eva_node = TRUE } ev1[10].off = TRUE ev1[10].response = function(arg1) -- line 175 arg1.off = TRUE ev1[12].off = FALSE eva:say_line("/haev028/") end ev1[12] = { text = "/hama030/", first_eva_node = TRUE } ev1[12].off = TRUE ev1[12].response = function(arg1) -- line 185 ev1:explain_choice() end ev1[14] = { text = "/hama031/", first_eva_node = TRUE } ev1[14].off = TRUE ev1[14].response = function(arg1) -- line 192 arg1.off = TRUE arg1.said = TRUE ev1:explain_choice() end ev1.explain_choice = function(arg1) -- line 198 if ev1.explained_all then ev1[12].off = TRUE ev1[5].off = TRUE ev1.node = "first_eva_node" eva:say_line("/haev032/") wait_for_message() eva:say_line("/haev033/") else ev1.node = "explain_node" eva:say_line("/haev034/") end end ev1.done_explaining = function(arg1) -- line 212 end ev1[15] = { text = "/hama035/", first_eva_node = TRUE } ev1[15].response = function(arg1) -- line 216 arg1.off = TRUE ev1[20].off = FALSE eva:say_line("/haev036/") wait_for_message() manny:say_line("/hama037/") wait_for_message() eva:say_line("/haev038/") wait_for_message() eva:say_line("/haev039/") wait_for_message() eva:say_line("/haev040/") wait_for_message() eva:say_line("/haev041/") wait_for_message() manny:say_line("/hama042/") end ev1[20] = { text = "/hama043/", first_eva_node = TRUE } ev1[20].off = TRUE ev1[20].response = function(arg1) -- line 236 arg1.off = TRUE ev1[30].off = FALSE eva:say_line("/haev044/") wait_for_message() eva:say_line("/haev045/") wait_for_message() eva:say_line("/haev046/") end ev1[30] = { text = "/hama047/", first_eva_node = TRUE } ev1[30].off = TRUE ev1[30].response = function(arg1) -- line 248 arg1.off = TRUE eva:say_line("/haev048/") wait_for_message() eva:say_line("/haev049/") wait_for_message() manny:say_line("/hama050/") wait_for_message() eva:say_line("/haev051/") end ev1[35] = { text = "/hama052/", first_eva_node = TRUE } ev1[35].response = function(arg1) -- line 260 arg1.off = TRUE eva:say_line("/haev053/") wait_for_message() manny:say_line("/hama054/") end ev1[40] = { text = "/hama055/", first_eva_node = TRUE } ev1[40].response = function(arg1) -- line 268 arg1.off = TRUE ev1[43].off = FALSE eva:say_line("/haev056/") wait_for_message() manny:say_line("/hama057/") wait_for_message() eva:say_line("/haev058/") wait_for_message() eva:say_line("/haev059/") end ev1[43] = { text = "/hama060/", first_eva_node = TRUE } ev1[43].off = TRUE ev1[43].response = function(arg1) -- line 282 arg1.off = TRUE eva:say_line("/haev061/") wait_for_message() eva:say_line("/haev062/") wait_for_message() manny:say_line("/hama063/") wait_for_message() eva:say_line("/haev064/") wait_for_message() if reaped_bruno then manny:say_line("/hama065/") else manny:say_line("/hama066/") wait_for_message() eva:say_line("/haev067/") end end ev1[50] = { text = "/hama068/", first_eva_node = TRUE } ev1[50].response = function(arg1) -- line 302 arg1.off = TRUE eva:say_line("/haev069/") wait_for_message() eva:say_line("/haev070/") end ev1[60] = { text = "/hama071/", first_eva_node = TRUE } ev1[60].response = function(arg1) -- line 310 arg1.off = TRUE eva:say_line("/haev072/") wait_for_message() manny:say_line("/hama073/") wait_for_message() eva:say_line("/haev074/") wait_for_message() manny:say_line("/hama075/") end ev1[70] = { text = "/hama076/", explain_node = TRUE } ev1[70].response = function(arg1) -- line 322 ev1.node = "explain2_node" ev1[5].off = FALSE eva:say_line("/haev077/") wait_for_message() manny:say_line("/hama078/") wait_for_message() eva:say_line("/haev079/") wait_for_message() eva:say_line("/haev080/") wait_for_message() eva:say_line("/haev081/") wait_for_message() eva:say_line("/haev082/") wait_for_message() eva:say_line("/haev083/") wait_for_message() eva:say_line("/haev084/") end ev1[75] = { text = "/hama085/", explain_node = TRUE } ev1[75].response = ev1[70].response ev1[80] = { text = "/hama086/", explain_node = TRUE } ev1[80].response = function(arg1) -- line 346 ev1.node = "page_node" eva:say_line("/haev087/") end ev1[90] = { text = "/hama088/", page_node = TRUE } ev1[90].response = function(arg1) -- line 352 eva:say_line("/haev089/") ev1:search_line() end ev1[95] = { text = "/hama090/", page_node = TRUE } ev1[95].response = function(arg1) -- line 358 eva:say_line("/haev091/") ev1:search_line() end ev1.search_line = function(arg1) -- line 363 ev1.node = "explain2_node" ev1[105].off = FALSE wait_for_message() eva:say_line("/haev092/") end ev1[100] = { text = "/hama093/", explain2_node = TRUE } ev1[100].response = function(arg1) -- line 371 arg1.off = TRUE eva:say_line("/haev094/") end ev1[105] = { text = "/hama095/", explain2_node = TRUE } ev1[105].off = TRUE ev1[105].response = function(arg1) -- line 378 arg1.off = TRUE eva:say_line("/haev096/") wait_for_message() eva:say_line("/haev097/") wait_for_message() manny:say_line("/hama098/") end ev1[110] = { text = "/hama099/", explain2_node = TRUE } ev1[110].response = function(arg1) -- line 388 arg1.off = TRUE manny:say_line("/hama100/") wait_for_message() eva:say_line("/haev101/") wait_for_message() manny:say_line("/hama102/") wait_for_message() eva:say_line("/haev103/") wait_for_message() manny:say_line("/hama104/") wait_for_message() eva:say_line("/haev105/") wait_for_message() eva:say_line("/haev106/") end ev1[120] = { text = "/hama107/", explain2_node = TRUE } ev1[120].response = function(arg1) -- line 406 arg1.off = TRUE eva:say_line("/haev108/") wait_for_message() manny:say_line("/hama109/") wait_for_message() eva:say_line("/haev110/") end ev1[130] = { text = "/hama111/", expain2_node = TRUE } ev1[130].response = function(arg1) -- line 416 arg1.off = TRUE eva:say_line("/haev112/") wait_for_message() eva:say_line("/haev113/") wait_for_message() eva:say_line("/haev114/") wait_for_message() eva:say_line("/haev115/") wait_for_message() end ev1[140] = { text = "/hama116/", explain2_node = TRUE } ev1[140].response = function(arg1) -- line 429 arg1.off = TRUE eva:say_line("/haev117/") end ev1.exit_lines.first_eva_node = { text = "/hama118/" } ev1.exit_lines.first_eva_node.response = function(arg1) -- line 435 if not ev1.taught_bricks then ev1.taught_bricks = TRUE eva:say_line("/haev119/") end ev1.node = "exit_dialog" end ev1.exit_lines.explain2_node = ev1.exit_lines.first_eva_node ev1.aborts.first_eva_node = function(arg1) -- line 444 ev1:clear() ev1.node = "exit_dialog" eva:say_line("/haev120/") wait_for_message() manny:say_line("/hama121/") end ev1.aborts.explain2_node = function(arg1) -- line 452 ev1:clear() ev1.explained_all = TRUE ev1.node = "first_eva_node" end ev1.outro = function(arg1) -- line 458 system.currentSet:force_camerachange() end ev1[999] = "EOD"
gpl-2.0
TheAnswer/FirstTest
bin/scripts/slashcommands/skills/cyborgBurstRun.lua
1
2550
--Copyright (C) 2007 <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. --true = 1, false = 0 CyborgBurstRunSlashCommand = { name = "cyborgburstrun", alternativeNames = "", animation = "", invalidStateMask = 3760586768, --alert, frozen, swimming, glowingJedi, pilotingShip, shipOperations, shipGunner, invalidPostures = "5,6,7,8,9,10,11,12,13,14,4,", target = 2, targeType = 0, disabled = 0, maxRangeToTarget = 0, --adminLevel = 0, addToCombatQueue = 1, } AddCyborgBurstRunSlashCommand(CyborgBurstRunSlashCommand)
lgpl-3.0
JarnoVgr/ZombieSurvival
gamemodes/zombiesurvival/entities/weapons/weapon_zs_dual_p228/shared.lua
1
4435
--/*--------------------------------- --Created with buu342s Swep Creator ---------------------------------*/ --Duby: Created by Old Bill and payed for by Duby for Mr.Green ZS. --Duby: If you're going to take this weapon, then you need to give credit to myself and OldBill for our time and money. --Thanks, Duby SWEP.PrintName = "Dual P228" SWEP.Author = "Old Bill" SWEP.Contact = "oldbillandmedic@gmail.com" SWEP.Purpose = "" SWEP.Instructions = "Left mouse button shoots, Right mouse button does nothing so don't use it." SWEP.Category = "Dual P228" SWEP.Spawnable= true SWEP.AdminSpawnable= true SWEP.AdminOnly = false SWEP.ViewModelFOV = 45 SWEP.ViewModel = "models/weapons/dual_p228.mdl" SWEP.WorldModel = "models/oldbill/w_dualp228.mdl" SWEP.ViewModelFlip = false SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false SWEP.Slot = 3 SWEP.SlotPos = 1 SWEP.UseHands = true SWEP.HoldType = "Duel" SWEP.FiresUnderwater = false SWEP.DrawCrosshair = false SWEP.DrawAmmo = true SWEP.ReloadSound = "weapons/deagle/deagle_reload_1.wav" SWEP.Base = "weapon_zs_base_dual" if ( CLIENT ) then SWEP.WepSelectIcon = surface.GetTextureID("vgui/entities/p228") killicon.Add("p228", "vgui/entities/p228", Color( 255, 0, 0, 255 ) ) end SWEP.Offset = { Pos = { Up = -0.5, Right = -4, Forward = -2.5, }, Ang = { Up = 0, Right = 0, Forward = 0, } } function SWEP:DrawWorldModel( ) local hand, offset, rotate if not IsValid( self.Owner ) then self:SetRenderOrigin(self:GetNetworkOrigin()) self:SetRenderAngles(self:GetNetworkAngles()) self:DrawModel( ) return end if not self.Hand then self.Hand = self.Owner:LookupAttachment( "anim_attachment_rh" ) end hand = self.Owner:GetAttachment( self.Hand ) if not hand then self:DrawModel( ) return end offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right ) hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward ) hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up ) self:SetRenderOrigin( hand.Pos + offset ) self:SetRenderAngles( hand.Ang ) self:DrawModel( ) end SWEP.Primary.Sound = Sound("weapons/p228/p228-1.wav") SWEP.Primary.Recoil = 1.5 SWEP.Primary.Damage = 18 SWEP.Primary.NumShots = 1 SWEP.ConeMax = 0.055 SWEP.ConeMin = 0.05 SWEP.Primary.ClipSize = 36 SWEP.Primary.DefaultClip = 128 SWEP.Primary.Automatic = false SWEP.Primary.Ammo = "pistol" SWEP.Primary.TakeAmmo = 1 SWEP.Primary.Spread = 0.1 SWEP.Primary.NumberofShots = 1 SWEP.Primary.Recoil = 0.6 SWEP.Primary.Delay = 0.12 SWEP.Primary.Force = 0 SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" SWEP.CSMuzzleFlashes = true function SWEP:Initialize() util.PrecacheSound(self.Primary.Sound) util.PrecacheSound(self.ReloadSound) self:SetWeaponHoldType( self.HoldType ) end function SWEP:PrimaryAttack() if ( !self:CanPrimaryAttack() ) then return end local bullet = {} bullet.Num = self.Primary.NumberofShots bullet.Src = self.Owner:GetShootPos() bullet.Dir = self.Owner:GetAimVector() bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0) bullet.Tracer = 0 bullet.Force = self.Primary.Force bullet.Damage = self.Primary.Damage bullet.AmmoType = self.Primary.Ammo local rnda = self.Primary.Recoil * -1 local rndb = self.Primary.Recoil * math.random(-1, 1) if self.ShootAnimation == 0 then self.ShootAnimation = 1 self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) else self.ShootAnimation = 0 self.Weapon:SendWeaponAnim( ACT_VM_SECONDARYATTACK ) end self.Owner:MuzzleFlash() self.Owner:SetAnimation( PLAYER_ATTACK1 ) self.Owner:FireBullets( bullet ) self:EmitSound(Sound(self.Primary.Sound)) self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) ) self:TakePrimaryAmmo(self.Primary.TakeAmmo) self:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) self:SetNextSecondaryFire( CurTime() + self.Primary.Delay ) end function SWEP:SecondaryAttack() end function SWEP:Reload() self:EmitSound(Sound(self.ReloadSound)) self.Weapon:DefaultReload( ACT_VM_RELOAD ); end
gpl-2.0
TheAnswer/FirstTest
bin/scripts/items/objects/weapons/2H/cleaver.lua
1
2466
--Copyright (C) 2007 <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. cleaver = Weapon:new{ objectName = "Cleaver", templateName = "object/weapon/melee/2h_sword/shared_2h_sword_cleaver.iff", objectCRC = 1737909268, damageType = WEAPON_KINETIC, objectType = TWOHANDMELEEWEAPON, armorPiercing = WEAPON_LIGHT, certification = "cert_sword_2h_cleaver", attackSpeed = 4.1, minDamage = 50, maxDamage = 150 }
lgpl-3.0
JarnoVgr/ZombieSurvival
gamemodes/zombiesurvival/entities/weapons/weapon_zs_swissarmyknife.lua
1
2209
AddCSLuaFile() if CLIENT then SWEP.PrintName = "Knife" SWEP.Description = "Deals double damage to the back." SWEP.ViewModelFlip = false SWEP.ViewModelFOV = 60 end SWEP.Base = "weapon_zs_basemelee" SWEP.HoldType = "knife" SWEP.ViewModel = "models/weapons/cstrike/c_knife_t.mdl" SWEP.WorldModel = "models/weapons/w_knife_t.mdl" SWEP.UseHands = true SWEP.MeleeDamage = 29 SWEP.MeleeRange = 62 SWEP.MeleeSize = 0.875 SWEP.WalkSpeed = SPEED_FASTEST SWEP.Primary.Delay = 0.85 SWEP.HitDecal = "Manhackcut" SWEP.HitGesture = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE SWEP.MissGesture = SWEP.HitGesture SWEP.HitAnim = ACT_VM_MISSCENTER SWEP.MissAnim = ACT_VM_PRIMARYATTACK SWEP.NoHitSoundFlesh = true function SWEP:PlaySwingSound() self:EmitSound("weapons/knife/knife_slash"..math.random(2)..".wav") end function SWEP:PlayHitSound() self:EmitSound("weapons/knife/knife_hitwall1.wav") end function SWEP:PlayHitFleshSound() self:EmitSound("weapons/knife/knife_hit"..math.random(4)..".wav") end function SWEP:OnMeleeHit(hitent, hitflesh, tr) if hitent:IsValid() and hitent:IsPlayer() and not self.m_BackStabbing and math.abs(hitent:GetForward():Angle().yaw - self.Owner:GetForward():Angle().yaw) <= 90 then self.m_BackStabbing = true self.MeleeDamage = self.MeleeDamage * 2 end end function SWEP:PostOnMeleeHit(hitent, hitflesh, tr) if self.m_BackStabbing then self.m_BackStabbing = false self.MeleeDamage = self.MeleeDamage / 2 end end if SERVER then function SWEP:InitializeHoldType() self.ActivityTranslate = {} self.ActivityTranslate[ACT_HL2MP_IDLE] = ACT_HL2MP_IDLE_KNIFE self.ActivityTranslate[ACT_HL2MP_WALK] = ACT_HL2MP_WALK_KNIFE self.ActivityTranslate[ACT_HL2MP_RUN] = ACT_HL2MP_RUN_KNIFE self.ActivityTranslate[ACT_HL2MP_IDLE_CROUCH] = ACT_HL2MP_IDLE_CROUCH_PHYSGUN self.ActivityTranslate[ACT_HL2MP_WALK_CROUCH] = ACT_HL2MP_WALK_CROUCH_KNIFE self.ActivityTranslate[ACT_HL2MP_GESTURE_RANGE_ATTACK] = ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE self.ActivityTranslate[ACT_HL2MP_GESTURE_RELOAD] = ACT_HL2MP_GESTURE_RELOAD_KNIFE self.ActivityTranslate[ACT_HL2MP_JUMP] = ACT_HL2MP_JUMP_KNIFE self.ActivityTranslate[ACT_RANGE_ATTACK1] = ACT_RANGE_ATTACK_KNIFE end end
gpl-2.0
TheAnswer/FirstTest
bin/scripts/items/objects/deed/installationdeeds/generators/main.lua
1
2313
--Copyright (C) 2007 <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. --HARVESTERS RunItemLUAFile("objects/deed/installationdeeds/generators/fusionIonGeneratorDeed.lua"); RunItemLUAFile("objects/deed/installationdeeds/generators/solarGeneratorDeed.lua"); RunItemLUAFile("objects/deed/installationdeeds/generators/windGeneratorDeed.lua");
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/weapon/melee/polearm/objects.lua
1
20439
--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_weapon_melee_polearm_shared_lance_controllerfp = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_controller.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_metal_lance.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_controllerfp", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_controllerfp", noBuildRadius = 0, objectName = "@weapon_name:lance_controllerfp", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_controllerfp, 1316875243) object_weapon_melee_polearm_shared_lance_controllerfp_nightsister = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_controller.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_metal_lance.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_controllerfp_nightsister", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_controllerfp_nightsister", noBuildRadius = 0, objectName = "@weapon_name:lance_controllerfp_nightsister", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_controllerfp_nightsister, 3796866830) object_weapon_melee_polearm_shared_lance_lightsaber_01 = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_lightsaber_blade_s01.lsb", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_lightsaber_basic.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_lightsaber", gameObjectType = 131080, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@weapon_name:lance_lightsaber", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_lightsaber_01, 3828775483) object_weapon_melee_polearm_shared_lance_lightsaber_02 = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_lightsaber_blade_s02.lsb", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_lightsaber_basic.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_lightsaber", gameObjectType = 131080, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@weapon_name:lance_lightsaber", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_lightsaber_02, 1059181228) object_weapon_melee_polearm_shared_lance_nightsister = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_nightsister.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_nightsister_halberd.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_nightsister", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_nightsister", noBuildRadius = 0, objectName = "@weapon_name:lance_nightsister", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_nightsister, 1613461036) object_weapon_melee_polearm_shared_lance_nightsister_npc_version = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_nightsister.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_nightsister_halberd_npc_version.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_nightsister", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_nightsister", noBuildRadius = 0, objectName = "@weapon_name:lance_nightsister", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_nightsister_npc_version, 770226321) object_weapon_melee_polearm_shared_lance_staff_janta = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_staff_wood_s01.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_wood_lance.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_staff_janta", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_staff_janta", noBuildRadius = 0, objectName = "@weapon_name:lance_staff_janta", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_staff_janta, 1705789500) object_weapon_melee_polearm_shared_lance_staff_metal = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_staff_metal_s01.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_metal_lance.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_staff_metal", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_staff_metal", noBuildRadius = 0, objectName = "@weapon_name:lance_staff_metal", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_staff_metal, 978782032) object_weapon_melee_polearm_shared_lance_staff_wood_s1 = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_staff_wood_s01.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_wood_lance.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_staff_wood_s1", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_staff_wood_s1", noBuildRadius = 0, objectName = "@weapon_name:lance_staff_wood_s1", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_staff_wood_s1, 1200142292) object_weapon_melee_polearm_shared_lance_staff_wood_s2 = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_staff_wood_s02.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_wood_lance.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_staff_wood_s2", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_staff_wood_s2", noBuildRadius = 0, objectName = "@weapon_name:lance_staff_wood_s2", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_staff_wood_s2, 2627673923) object_weapon_melee_polearm_shared_lance_vibrolance = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_vibrolance.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_polearm_vibro_axe.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_vibrolance", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_vibrolance", noBuildRadius = 0, objectName = "@weapon_name:lance_vibrolance", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_lance_vibrolance, 22784428) object_weapon_melee_polearm_shared_polearm_vibro_axe = SharedWeaponObjectTemplate:new { appearanceFilename = "appearance/wp_mle_lance_vibroaxe.apt", arrangementDescriptorFilename = "abstract/slot/arrangement/wearables/hold_both.iff", attackType = 1, certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "clientdata/weapon/client_melee_polearm_vibro_axe.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 1, containerVolumeLimit = 0, customizationVariableMapping = {}, detailedDescription = "@weapon_detail:lance_vibro_axe", gameObjectType = 131081, locationReservationRadius = 0, lookAtText = "@weapon_lookat:lance_vibro_axe", noBuildRadius = 0, objectName = "@weapon_name:lance_vibro_axe", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/default_weapon.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0, weaponEffect = "bolt", weaponEffectIndex = 0 } ObjectTemplates:addTemplate(object_weapon_melee_polearm_shared_polearm_vibro_axe, 1723256113)
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/tangible/lair/fambaa/objects.lua
1
4654
--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_lair_fambaa_shared_lair_fambaa = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/poi_all_lair_cave_small.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 25, clientDataFile = "clientdata/client_shared_lair_small.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@lair_d:fambaa", gameObjectType = 4, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 64, objectName = "@lair_n:fambaa", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_lair_fambaa_shared_lair_fambaa, 2348330712) object_tangible_lair_fambaa_shared_lair_fambaa_swamp = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/poi_all_lair_cave_small.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 25, clientDataFile = "clientdata/client_shared_lair_small.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@lair_d:fambaa_swamp", gameObjectType = 4, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 64, objectName = "@lair_n:fambaa_swamp", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_lair_fambaa_shared_lair_fambaa_swamp, 3030660529)
lgpl-3.0
dani-sj/xy
libs/JSON.lua
3765
34843
-- -*- coding: utf-8 -*- -- -- Simple JSON encoding and decoding in pure Lua. -- -- Copyright 2010-2014 Jeffrey Friedl -- http://regex.info/blog/ -- -- Latest version: http://regex.info/blog/lua/json -- -- This code is released under a Creative Commons CC-BY "Attribution" License: -- http://creativecommons.org/licenses/by/3.0/deed.en_US -- -- It can be used for any purpose so long as the copyright notice above, -- the web-page links above, and the 'AUTHOR_NOTE' string below are -- maintained. Enjoy. -- local VERSION = 20141223.14 -- version history at end of file local AUTHOR_NOTE = "-[ JSON.lua package by Jeffrey Friedl (http://regex.info/blog/lua/json) version 20141223.14 ]-" -- -- The 'AUTHOR_NOTE' variable exists so that information about the source -- of the package is maintained even in compiled versions. It's also -- included in OBJDEF below mostly to quiet warnings about unused variables. -- local OBJDEF = { VERSION = VERSION, AUTHOR_NOTE = AUTHOR_NOTE, } -- -- Simple JSON encoding and decoding in pure Lua. -- http://www.json.org/ -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- -- -- -- DECODING (from a JSON string to a Lua table) -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- If the JSON text is for an object or an array, e.g. -- { "what": "books", "count": 3 } -- or -- [ "Larry", "Curly", "Moe" ] -- -- the result is a Lua table, e.g. -- { what = "books", count = 3 } -- or -- { "Larry", "Curly", "Moe" } -- -- -- The encode and decode routines accept an optional second argument, -- "etc", which is not used during encoding or decoding, but upon error -- is passed along to error handlers. It can be of any type (including nil). -- -- -- -- ERROR HANDLING -- -- With most errors during decoding, this code calls -- -- JSON:onDecodeError(message, text, location, etc) -- -- with a message about the error, and if known, the JSON text being -- parsed and the byte count where the problem was discovered. You can -- replace the default JSON:onDecodeError() with your own function. -- -- The default onDecodeError() merely augments the message with data -- about the text and the location if known (and if a second 'etc' -- argument had been provided to decode(), its value is tacked onto the -- message as well), and then calls JSON.assert(), which itself defaults -- to Lua's built-in assert(), and can also be overridden. -- -- For example, in an Adobe Lightroom plugin, you might use something like -- -- function JSON:onDecodeError(message, text, location, etc) -- LrErrors.throwUserError("Internal Error: invalid JSON data") -- end -- -- or even just -- -- function JSON.assert(message) -- LrErrors.throwUserError("Internal Error: " .. message) -- end -- -- If JSON:decode() is passed a nil, this is called instead: -- -- JSON:onDecodeOfNilError(message, nil, nil, etc) -- -- and if JSON:decode() is passed HTML instead of JSON, this is called: -- -- JSON:onDecodeOfHTMLError(message, text, nil, etc) -- -- The use of the fourth 'etc' argument allows stronger coordination -- between decoding and error reporting, especially when you provide your -- own error-handling routines. Continuing with the the Adobe Lightroom -- plugin example: -- -- function JSON:onDecodeError(message, text, location, etc) -- local note = "Internal Error: invalid JSON data" -- if type(etc) = 'table' and etc.photo then -- note = note .. " while processing for " .. etc.photo:getFormattedMetadata('fileName') -- end -- LrErrors.throwUserError(note) -- end -- -- : -- : -- -- for i, photo in ipairs(photosToProcess) do -- : -- : -- local data = JSON:decode(someJsonText, { photo = photo }) -- : -- : -- end -- -- -- -- -- -- DECODING AND STRICT TYPES -- -- Because both JSON objects and JSON arrays are converted to Lua tables, -- it's not normally possible to tell which original JSON type a -- particular Lua table was derived from, or guarantee decode-encode -- round-trip equivalency. -- -- However, if you enable strictTypes, e.g. -- -- JSON = assert(loadfile "JSON.lua")() --load the routines -- JSON.strictTypes = true -- -- then the Lua table resulting from the decoding of a JSON object or -- JSON array is marked via Lua metatable, so that when re-encoded with -- JSON:encode() it ends up as the appropriate JSON type. -- -- (This is not the default because other routines may not work well with -- tables that have a metatable set, for example, Lightroom API calls.) -- -- -- ENCODING (from a lua table to a JSON string) -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- local custom_pretty = JSON:encode(lua_table_or_value, etc, { pretty = true, indent = "| ", align_keys = false }) -- -- On error during encoding, this code calls: -- -- JSON:onEncodeError(message, etc) -- -- which you can override in your local JSON object. -- -- The 'etc' in the error call is the second argument to encode() -- and encode_pretty(), or nil if it wasn't provided. -- -- -- PRETTY-PRINTING -- -- An optional third argument, a table of options, allows a bit of -- configuration about how the encoding takes place: -- -- pretty = JSON:encode(val, etc, { -- pretty = true, -- if false, no other options matter -- indent = " ", -- this provides for a three-space indent per nesting level -- align_keys = false, -- see below -- }) -- -- encode() and encode_pretty() are identical except that encode_pretty() -- provides a default options table if none given in the call: -- -- { pretty = true, align_keys = false, indent = " " } -- -- For example, if -- -- JSON:encode(data) -- -- produces: -- -- {"city":"Kyoto","climate":{"avg_temp":16,"humidity":"high","snowfall":"minimal"},"country":"Japan","wards":11} -- -- then -- -- JSON:encode_pretty(data) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- The following three lines return identical results: -- JSON:encode_pretty(data) -- JSON:encode_pretty(data, nil, { pretty = true, align_keys = false, indent = " " }) -- JSON:encode (data, nil, { pretty = true, align_keys = false, indent = " " }) -- -- An example of setting your own indent string: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = "| " }) -- -- produces: -- -- { -- | "city": "Kyoto", -- | "climate": { -- | | "avg_temp": 16, -- | | "humidity": "high", -- | | "snowfall": "minimal" -- | }, -- | "country": "Japan", -- | "wards": 11 -- } -- -- An example of setting align_keys to true: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = " ", align_keys = true }) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- which I must admit is kinda ugly, sorry. This was the default for -- encode_pretty() prior to version 20141223.14. -- -- -- AMBIGUOUS SITUATIONS DURING THE ENCODING -- -- During the encode, if a Lua table being encoded contains both string -- and numeric keys, it fits neither JSON's idea of an object, nor its -- idea of an array. To get around this, when any string key exists (or -- when non-positive numeric keys exist), numeric keys are converted to -- strings. -- -- For example, -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- produces the JSON object -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To prohibit this conversion and instead make it an error condition, set -- JSON.noKeyConversion = true -- -- -- SUMMARY OF METHODS YOU CAN OVERRIDE IN YOUR LOCAL LUA JSON OBJECT -- -- assert -- onDecodeError -- onDecodeOfNilError -- onDecodeOfHTMLError -- onEncodeError -- -- If you want to create a separate Lua JSON object with its own error handlers, -- you can reload JSON.lua or use the :new() method. -- --------------------------------------------------------------------------- local default_pretty_indent = " " local default_pretty_options = { pretty = true, align_keys = false, indent = default_pretty_indent } local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject function OBJDEF:newArray(tbl) return setmetatable(tbl or {}, isArray) end function OBJDEF:newObject(tbl) return setmetatable(tbl or {}, isObject) end local function unicode_codepoint_as_utf8(codepoint) -- -- codepoint is a number -- if codepoint <= 127 then return string.char(codepoint) elseif codepoint <= 2047 then -- -- 110yyyxx 10xxxxxx <-- useful notation from http://en.wikipedia.org/wiki/Utf8 -- local highpart = math.floor(codepoint / 0x40) local lowpart = codepoint - (0x40 * highpart) return string.char(0xC0 + highpart, 0x80 + lowpart) elseif codepoint <= 65535 then -- -- 1110yyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x1000) local remainder = codepoint - 0x1000 * highpart local midpart = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midpart highpart = 0xE0 + highpart midpart = 0x80 + midpart lowpart = 0x80 + lowpart -- -- Check for an invalid character (thanks Andy R. at Adobe). -- See table 3.7, page 93, in http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#G28070 -- if ( highpart == 0xE0 and midpart < 0xA0 ) or ( highpart == 0xED and midpart > 0x9F ) or ( highpart == 0xF0 and midpart < 0x90 ) or ( highpart == 0xF4 and midpart > 0x8F ) then return "?" else return string.char(highpart, midpart, lowpart) end else -- -- 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x40000) local remainder = codepoint - 0x40000 * highpart local midA = math.floor(remainder / 0x1000) remainder = remainder - 0x1000 * midA local midB = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midB return string.char(0xF0 + highpart, 0x80 + midA, 0x80 + midB, 0x80 + lowpart) end end function OBJDEF:onDecodeError(message, text, location, etc) if text then if location then message = string.format("%s at char %d of: %s", message, location, text) else message = string.format("%s: %s", message, text) end end if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end OBJDEF.onDecodeOfNilError = OBJDEF.onDecodeError OBJDEF.onDecodeOfHTMLError = OBJDEF.onDecodeError function OBJDEF:onEncodeError(message, etc) if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end local function grok_number(self, text, start, etc) -- -- Grab the integer part -- local integer_part = text:match('^-?[1-9]%d*', start) or text:match("^-?0", start) if not integer_part then self:onDecodeError("expected number", text, start, etc) end local i = start + integer_part:len() -- -- Grab an optional decimal part -- local decimal_part = text:match('^%.%d+', i) or "" i = i + decimal_part:len() -- -- Grab an optional exponential part -- local exponent_part = text:match('^[eE][-+]?%d+', i) or "" i = i + exponent_part:len() local full_number_text = integer_part .. decimal_part .. exponent_part local as_number = tonumber(full_number_text) if not as_number then self:onDecodeError("bad number", text, start, etc) end return as_number, i end local function grok_string(self, text, start, etc) if text:sub(start,start) ~= '"' then self:onDecodeError("expected string's opening quote", text, start, etc) end local i = start + 1 -- +1 to bypass the initial quote local text_len = text:len() local VALUE = "" while i <= text_len do local c = text:sub(i,i) if c == '"' then return VALUE, i + 1 end if c ~= '\\' then VALUE = VALUE .. c i = i + 1 elseif text:match('^\\b', i) then VALUE = VALUE .. "\b" i = i + 2 elseif text:match('^\\f', i) then VALUE = VALUE .. "\f" i = i + 2 elseif text:match('^\\n', i) then VALUE = VALUE .. "\n" i = i + 2 elseif text:match('^\\r', i) then VALUE = VALUE .. "\r" i = i + 2 elseif text:match('^\\t', i) then VALUE = VALUE .. "\t" i = i + 2 else local hex = text:match('^\\u([0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if hex then i = i + 6 -- bypass what we just read -- We have a Unicode codepoint. It could be standalone, or if in the proper range and -- followed by another in a specific range, it'll be a two-code surrogate pair. local codepoint = tonumber(hex, 16) if codepoint >= 0xD800 and codepoint <= 0xDBFF then -- it's a hi surrogate... see whether we have a following low local lo_surrogate = text:match('^\\u([dD][cdefCDEF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if lo_surrogate then i = i + 6 -- bypass the low surrogate we just read codepoint = 0x2400 + (codepoint - 0xD800) * 0x400 + tonumber(lo_surrogate, 16) else -- not a proper low, so we'll just leave the first codepoint as is and spit it out. end end VALUE = VALUE .. unicode_codepoint_as_utf8(codepoint) else -- just pass through what's escaped VALUE = VALUE .. text:match('^\\(.)', i) i = i + 2 end end end self:onDecodeError("unclosed string", text, start, etc) end local function skip_whitespace(text, start) local _, match_end = text:find("^[ \n\r\t]+", start) -- [http://www.ietf.org/rfc/rfc4627.txt] Section 2 if match_end then return match_end + 1 else return start end end local grok_one -- assigned later local function grok_object(self, text, start, etc) if text:sub(start,start) ~= '{' then self:onDecodeError("expected '{'", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '{' local VALUE = self.strictTypes and self:newObject { } or { } if text:sub(i,i) == '}' then return VALUE, i + 1 end local text_len = text:len() while i <= text_len do local key, new_i = grok_string(self, text, i, etc) i = skip_whitespace(text, new_i) if text:sub(i, i) ~= ':' then self:onDecodeError("expected colon", text, i, etc) end i = skip_whitespace(text, i + 1) local new_val, new_i = grok_one(self, text, i) VALUE[key] = new_val -- -- Expect now either '}' to end things, or a ',' to allow us to continue. -- i = skip_whitespace(text, new_i) local c = text:sub(i,i) if c == '}' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '}'", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '{'", text, start, etc) end local function grok_array(self, text, start, etc) if text:sub(start,start) ~= '[' then self:onDecodeError("expected '['", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '[' local VALUE = self.strictTypes and self:newArray { } or { } if text:sub(i,i) == ']' then return VALUE, i + 1 end local VALUE_INDEX = 1 local text_len = text:len() while i <= text_len do local val, new_i = grok_one(self, text, i) -- can't table.insert(VALUE, val) here because it's a no-op if val is nil VALUE[VALUE_INDEX] = val VALUE_INDEX = VALUE_INDEX + 1 i = skip_whitespace(text, new_i) -- -- Expect now either ']' to end things, or a ',' to allow us to continue. -- local c = text:sub(i,i) if c == ']' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '['", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '['", text, start, etc) end grok_one = function(self, text, start, etc) -- Skip any whitespace start = skip_whitespace(text, start) if start > text:len() then self:onDecodeError("unexpected end of string", text, nil, etc) end if text:find('^"', start) then return grok_string(self, text, start, etc) elseif text:find('^[-0123456789 ]', start) then return grok_number(self, text, start, etc) elseif text:find('^%{', start) then return grok_object(self, text, start, etc) elseif text:find('^%[', start) then return grok_array(self, text, start, etc) elseif text:find('^true', start) then return true, start + 4 elseif text:find('^false', start) then return false, start + 5 elseif text:find('^null', start) then return nil, start + 4 else self:onDecodeError("can't parse JSON", text, start, etc) end end function OBJDEF:decode(text, etc) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onDecodeError("JSON:decode must be called in method format", nil, nil, etc) end if text == nil then self:onDecodeOfNilError(string.format("nil passed to JSON:decode()"), nil, nil, etc) elseif type(text) ~= 'string' then self:onDecodeError(string.format("expected string argument to JSON:decode(), got %s", type(text)), nil, nil, etc) end if text:match('^%s*$') then return nil end if text:match('^%s*<') then -- Can't be JSON... we'll assume it's HTML self:onDecodeOfHTMLError(string.format("html passed to JSON:decode()"), text, nil, etc) end -- -- Ensure that it's not UTF-32 or UTF-16. -- Those are perfectly valid encodings for JSON (as per RFC 4627 section 3), -- but this package can't handle them. -- if text:sub(1,1):byte() == 0 or (text:len() >= 2 and text:sub(2,2):byte() == 0) then self:onDecodeError("JSON package groks only UTF-8, sorry", text, nil, etc) end local success, value = pcall(grok_one, self, text, 1, etc) if success then return value else -- if JSON:onDecodeError() didn't abort out of the pcall, we'll have received the error message here as "value", so pass it along as an assert. if self.assert then self.assert(false, value) else assert(false, value) end -- and if we're still here, return a nil and throw the error message on as a second arg return nil, value end end local function backslash_replacement_function(c) if c == "\n" then return "\\n" elseif c == "\r" then return "\\r" elseif c == "\t" then return "\\t" elseif c == "\b" then return "\\b" elseif c == "\f" then return "\\f" elseif c == '"' then return '\\"' elseif c == '\\' then return '\\\\' else return string.format("\\u%04x", c:byte()) end end local chars_to_be_escaped_in_JSON_string = '[' .. '"' -- class sub-pattern to match a double quote .. '%\\' -- class sub-pattern to match a backslash .. '%z' -- class sub-pattern to match a null .. '\001' .. '-' .. '\031' -- class sub-pattern to match control characters .. ']' local function json_string_literal(value) local newval = value:gsub(chars_to_be_escaped_in_JSON_string, backslash_replacement_function) return '"' .. newval .. '"' end local function object_or_array(self, T, etc) -- -- We need to inspect all the keys... if there are any strings, we'll convert to a JSON -- object. If there are only numbers, it's a JSON array. -- -- If we'll be converting to a JSON object, we'll want to sort the keys so that the -- end result is deterministic. -- local string_keys = { } local number_keys = { } local number_keys_must_be_strings = false local maximum_number_key for key in pairs(T) do if type(key) == 'string' then table.insert(string_keys, key) elseif type(key) == 'number' then table.insert(number_keys, key) if key <= 0 or key >= math.huge then number_keys_must_be_strings = true elseif not maximum_number_key or key > maximum_number_key then maximum_number_key = key end else self:onEncodeError("can't encode table with a key of type " .. type(key), etc) end end if #string_keys == 0 and not number_keys_must_be_strings then -- -- An empty table, or a numeric-only array -- if #number_keys > 0 then return nil, maximum_number_key -- an array elseif tostring(T) == "JSON array" then return nil elseif tostring(T) == "JSON object" then return { } else -- have to guess, so we'll pick array, since empty arrays are likely more common than empty objects return nil end end table.sort(string_keys) local map if #number_keys > 0 then -- -- If we're here then we have either mixed string/number keys, or numbers inappropriate for a JSON array -- It's not ideal, but we'll turn the numbers into strings so that we can at least create a JSON object. -- if self.noKeyConversion then self:onEncodeError("a table with both numeric and string keys could be an object or array; aborting", etc) end -- -- Have to make a shallow copy of the source table so we can remap the numeric keys to be strings -- map = { } for key, val in pairs(T) do map[key] = val end table.sort(number_keys) -- -- Throw numeric keys in there as strings -- for _, number_key in ipairs(number_keys) do local string_key = tostring(number_key) if map[string_key] == nil then table.insert(string_keys , string_key) map[string_key] = T[number_key] else self:onEncodeError("conflict converting table with mixed-type keys into a JSON object: key " .. number_key .. " exists both as a string and a number.", etc) end end end return string_keys, nil, map end -- -- Encode -- -- 'options' is nil, or a table with possible keys: -- pretty -- if true, return a pretty-printed version -- indent -- a string (usually of spaces) used to indent each nested level -- align_keys -- if true, align all the keys when formatting a table -- local encode_value -- must predeclare because it calls itself function encode_value(self, value, parents, etc, options, indent) if value == nil then return 'null' elseif type(value) == 'string' then return json_string_literal(value) elseif type(value) == 'number' then if value ~= value then -- -- NaN (Not a Number). -- JSON has no NaN, so we have to fudge the best we can. This should really be a package option. -- return "null" elseif value >= math.huge then -- -- Positive infinity. JSON has no INF, so we have to fudge the best we can. This should -- really be a package option. Note: at least with some implementations, positive infinity -- is both ">= math.huge" and "<= -math.huge", which makes no sense but that's how it is. -- Negative infinity is properly "<= -math.huge". So, we must be sure to check the ">=" -- case first. -- return "1e+9999" elseif value <= -math.huge then -- -- Negative infinity. -- JSON has no INF, so we have to fudge the best we can. This should really be a package option. -- return "-1e+9999" else return tostring(value) end elseif type(value) == 'boolean' then return tostring(value) elseif type(value) ~= 'table' then self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc) else -- -- A table to be converted to either a JSON object or array. -- local T = value if type(options) ~= 'table' then options = {} end if type(indent) ~= 'string' then indent = "" end if parents[T] then self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc) else parents[T] = true end local result_value local object_keys, maximum_number_key, map = object_or_array(self, T, etc) if maximum_number_key then -- -- An array... -- local ITEMS = { } for i = 1, maximum_number_key do table.insert(ITEMS, encode_value(self, T[i], parents, etc, options, indent)) end if options.pretty then result_value = "[ " .. table.concat(ITEMS, ", ") .. " ]" else result_value = "[" .. table.concat(ITEMS, ",") .. "]" end elseif object_keys then -- -- An object -- local TT = map or T if options.pretty then local KEYS = { } local max_key_length = 0 for _, key in ipairs(object_keys) do local encoded = encode_value(self, tostring(key), parents, etc, options, indent) if options.align_keys then max_key_length = math.max(max_key_length, #encoded) end table.insert(KEYS, encoded) end local key_indent = indent .. tostring(options.indent or "") local subtable_indent = key_indent .. string.rep(" ", max_key_length) .. (options.align_keys and " " or "") local FORMAT = "%s%" .. string.format("%d", max_key_length) .. "s: %s" local COMBINED_PARTS = { } for i, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, subtable_indent) table.insert(COMBINED_PARTS, string.format(FORMAT, key_indent, KEYS[i], encoded_val)) end result_value = "{\n" .. table.concat(COMBINED_PARTS, ",\n") .. "\n" .. indent .. "}" else local PARTS = { } for _, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, indent) local encoded_key = encode_value(self, tostring(key), parents, etc, options, indent) table.insert(PARTS, string.format("%s:%s", encoded_key, encoded_val)) end result_value = "{" .. table.concat(PARTS, ",") .. "}" end else -- -- An empty array/object... we'll treat it as an array, though it should really be an option -- result_value = "[]" end parents[T] = false return result_value end end function OBJDEF:encode(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode must be called in method format", etc) end return encode_value(self, value, {}, etc, options or nil) end function OBJDEF:encode_pretty(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode_pretty must be called in method format", etc) end return encode_value(self, value, {}, etc, options or default_pretty_options) end function OBJDEF.__tostring() return "JSON encode/decode package" end OBJDEF.__index = OBJDEF function OBJDEF:new(args) local new = { } if args then for key, val in pairs(args) do new[key] = val end end return setmetatable(new, OBJDEF) end return OBJDEF:new() -- -- Version history: -- -- 20141223.14 The encode_pretty() routine produced fine results for small datasets, but isn't really -- appropriate for anything large, so with help from Alex Aulbach I've made the encode routines -- more flexible, and changed the default encode_pretty() to be more generally useful. -- -- Added a third 'options' argument to the encode() and encode_pretty() routines, to control -- how the encoding takes place. -- -- Updated docs to add assert() call to the loadfile() line, just as good practice so that -- if there is a problem loading JSON.lua, the appropriate error message will percolate up. -- -- 20140920.13 Put back (in a way that doesn't cause warnings about unused variables) the author string, -- so that the source of the package, and its version number, are visible in compiled copies. -- -- 20140911.12 Minor lua cleanup. -- Fixed internal reference to 'JSON.noKeyConversion' to reference 'self' instead of 'JSON'. -- (Thanks to SmugMug's David Parry for these.) -- -- 20140418.11 JSON nulls embedded within an array were being ignored, such that -- ["1",null,null,null,null,null,"seven"], -- would return -- {1,"seven"} -- It's now fixed to properly return -- {1, nil, nil, nil, nil, nil, "seven"} -- Thanks to "haddock" for catching the error. -- -- 20140116.10 The user's JSON.assert() wasn't always being used. Thanks to "blue" for the heads up. -- -- 20131118.9 Update for Lua 5.3... it seems that tostring(2/1) produces "2.0" instead of "2", -- and this caused some problems. -- -- 20131031.8 Unified the code for encode() and encode_pretty(); they had been stupidly separate, -- and had of course diverged (encode_pretty didn't get the fixes that encode got, so -- sometimes produced incorrect results; thanks to Mattie for the heads up). -- -- Handle encoding tables with non-positive numeric keys (unlikely, but possible). -- -- If a table has both numeric and string keys, or its numeric keys are inappropriate -- (such as being non-positive or infinite), the numeric keys are turned into -- string keys appropriate for a JSON object. So, as before, -- JSON:encode({ "one", "two", "three" }) -- produces the array -- ["one","two","three"] -- but now something with mixed key types like -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- instead of throwing an error produces an object: -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To maintain the prior throw-an-error semantics, set -- JSON.noKeyConversion = true -- -- 20131004.7 Release under a Creative Commons CC-BY license, which I should have done from day one, sorry. -- -- 20130120.6 Comment update: added a link to the specific page on my blog where this code can -- be found, so that folks who come across the code outside of my blog can find updates -- more easily. -- -- 20111207.5 Added support for the 'etc' arguments, for better error reporting. -- -- 20110731.4 More feedback from David Kolf on how to make the tests for Nan/Infinity system independent. -- -- 20110730.3 Incorporated feedback from David Kolf at http://lua-users.org/wiki/JsonModules: -- -- * When encoding lua for JSON, Sparse numeric arrays are now handled by -- spitting out full arrays, such that -- JSON:encode({"one", "two", [10] = "ten"}) -- returns -- ["one","two",null,null,null,null,null,null,null,"ten"] -- -- In 20100810.2 and earlier, only up to the first non-null value would have been retained. -- -- * When encoding lua for JSON, numeric value NaN gets spit out as null, and infinity as "1+e9999". -- Version 20100810.2 and earlier created invalid JSON in both cases. -- -- * Unicode surrogate pairs are now detected when decoding JSON. -- -- 20100810.2 added some checking to ensure that an invalid Unicode character couldn't leak in to the UTF-8 encoding -- -- 20100731.1 initial public release --
gpl-2.0
moltafet35/seeck
libs/JSON.lua
3765
34843
-- -*- coding: utf-8 -*- -- -- Simple JSON encoding and decoding in pure Lua. -- -- Copyright 2010-2014 Jeffrey Friedl -- http://regex.info/blog/ -- -- Latest version: http://regex.info/blog/lua/json -- -- This code is released under a Creative Commons CC-BY "Attribution" License: -- http://creativecommons.org/licenses/by/3.0/deed.en_US -- -- It can be used for any purpose so long as the copyright notice above, -- the web-page links above, and the 'AUTHOR_NOTE' string below are -- maintained. Enjoy. -- local VERSION = 20141223.14 -- version history at end of file local AUTHOR_NOTE = "-[ JSON.lua package by Jeffrey Friedl (http://regex.info/blog/lua/json) version 20141223.14 ]-" -- -- The 'AUTHOR_NOTE' variable exists so that information about the source -- of the package is maintained even in compiled versions. It's also -- included in OBJDEF below mostly to quiet warnings about unused variables. -- local OBJDEF = { VERSION = VERSION, AUTHOR_NOTE = AUTHOR_NOTE, } -- -- Simple JSON encoding and decoding in pure Lua. -- http://www.json.org/ -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- -- -- -- DECODING (from a JSON string to a Lua table) -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- If the JSON text is for an object or an array, e.g. -- { "what": "books", "count": 3 } -- or -- [ "Larry", "Curly", "Moe" ] -- -- the result is a Lua table, e.g. -- { what = "books", count = 3 } -- or -- { "Larry", "Curly", "Moe" } -- -- -- The encode and decode routines accept an optional second argument, -- "etc", which is not used during encoding or decoding, but upon error -- is passed along to error handlers. It can be of any type (including nil). -- -- -- -- ERROR HANDLING -- -- With most errors during decoding, this code calls -- -- JSON:onDecodeError(message, text, location, etc) -- -- with a message about the error, and if known, the JSON text being -- parsed and the byte count where the problem was discovered. You can -- replace the default JSON:onDecodeError() with your own function. -- -- The default onDecodeError() merely augments the message with data -- about the text and the location if known (and if a second 'etc' -- argument had been provided to decode(), its value is tacked onto the -- message as well), and then calls JSON.assert(), which itself defaults -- to Lua's built-in assert(), and can also be overridden. -- -- For example, in an Adobe Lightroom plugin, you might use something like -- -- function JSON:onDecodeError(message, text, location, etc) -- LrErrors.throwUserError("Internal Error: invalid JSON data") -- end -- -- or even just -- -- function JSON.assert(message) -- LrErrors.throwUserError("Internal Error: " .. message) -- end -- -- If JSON:decode() is passed a nil, this is called instead: -- -- JSON:onDecodeOfNilError(message, nil, nil, etc) -- -- and if JSON:decode() is passed HTML instead of JSON, this is called: -- -- JSON:onDecodeOfHTMLError(message, text, nil, etc) -- -- The use of the fourth 'etc' argument allows stronger coordination -- between decoding and error reporting, especially when you provide your -- own error-handling routines. Continuing with the the Adobe Lightroom -- plugin example: -- -- function JSON:onDecodeError(message, text, location, etc) -- local note = "Internal Error: invalid JSON data" -- if type(etc) = 'table' and etc.photo then -- note = note .. " while processing for " .. etc.photo:getFormattedMetadata('fileName') -- end -- LrErrors.throwUserError(note) -- end -- -- : -- : -- -- for i, photo in ipairs(photosToProcess) do -- : -- : -- local data = JSON:decode(someJsonText, { photo = photo }) -- : -- : -- end -- -- -- -- -- -- DECODING AND STRICT TYPES -- -- Because both JSON objects and JSON arrays are converted to Lua tables, -- it's not normally possible to tell which original JSON type a -- particular Lua table was derived from, or guarantee decode-encode -- round-trip equivalency. -- -- However, if you enable strictTypes, e.g. -- -- JSON = assert(loadfile "JSON.lua")() --load the routines -- JSON.strictTypes = true -- -- then the Lua table resulting from the decoding of a JSON object or -- JSON array is marked via Lua metatable, so that when re-encoded with -- JSON:encode() it ends up as the appropriate JSON type. -- -- (This is not the default because other routines may not work well with -- tables that have a metatable set, for example, Lightroom API calls.) -- -- -- ENCODING (from a lua table to a JSON string) -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- local custom_pretty = JSON:encode(lua_table_or_value, etc, { pretty = true, indent = "| ", align_keys = false }) -- -- On error during encoding, this code calls: -- -- JSON:onEncodeError(message, etc) -- -- which you can override in your local JSON object. -- -- The 'etc' in the error call is the second argument to encode() -- and encode_pretty(), or nil if it wasn't provided. -- -- -- PRETTY-PRINTING -- -- An optional third argument, a table of options, allows a bit of -- configuration about how the encoding takes place: -- -- pretty = JSON:encode(val, etc, { -- pretty = true, -- if false, no other options matter -- indent = " ", -- this provides for a three-space indent per nesting level -- align_keys = false, -- see below -- }) -- -- encode() and encode_pretty() are identical except that encode_pretty() -- provides a default options table if none given in the call: -- -- { pretty = true, align_keys = false, indent = " " } -- -- For example, if -- -- JSON:encode(data) -- -- produces: -- -- {"city":"Kyoto","climate":{"avg_temp":16,"humidity":"high","snowfall":"minimal"},"country":"Japan","wards":11} -- -- then -- -- JSON:encode_pretty(data) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- The following three lines return identical results: -- JSON:encode_pretty(data) -- JSON:encode_pretty(data, nil, { pretty = true, align_keys = false, indent = " " }) -- JSON:encode (data, nil, { pretty = true, align_keys = false, indent = " " }) -- -- An example of setting your own indent string: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = "| " }) -- -- produces: -- -- { -- | "city": "Kyoto", -- | "climate": { -- | | "avg_temp": 16, -- | | "humidity": "high", -- | | "snowfall": "minimal" -- | }, -- | "country": "Japan", -- | "wards": 11 -- } -- -- An example of setting align_keys to true: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = " ", align_keys = true }) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- which I must admit is kinda ugly, sorry. This was the default for -- encode_pretty() prior to version 20141223.14. -- -- -- AMBIGUOUS SITUATIONS DURING THE ENCODING -- -- During the encode, if a Lua table being encoded contains both string -- and numeric keys, it fits neither JSON's idea of an object, nor its -- idea of an array. To get around this, when any string key exists (or -- when non-positive numeric keys exist), numeric keys are converted to -- strings. -- -- For example, -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- produces the JSON object -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To prohibit this conversion and instead make it an error condition, set -- JSON.noKeyConversion = true -- -- -- SUMMARY OF METHODS YOU CAN OVERRIDE IN YOUR LOCAL LUA JSON OBJECT -- -- assert -- onDecodeError -- onDecodeOfNilError -- onDecodeOfHTMLError -- onEncodeError -- -- If you want to create a separate Lua JSON object with its own error handlers, -- you can reload JSON.lua or use the :new() method. -- --------------------------------------------------------------------------- local default_pretty_indent = " " local default_pretty_options = { pretty = true, align_keys = false, indent = default_pretty_indent } local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject function OBJDEF:newArray(tbl) return setmetatable(tbl or {}, isArray) end function OBJDEF:newObject(tbl) return setmetatable(tbl or {}, isObject) end local function unicode_codepoint_as_utf8(codepoint) -- -- codepoint is a number -- if codepoint <= 127 then return string.char(codepoint) elseif codepoint <= 2047 then -- -- 110yyyxx 10xxxxxx <-- useful notation from http://en.wikipedia.org/wiki/Utf8 -- local highpart = math.floor(codepoint / 0x40) local lowpart = codepoint - (0x40 * highpart) return string.char(0xC0 + highpart, 0x80 + lowpart) elseif codepoint <= 65535 then -- -- 1110yyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x1000) local remainder = codepoint - 0x1000 * highpart local midpart = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midpart highpart = 0xE0 + highpart midpart = 0x80 + midpart lowpart = 0x80 + lowpart -- -- Check for an invalid character (thanks Andy R. at Adobe). -- See table 3.7, page 93, in http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#G28070 -- if ( highpart == 0xE0 and midpart < 0xA0 ) or ( highpart == 0xED and midpart > 0x9F ) or ( highpart == 0xF0 and midpart < 0x90 ) or ( highpart == 0xF4 and midpart > 0x8F ) then return "?" else return string.char(highpart, midpart, lowpart) end else -- -- 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x40000) local remainder = codepoint - 0x40000 * highpart local midA = math.floor(remainder / 0x1000) remainder = remainder - 0x1000 * midA local midB = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midB return string.char(0xF0 + highpart, 0x80 + midA, 0x80 + midB, 0x80 + lowpart) end end function OBJDEF:onDecodeError(message, text, location, etc) if text then if location then message = string.format("%s at char %d of: %s", message, location, text) else message = string.format("%s: %s", message, text) end end if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end OBJDEF.onDecodeOfNilError = OBJDEF.onDecodeError OBJDEF.onDecodeOfHTMLError = OBJDEF.onDecodeError function OBJDEF:onEncodeError(message, etc) if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end local function grok_number(self, text, start, etc) -- -- Grab the integer part -- local integer_part = text:match('^-?[1-9]%d*', start) or text:match("^-?0", start) if not integer_part then self:onDecodeError("expected number", text, start, etc) end local i = start + integer_part:len() -- -- Grab an optional decimal part -- local decimal_part = text:match('^%.%d+', i) or "" i = i + decimal_part:len() -- -- Grab an optional exponential part -- local exponent_part = text:match('^[eE][-+]?%d+', i) or "" i = i + exponent_part:len() local full_number_text = integer_part .. decimal_part .. exponent_part local as_number = tonumber(full_number_text) if not as_number then self:onDecodeError("bad number", text, start, etc) end return as_number, i end local function grok_string(self, text, start, etc) if text:sub(start,start) ~= '"' then self:onDecodeError("expected string's opening quote", text, start, etc) end local i = start + 1 -- +1 to bypass the initial quote local text_len = text:len() local VALUE = "" while i <= text_len do local c = text:sub(i,i) if c == '"' then return VALUE, i + 1 end if c ~= '\\' then VALUE = VALUE .. c i = i + 1 elseif text:match('^\\b', i) then VALUE = VALUE .. "\b" i = i + 2 elseif text:match('^\\f', i) then VALUE = VALUE .. "\f" i = i + 2 elseif text:match('^\\n', i) then VALUE = VALUE .. "\n" i = i + 2 elseif text:match('^\\r', i) then VALUE = VALUE .. "\r" i = i + 2 elseif text:match('^\\t', i) then VALUE = VALUE .. "\t" i = i + 2 else local hex = text:match('^\\u([0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if hex then i = i + 6 -- bypass what we just read -- We have a Unicode codepoint. It could be standalone, or if in the proper range and -- followed by another in a specific range, it'll be a two-code surrogate pair. local codepoint = tonumber(hex, 16) if codepoint >= 0xD800 and codepoint <= 0xDBFF then -- it's a hi surrogate... see whether we have a following low local lo_surrogate = text:match('^\\u([dD][cdefCDEF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if lo_surrogate then i = i + 6 -- bypass the low surrogate we just read codepoint = 0x2400 + (codepoint - 0xD800) * 0x400 + tonumber(lo_surrogate, 16) else -- not a proper low, so we'll just leave the first codepoint as is and spit it out. end end VALUE = VALUE .. unicode_codepoint_as_utf8(codepoint) else -- just pass through what's escaped VALUE = VALUE .. text:match('^\\(.)', i) i = i + 2 end end end self:onDecodeError("unclosed string", text, start, etc) end local function skip_whitespace(text, start) local _, match_end = text:find("^[ \n\r\t]+", start) -- [http://www.ietf.org/rfc/rfc4627.txt] Section 2 if match_end then return match_end + 1 else return start end end local grok_one -- assigned later local function grok_object(self, text, start, etc) if text:sub(start,start) ~= '{' then self:onDecodeError("expected '{'", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '{' local VALUE = self.strictTypes and self:newObject { } or { } if text:sub(i,i) == '}' then return VALUE, i + 1 end local text_len = text:len() while i <= text_len do local key, new_i = grok_string(self, text, i, etc) i = skip_whitespace(text, new_i) if text:sub(i, i) ~= ':' then self:onDecodeError("expected colon", text, i, etc) end i = skip_whitespace(text, i + 1) local new_val, new_i = grok_one(self, text, i) VALUE[key] = new_val -- -- Expect now either '}' to end things, or a ',' to allow us to continue. -- i = skip_whitespace(text, new_i) local c = text:sub(i,i) if c == '}' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '}'", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '{'", text, start, etc) end local function grok_array(self, text, start, etc) if text:sub(start,start) ~= '[' then self:onDecodeError("expected '['", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '[' local VALUE = self.strictTypes and self:newArray { } or { } if text:sub(i,i) == ']' then return VALUE, i + 1 end local VALUE_INDEX = 1 local text_len = text:len() while i <= text_len do local val, new_i = grok_one(self, text, i) -- can't table.insert(VALUE, val) here because it's a no-op if val is nil VALUE[VALUE_INDEX] = val VALUE_INDEX = VALUE_INDEX + 1 i = skip_whitespace(text, new_i) -- -- Expect now either ']' to end things, or a ',' to allow us to continue. -- local c = text:sub(i,i) if c == ']' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '['", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '['", text, start, etc) end grok_one = function(self, text, start, etc) -- Skip any whitespace start = skip_whitespace(text, start) if start > text:len() then self:onDecodeError("unexpected end of string", text, nil, etc) end if text:find('^"', start) then return grok_string(self, text, start, etc) elseif text:find('^[-0123456789 ]', start) then return grok_number(self, text, start, etc) elseif text:find('^%{', start) then return grok_object(self, text, start, etc) elseif text:find('^%[', start) then return grok_array(self, text, start, etc) elseif text:find('^true', start) then return true, start + 4 elseif text:find('^false', start) then return false, start + 5 elseif text:find('^null', start) then return nil, start + 4 else self:onDecodeError("can't parse JSON", text, start, etc) end end function OBJDEF:decode(text, etc) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onDecodeError("JSON:decode must be called in method format", nil, nil, etc) end if text == nil then self:onDecodeOfNilError(string.format("nil passed to JSON:decode()"), nil, nil, etc) elseif type(text) ~= 'string' then self:onDecodeError(string.format("expected string argument to JSON:decode(), got %s", type(text)), nil, nil, etc) end if text:match('^%s*$') then return nil end if text:match('^%s*<') then -- Can't be JSON... we'll assume it's HTML self:onDecodeOfHTMLError(string.format("html passed to JSON:decode()"), text, nil, etc) end -- -- Ensure that it's not UTF-32 or UTF-16. -- Those are perfectly valid encodings for JSON (as per RFC 4627 section 3), -- but this package can't handle them. -- if text:sub(1,1):byte() == 0 or (text:len() >= 2 and text:sub(2,2):byte() == 0) then self:onDecodeError("JSON package groks only UTF-8, sorry", text, nil, etc) end local success, value = pcall(grok_one, self, text, 1, etc) if success then return value else -- if JSON:onDecodeError() didn't abort out of the pcall, we'll have received the error message here as "value", so pass it along as an assert. if self.assert then self.assert(false, value) else assert(false, value) end -- and if we're still here, return a nil and throw the error message on as a second arg return nil, value end end local function backslash_replacement_function(c) if c == "\n" then return "\\n" elseif c == "\r" then return "\\r" elseif c == "\t" then return "\\t" elseif c == "\b" then return "\\b" elseif c == "\f" then return "\\f" elseif c == '"' then return '\\"' elseif c == '\\' then return '\\\\' else return string.format("\\u%04x", c:byte()) end end local chars_to_be_escaped_in_JSON_string = '[' .. '"' -- class sub-pattern to match a double quote .. '%\\' -- class sub-pattern to match a backslash .. '%z' -- class sub-pattern to match a null .. '\001' .. '-' .. '\031' -- class sub-pattern to match control characters .. ']' local function json_string_literal(value) local newval = value:gsub(chars_to_be_escaped_in_JSON_string, backslash_replacement_function) return '"' .. newval .. '"' end local function object_or_array(self, T, etc) -- -- We need to inspect all the keys... if there are any strings, we'll convert to a JSON -- object. If there are only numbers, it's a JSON array. -- -- If we'll be converting to a JSON object, we'll want to sort the keys so that the -- end result is deterministic. -- local string_keys = { } local number_keys = { } local number_keys_must_be_strings = false local maximum_number_key for key in pairs(T) do if type(key) == 'string' then table.insert(string_keys, key) elseif type(key) == 'number' then table.insert(number_keys, key) if key <= 0 or key >= math.huge then number_keys_must_be_strings = true elseif not maximum_number_key or key > maximum_number_key then maximum_number_key = key end else self:onEncodeError("can't encode table with a key of type " .. type(key), etc) end end if #string_keys == 0 and not number_keys_must_be_strings then -- -- An empty table, or a numeric-only array -- if #number_keys > 0 then return nil, maximum_number_key -- an array elseif tostring(T) == "JSON array" then return nil elseif tostring(T) == "JSON object" then return { } else -- have to guess, so we'll pick array, since empty arrays are likely more common than empty objects return nil end end table.sort(string_keys) local map if #number_keys > 0 then -- -- If we're here then we have either mixed string/number keys, or numbers inappropriate for a JSON array -- It's not ideal, but we'll turn the numbers into strings so that we can at least create a JSON object. -- if self.noKeyConversion then self:onEncodeError("a table with both numeric and string keys could be an object or array; aborting", etc) end -- -- Have to make a shallow copy of the source table so we can remap the numeric keys to be strings -- map = { } for key, val in pairs(T) do map[key] = val end table.sort(number_keys) -- -- Throw numeric keys in there as strings -- for _, number_key in ipairs(number_keys) do local string_key = tostring(number_key) if map[string_key] == nil then table.insert(string_keys , string_key) map[string_key] = T[number_key] else self:onEncodeError("conflict converting table with mixed-type keys into a JSON object: key " .. number_key .. " exists both as a string and a number.", etc) end end end return string_keys, nil, map end -- -- Encode -- -- 'options' is nil, or a table with possible keys: -- pretty -- if true, return a pretty-printed version -- indent -- a string (usually of spaces) used to indent each nested level -- align_keys -- if true, align all the keys when formatting a table -- local encode_value -- must predeclare because it calls itself function encode_value(self, value, parents, etc, options, indent) if value == nil then return 'null' elseif type(value) == 'string' then return json_string_literal(value) elseif type(value) == 'number' then if value ~= value then -- -- NaN (Not a Number). -- JSON has no NaN, so we have to fudge the best we can. This should really be a package option. -- return "null" elseif value >= math.huge then -- -- Positive infinity. JSON has no INF, so we have to fudge the best we can. This should -- really be a package option. Note: at least with some implementations, positive infinity -- is both ">= math.huge" and "<= -math.huge", which makes no sense but that's how it is. -- Negative infinity is properly "<= -math.huge". So, we must be sure to check the ">=" -- case first. -- return "1e+9999" elseif value <= -math.huge then -- -- Negative infinity. -- JSON has no INF, so we have to fudge the best we can. This should really be a package option. -- return "-1e+9999" else return tostring(value) end elseif type(value) == 'boolean' then return tostring(value) elseif type(value) ~= 'table' then self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc) else -- -- A table to be converted to either a JSON object or array. -- local T = value if type(options) ~= 'table' then options = {} end if type(indent) ~= 'string' then indent = "" end if parents[T] then self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc) else parents[T] = true end local result_value local object_keys, maximum_number_key, map = object_or_array(self, T, etc) if maximum_number_key then -- -- An array... -- local ITEMS = { } for i = 1, maximum_number_key do table.insert(ITEMS, encode_value(self, T[i], parents, etc, options, indent)) end if options.pretty then result_value = "[ " .. table.concat(ITEMS, ", ") .. " ]" else result_value = "[" .. table.concat(ITEMS, ",") .. "]" end elseif object_keys then -- -- An object -- local TT = map or T if options.pretty then local KEYS = { } local max_key_length = 0 for _, key in ipairs(object_keys) do local encoded = encode_value(self, tostring(key), parents, etc, options, indent) if options.align_keys then max_key_length = math.max(max_key_length, #encoded) end table.insert(KEYS, encoded) end local key_indent = indent .. tostring(options.indent or "") local subtable_indent = key_indent .. string.rep(" ", max_key_length) .. (options.align_keys and " " or "") local FORMAT = "%s%" .. string.format("%d", max_key_length) .. "s: %s" local COMBINED_PARTS = { } for i, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, subtable_indent) table.insert(COMBINED_PARTS, string.format(FORMAT, key_indent, KEYS[i], encoded_val)) end result_value = "{\n" .. table.concat(COMBINED_PARTS, ",\n") .. "\n" .. indent .. "}" else local PARTS = { } for _, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, indent) local encoded_key = encode_value(self, tostring(key), parents, etc, options, indent) table.insert(PARTS, string.format("%s:%s", encoded_key, encoded_val)) end result_value = "{" .. table.concat(PARTS, ",") .. "}" end else -- -- An empty array/object... we'll treat it as an array, though it should really be an option -- result_value = "[]" end parents[T] = false return result_value end end function OBJDEF:encode(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode must be called in method format", etc) end return encode_value(self, value, {}, etc, options or nil) end function OBJDEF:encode_pretty(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode_pretty must be called in method format", etc) end return encode_value(self, value, {}, etc, options or default_pretty_options) end function OBJDEF.__tostring() return "JSON encode/decode package" end OBJDEF.__index = OBJDEF function OBJDEF:new(args) local new = { } if args then for key, val in pairs(args) do new[key] = val end end return setmetatable(new, OBJDEF) end return OBJDEF:new() -- -- Version history: -- -- 20141223.14 The encode_pretty() routine produced fine results for small datasets, but isn't really -- appropriate for anything large, so with help from Alex Aulbach I've made the encode routines -- more flexible, and changed the default encode_pretty() to be more generally useful. -- -- Added a third 'options' argument to the encode() and encode_pretty() routines, to control -- how the encoding takes place. -- -- Updated docs to add assert() call to the loadfile() line, just as good practice so that -- if there is a problem loading JSON.lua, the appropriate error message will percolate up. -- -- 20140920.13 Put back (in a way that doesn't cause warnings about unused variables) the author string, -- so that the source of the package, and its version number, are visible in compiled copies. -- -- 20140911.12 Minor lua cleanup. -- Fixed internal reference to 'JSON.noKeyConversion' to reference 'self' instead of 'JSON'. -- (Thanks to SmugMug's David Parry for these.) -- -- 20140418.11 JSON nulls embedded within an array were being ignored, such that -- ["1",null,null,null,null,null,"seven"], -- would return -- {1,"seven"} -- It's now fixed to properly return -- {1, nil, nil, nil, nil, nil, "seven"} -- Thanks to "haddock" for catching the error. -- -- 20140116.10 The user's JSON.assert() wasn't always being used. Thanks to "blue" for the heads up. -- -- 20131118.9 Update for Lua 5.3... it seems that tostring(2/1) produces "2.0" instead of "2", -- and this caused some problems. -- -- 20131031.8 Unified the code for encode() and encode_pretty(); they had been stupidly separate, -- and had of course diverged (encode_pretty didn't get the fixes that encode got, so -- sometimes produced incorrect results; thanks to Mattie for the heads up). -- -- Handle encoding tables with non-positive numeric keys (unlikely, but possible). -- -- If a table has both numeric and string keys, or its numeric keys are inappropriate -- (such as being non-positive or infinite), the numeric keys are turned into -- string keys appropriate for a JSON object. So, as before, -- JSON:encode({ "one", "two", "three" }) -- produces the array -- ["one","two","three"] -- but now something with mixed key types like -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- instead of throwing an error produces an object: -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To maintain the prior throw-an-error semantics, set -- JSON.noKeyConversion = true -- -- 20131004.7 Release under a Creative Commons CC-BY license, which I should have done from day one, sorry. -- -- 20130120.6 Comment update: added a link to the specific page on my blog where this code can -- be found, so that folks who come across the code outside of my blog can find updates -- more easily. -- -- 20111207.5 Added support for the 'etc' arguments, for better error reporting. -- -- 20110731.4 More feedback from David Kolf on how to make the tests for Nan/Infinity system independent. -- -- 20110730.3 Incorporated feedback from David Kolf at http://lua-users.org/wiki/JsonModules: -- -- * When encoding lua for JSON, Sparse numeric arrays are now handled by -- spitting out full arrays, such that -- JSON:encode({"one", "two", [10] = "ten"}) -- returns -- ["one","two",null,null,null,null,null,null,null,"ten"] -- -- In 20100810.2 and earlier, only up to the first non-null value would have been retained. -- -- * When encoding lua for JSON, numeric value NaN gets spit out as null, and infinity as "1+e9999". -- Version 20100810.2 and earlier created invalid JSON in both cases. -- -- * Unicode surrogate pairs are now detected when decoding JSON. -- -- 20100810.2 added some checking to ensure that an invalid Unicode character couldn't leak in to the UTF-8 encoding -- -- 20100731.1 initial public release --
gpl-2.0
m13790115/mahdi
libs/JSON.lua
3765
34843
-- -*- coding: utf-8 -*- -- -- Simple JSON encoding and decoding in pure Lua. -- -- Copyright 2010-2014 Jeffrey Friedl -- http://regex.info/blog/ -- -- Latest version: http://regex.info/blog/lua/json -- -- This code is released under a Creative Commons CC-BY "Attribution" License: -- http://creativecommons.org/licenses/by/3.0/deed.en_US -- -- It can be used for any purpose so long as the copyright notice above, -- the web-page links above, and the 'AUTHOR_NOTE' string below are -- maintained. Enjoy. -- local VERSION = 20141223.14 -- version history at end of file local AUTHOR_NOTE = "-[ JSON.lua package by Jeffrey Friedl (http://regex.info/blog/lua/json) version 20141223.14 ]-" -- -- The 'AUTHOR_NOTE' variable exists so that information about the source -- of the package is maintained even in compiled versions. It's also -- included in OBJDEF below mostly to quiet warnings about unused variables. -- local OBJDEF = { VERSION = VERSION, AUTHOR_NOTE = AUTHOR_NOTE, } -- -- Simple JSON encoding and decoding in pure Lua. -- http://www.json.org/ -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- -- -- -- DECODING (from a JSON string to a Lua table) -- -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local lua_value = JSON:decode(raw_json_text) -- -- If the JSON text is for an object or an array, e.g. -- { "what": "books", "count": 3 } -- or -- [ "Larry", "Curly", "Moe" ] -- -- the result is a Lua table, e.g. -- { what = "books", count = 3 } -- or -- { "Larry", "Curly", "Moe" } -- -- -- The encode and decode routines accept an optional second argument, -- "etc", which is not used during encoding or decoding, but upon error -- is passed along to error handlers. It can be of any type (including nil). -- -- -- -- ERROR HANDLING -- -- With most errors during decoding, this code calls -- -- JSON:onDecodeError(message, text, location, etc) -- -- with a message about the error, and if known, the JSON text being -- parsed and the byte count where the problem was discovered. You can -- replace the default JSON:onDecodeError() with your own function. -- -- The default onDecodeError() merely augments the message with data -- about the text and the location if known (and if a second 'etc' -- argument had been provided to decode(), its value is tacked onto the -- message as well), and then calls JSON.assert(), which itself defaults -- to Lua's built-in assert(), and can also be overridden. -- -- For example, in an Adobe Lightroom plugin, you might use something like -- -- function JSON:onDecodeError(message, text, location, etc) -- LrErrors.throwUserError("Internal Error: invalid JSON data") -- end -- -- or even just -- -- function JSON.assert(message) -- LrErrors.throwUserError("Internal Error: " .. message) -- end -- -- If JSON:decode() is passed a nil, this is called instead: -- -- JSON:onDecodeOfNilError(message, nil, nil, etc) -- -- and if JSON:decode() is passed HTML instead of JSON, this is called: -- -- JSON:onDecodeOfHTMLError(message, text, nil, etc) -- -- The use of the fourth 'etc' argument allows stronger coordination -- between decoding and error reporting, especially when you provide your -- own error-handling routines. Continuing with the the Adobe Lightroom -- plugin example: -- -- function JSON:onDecodeError(message, text, location, etc) -- local note = "Internal Error: invalid JSON data" -- if type(etc) = 'table' and etc.photo then -- note = note .. " while processing for " .. etc.photo:getFormattedMetadata('fileName') -- end -- LrErrors.throwUserError(note) -- end -- -- : -- : -- -- for i, photo in ipairs(photosToProcess) do -- : -- : -- local data = JSON:decode(someJsonText, { photo = photo }) -- : -- : -- end -- -- -- -- -- -- DECODING AND STRICT TYPES -- -- Because both JSON objects and JSON arrays are converted to Lua tables, -- it's not normally possible to tell which original JSON type a -- particular Lua table was derived from, or guarantee decode-encode -- round-trip equivalency. -- -- However, if you enable strictTypes, e.g. -- -- JSON = assert(loadfile "JSON.lua")() --load the routines -- JSON.strictTypes = true -- -- then the Lua table resulting from the decoding of a JSON object or -- JSON array is marked via Lua metatable, so that when re-encoded with -- JSON:encode() it ends up as the appropriate JSON type. -- -- (This is not the default because other routines may not work well with -- tables that have a metatable set, for example, Lightroom API calls.) -- -- -- ENCODING (from a lua table to a JSON string) -- -- JSON = assert(loadfile "JSON.lua")() -- one-time load of the routines -- -- local raw_json_text = JSON:encode(lua_table_or_value) -- local pretty_json_text = JSON:encode_pretty(lua_table_or_value) -- "pretty printed" version for human readability -- local custom_pretty = JSON:encode(lua_table_or_value, etc, { pretty = true, indent = "| ", align_keys = false }) -- -- On error during encoding, this code calls: -- -- JSON:onEncodeError(message, etc) -- -- which you can override in your local JSON object. -- -- The 'etc' in the error call is the second argument to encode() -- and encode_pretty(), or nil if it wasn't provided. -- -- -- PRETTY-PRINTING -- -- An optional third argument, a table of options, allows a bit of -- configuration about how the encoding takes place: -- -- pretty = JSON:encode(val, etc, { -- pretty = true, -- if false, no other options matter -- indent = " ", -- this provides for a three-space indent per nesting level -- align_keys = false, -- see below -- }) -- -- encode() and encode_pretty() are identical except that encode_pretty() -- provides a default options table if none given in the call: -- -- { pretty = true, align_keys = false, indent = " " } -- -- For example, if -- -- JSON:encode(data) -- -- produces: -- -- {"city":"Kyoto","climate":{"avg_temp":16,"humidity":"high","snowfall":"minimal"},"country":"Japan","wards":11} -- -- then -- -- JSON:encode_pretty(data) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- The following three lines return identical results: -- JSON:encode_pretty(data) -- JSON:encode_pretty(data, nil, { pretty = true, align_keys = false, indent = " " }) -- JSON:encode (data, nil, { pretty = true, align_keys = false, indent = " " }) -- -- An example of setting your own indent string: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = "| " }) -- -- produces: -- -- { -- | "city": "Kyoto", -- | "climate": { -- | | "avg_temp": 16, -- | | "humidity": "high", -- | | "snowfall": "minimal" -- | }, -- | "country": "Japan", -- | "wards": 11 -- } -- -- An example of setting align_keys to true: -- -- JSON:encode_pretty(data, nil, { pretty = true, indent = " ", align_keys = true }) -- -- produces: -- -- { -- "city": "Kyoto", -- "climate": { -- "avg_temp": 16, -- "humidity": "high", -- "snowfall": "minimal" -- }, -- "country": "Japan", -- "wards": 11 -- } -- -- which I must admit is kinda ugly, sorry. This was the default for -- encode_pretty() prior to version 20141223.14. -- -- -- AMBIGUOUS SITUATIONS DURING THE ENCODING -- -- During the encode, if a Lua table being encoded contains both string -- and numeric keys, it fits neither JSON's idea of an object, nor its -- idea of an array. To get around this, when any string key exists (or -- when non-positive numeric keys exist), numeric keys are converted to -- strings. -- -- For example, -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- produces the JSON object -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To prohibit this conversion and instead make it an error condition, set -- JSON.noKeyConversion = true -- -- -- SUMMARY OF METHODS YOU CAN OVERRIDE IN YOUR LOCAL LUA JSON OBJECT -- -- assert -- onDecodeError -- onDecodeOfNilError -- onDecodeOfHTMLError -- onEncodeError -- -- If you want to create a separate Lua JSON object with its own error handlers, -- you can reload JSON.lua or use the :new() method. -- --------------------------------------------------------------------------- local default_pretty_indent = " " local default_pretty_options = { pretty = true, align_keys = false, indent = default_pretty_indent } local isArray = { __tostring = function() return "JSON array" end } isArray.__index = isArray local isObject = { __tostring = function() return "JSON object" end } isObject.__index = isObject function OBJDEF:newArray(tbl) return setmetatable(tbl or {}, isArray) end function OBJDEF:newObject(tbl) return setmetatable(tbl or {}, isObject) end local function unicode_codepoint_as_utf8(codepoint) -- -- codepoint is a number -- if codepoint <= 127 then return string.char(codepoint) elseif codepoint <= 2047 then -- -- 110yyyxx 10xxxxxx <-- useful notation from http://en.wikipedia.org/wiki/Utf8 -- local highpart = math.floor(codepoint / 0x40) local lowpart = codepoint - (0x40 * highpart) return string.char(0xC0 + highpart, 0x80 + lowpart) elseif codepoint <= 65535 then -- -- 1110yyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x1000) local remainder = codepoint - 0x1000 * highpart local midpart = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midpart highpart = 0xE0 + highpart midpart = 0x80 + midpart lowpart = 0x80 + lowpart -- -- Check for an invalid character (thanks Andy R. at Adobe). -- See table 3.7, page 93, in http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf#G28070 -- if ( highpart == 0xE0 and midpart < 0xA0 ) or ( highpart == 0xED and midpart > 0x9F ) or ( highpart == 0xF0 and midpart < 0x90 ) or ( highpart == 0xF4 and midpart > 0x8F ) then return "?" else return string.char(highpart, midpart, lowpart) end else -- -- 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx -- local highpart = math.floor(codepoint / 0x40000) local remainder = codepoint - 0x40000 * highpart local midA = math.floor(remainder / 0x1000) remainder = remainder - 0x1000 * midA local midB = math.floor(remainder / 0x40) local lowpart = remainder - 0x40 * midB return string.char(0xF0 + highpart, 0x80 + midA, 0x80 + midB, 0x80 + lowpart) end end function OBJDEF:onDecodeError(message, text, location, etc) if text then if location then message = string.format("%s at char %d of: %s", message, location, text) else message = string.format("%s: %s", message, text) end end if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end OBJDEF.onDecodeOfNilError = OBJDEF.onDecodeError OBJDEF.onDecodeOfHTMLError = OBJDEF.onDecodeError function OBJDEF:onEncodeError(message, etc) if etc ~= nil then message = message .. " (" .. OBJDEF:encode(etc) .. ")" end if self.assert then self.assert(false, message) else assert(false, message) end end local function grok_number(self, text, start, etc) -- -- Grab the integer part -- local integer_part = text:match('^-?[1-9]%d*', start) or text:match("^-?0", start) if not integer_part then self:onDecodeError("expected number", text, start, etc) end local i = start + integer_part:len() -- -- Grab an optional decimal part -- local decimal_part = text:match('^%.%d+', i) or "" i = i + decimal_part:len() -- -- Grab an optional exponential part -- local exponent_part = text:match('^[eE][-+]?%d+', i) or "" i = i + exponent_part:len() local full_number_text = integer_part .. decimal_part .. exponent_part local as_number = tonumber(full_number_text) if not as_number then self:onDecodeError("bad number", text, start, etc) end return as_number, i end local function grok_string(self, text, start, etc) if text:sub(start,start) ~= '"' then self:onDecodeError("expected string's opening quote", text, start, etc) end local i = start + 1 -- +1 to bypass the initial quote local text_len = text:len() local VALUE = "" while i <= text_len do local c = text:sub(i,i) if c == '"' then return VALUE, i + 1 end if c ~= '\\' then VALUE = VALUE .. c i = i + 1 elseif text:match('^\\b', i) then VALUE = VALUE .. "\b" i = i + 2 elseif text:match('^\\f', i) then VALUE = VALUE .. "\f" i = i + 2 elseif text:match('^\\n', i) then VALUE = VALUE .. "\n" i = i + 2 elseif text:match('^\\r', i) then VALUE = VALUE .. "\r" i = i + 2 elseif text:match('^\\t', i) then VALUE = VALUE .. "\t" i = i + 2 else local hex = text:match('^\\u([0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if hex then i = i + 6 -- bypass what we just read -- We have a Unicode codepoint. It could be standalone, or if in the proper range and -- followed by another in a specific range, it'll be a two-code surrogate pair. local codepoint = tonumber(hex, 16) if codepoint >= 0xD800 and codepoint <= 0xDBFF then -- it's a hi surrogate... see whether we have a following low local lo_surrogate = text:match('^\\u([dD][cdefCDEF][0123456789aAbBcCdDeEfF][0123456789aAbBcCdDeEfF])', i) if lo_surrogate then i = i + 6 -- bypass the low surrogate we just read codepoint = 0x2400 + (codepoint - 0xD800) * 0x400 + tonumber(lo_surrogate, 16) else -- not a proper low, so we'll just leave the first codepoint as is and spit it out. end end VALUE = VALUE .. unicode_codepoint_as_utf8(codepoint) else -- just pass through what's escaped VALUE = VALUE .. text:match('^\\(.)', i) i = i + 2 end end end self:onDecodeError("unclosed string", text, start, etc) end local function skip_whitespace(text, start) local _, match_end = text:find("^[ \n\r\t]+", start) -- [http://www.ietf.org/rfc/rfc4627.txt] Section 2 if match_end then return match_end + 1 else return start end end local grok_one -- assigned later local function grok_object(self, text, start, etc) if text:sub(start,start) ~= '{' then self:onDecodeError("expected '{'", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '{' local VALUE = self.strictTypes and self:newObject { } or { } if text:sub(i,i) == '}' then return VALUE, i + 1 end local text_len = text:len() while i <= text_len do local key, new_i = grok_string(self, text, i, etc) i = skip_whitespace(text, new_i) if text:sub(i, i) ~= ':' then self:onDecodeError("expected colon", text, i, etc) end i = skip_whitespace(text, i + 1) local new_val, new_i = grok_one(self, text, i) VALUE[key] = new_val -- -- Expect now either '}' to end things, or a ',' to allow us to continue. -- i = skip_whitespace(text, new_i) local c = text:sub(i,i) if c == '}' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '}'", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '{'", text, start, etc) end local function grok_array(self, text, start, etc) if text:sub(start,start) ~= '[' then self:onDecodeError("expected '['", text, start, etc) end local i = skip_whitespace(text, start + 1) -- +1 to skip the '[' local VALUE = self.strictTypes and self:newArray { } or { } if text:sub(i,i) == ']' then return VALUE, i + 1 end local VALUE_INDEX = 1 local text_len = text:len() while i <= text_len do local val, new_i = grok_one(self, text, i) -- can't table.insert(VALUE, val) here because it's a no-op if val is nil VALUE[VALUE_INDEX] = val VALUE_INDEX = VALUE_INDEX + 1 i = skip_whitespace(text, new_i) -- -- Expect now either ']' to end things, or a ',' to allow us to continue. -- local c = text:sub(i,i) if c == ']' then return VALUE, i + 1 end if text:sub(i, i) ~= ',' then self:onDecodeError("expected comma or '['", text, i, etc) end i = skip_whitespace(text, i + 1) end self:onDecodeError("unclosed '['", text, start, etc) end grok_one = function(self, text, start, etc) -- Skip any whitespace start = skip_whitespace(text, start) if start > text:len() then self:onDecodeError("unexpected end of string", text, nil, etc) end if text:find('^"', start) then return grok_string(self, text, start, etc) elseif text:find('^[-0123456789 ]', start) then return grok_number(self, text, start, etc) elseif text:find('^%{', start) then return grok_object(self, text, start, etc) elseif text:find('^%[', start) then return grok_array(self, text, start, etc) elseif text:find('^true', start) then return true, start + 4 elseif text:find('^false', start) then return false, start + 5 elseif text:find('^null', start) then return nil, start + 4 else self:onDecodeError("can't parse JSON", text, start, etc) end end function OBJDEF:decode(text, etc) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onDecodeError("JSON:decode must be called in method format", nil, nil, etc) end if text == nil then self:onDecodeOfNilError(string.format("nil passed to JSON:decode()"), nil, nil, etc) elseif type(text) ~= 'string' then self:onDecodeError(string.format("expected string argument to JSON:decode(), got %s", type(text)), nil, nil, etc) end if text:match('^%s*$') then return nil end if text:match('^%s*<') then -- Can't be JSON... we'll assume it's HTML self:onDecodeOfHTMLError(string.format("html passed to JSON:decode()"), text, nil, etc) end -- -- Ensure that it's not UTF-32 or UTF-16. -- Those are perfectly valid encodings for JSON (as per RFC 4627 section 3), -- but this package can't handle them. -- if text:sub(1,1):byte() == 0 or (text:len() >= 2 and text:sub(2,2):byte() == 0) then self:onDecodeError("JSON package groks only UTF-8, sorry", text, nil, etc) end local success, value = pcall(grok_one, self, text, 1, etc) if success then return value else -- if JSON:onDecodeError() didn't abort out of the pcall, we'll have received the error message here as "value", so pass it along as an assert. if self.assert then self.assert(false, value) else assert(false, value) end -- and if we're still here, return a nil and throw the error message on as a second arg return nil, value end end local function backslash_replacement_function(c) if c == "\n" then return "\\n" elseif c == "\r" then return "\\r" elseif c == "\t" then return "\\t" elseif c == "\b" then return "\\b" elseif c == "\f" then return "\\f" elseif c == '"' then return '\\"' elseif c == '\\' then return '\\\\' else return string.format("\\u%04x", c:byte()) end end local chars_to_be_escaped_in_JSON_string = '[' .. '"' -- class sub-pattern to match a double quote .. '%\\' -- class sub-pattern to match a backslash .. '%z' -- class sub-pattern to match a null .. '\001' .. '-' .. '\031' -- class sub-pattern to match control characters .. ']' local function json_string_literal(value) local newval = value:gsub(chars_to_be_escaped_in_JSON_string, backslash_replacement_function) return '"' .. newval .. '"' end local function object_or_array(self, T, etc) -- -- We need to inspect all the keys... if there are any strings, we'll convert to a JSON -- object. If there are only numbers, it's a JSON array. -- -- If we'll be converting to a JSON object, we'll want to sort the keys so that the -- end result is deterministic. -- local string_keys = { } local number_keys = { } local number_keys_must_be_strings = false local maximum_number_key for key in pairs(T) do if type(key) == 'string' then table.insert(string_keys, key) elseif type(key) == 'number' then table.insert(number_keys, key) if key <= 0 or key >= math.huge then number_keys_must_be_strings = true elseif not maximum_number_key or key > maximum_number_key then maximum_number_key = key end else self:onEncodeError("can't encode table with a key of type " .. type(key), etc) end end if #string_keys == 0 and not number_keys_must_be_strings then -- -- An empty table, or a numeric-only array -- if #number_keys > 0 then return nil, maximum_number_key -- an array elseif tostring(T) == "JSON array" then return nil elseif tostring(T) == "JSON object" then return { } else -- have to guess, so we'll pick array, since empty arrays are likely more common than empty objects return nil end end table.sort(string_keys) local map if #number_keys > 0 then -- -- If we're here then we have either mixed string/number keys, or numbers inappropriate for a JSON array -- It's not ideal, but we'll turn the numbers into strings so that we can at least create a JSON object. -- if self.noKeyConversion then self:onEncodeError("a table with both numeric and string keys could be an object or array; aborting", etc) end -- -- Have to make a shallow copy of the source table so we can remap the numeric keys to be strings -- map = { } for key, val in pairs(T) do map[key] = val end table.sort(number_keys) -- -- Throw numeric keys in there as strings -- for _, number_key in ipairs(number_keys) do local string_key = tostring(number_key) if map[string_key] == nil then table.insert(string_keys , string_key) map[string_key] = T[number_key] else self:onEncodeError("conflict converting table with mixed-type keys into a JSON object: key " .. number_key .. " exists both as a string and a number.", etc) end end end return string_keys, nil, map end -- -- Encode -- -- 'options' is nil, or a table with possible keys: -- pretty -- if true, return a pretty-printed version -- indent -- a string (usually of spaces) used to indent each nested level -- align_keys -- if true, align all the keys when formatting a table -- local encode_value -- must predeclare because it calls itself function encode_value(self, value, parents, etc, options, indent) if value == nil then return 'null' elseif type(value) == 'string' then return json_string_literal(value) elseif type(value) == 'number' then if value ~= value then -- -- NaN (Not a Number). -- JSON has no NaN, so we have to fudge the best we can. This should really be a package option. -- return "null" elseif value >= math.huge then -- -- Positive infinity. JSON has no INF, so we have to fudge the best we can. This should -- really be a package option. Note: at least with some implementations, positive infinity -- is both ">= math.huge" and "<= -math.huge", which makes no sense but that's how it is. -- Negative infinity is properly "<= -math.huge". So, we must be sure to check the ">=" -- case first. -- return "1e+9999" elseif value <= -math.huge then -- -- Negative infinity. -- JSON has no INF, so we have to fudge the best we can. This should really be a package option. -- return "-1e+9999" else return tostring(value) end elseif type(value) == 'boolean' then return tostring(value) elseif type(value) ~= 'table' then self:onEncodeError("can't convert " .. type(value) .. " to JSON", etc) else -- -- A table to be converted to either a JSON object or array. -- local T = value if type(options) ~= 'table' then options = {} end if type(indent) ~= 'string' then indent = "" end if parents[T] then self:onEncodeError("table " .. tostring(T) .. " is a child of itself", etc) else parents[T] = true end local result_value local object_keys, maximum_number_key, map = object_or_array(self, T, etc) if maximum_number_key then -- -- An array... -- local ITEMS = { } for i = 1, maximum_number_key do table.insert(ITEMS, encode_value(self, T[i], parents, etc, options, indent)) end if options.pretty then result_value = "[ " .. table.concat(ITEMS, ", ") .. " ]" else result_value = "[" .. table.concat(ITEMS, ",") .. "]" end elseif object_keys then -- -- An object -- local TT = map or T if options.pretty then local KEYS = { } local max_key_length = 0 for _, key in ipairs(object_keys) do local encoded = encode_value(self, tostring(key), parents, etc, options, indent) if options.align_keys then max_key_length = math.max(max_key_length, #encoded) end table.insert(KEYS, encoded) end local key_indent = indent .. tostring(options.indent or "") local subtable_indent = key_indent .. string.rep(" ", max_key_length) .. (options.align_keys and " " or "") local FORMAT = "%s%" .. string.format("%d", max_key_length) .. "s: %s" local COMBINED_PARTS = { } for i, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, subtable_indent) table.insert(COMBINED_PARTS, string.format(FORMAT, key_indent, KEYS[i], encoded_val)) end result_value = "{\n" .. table.concat(COMBINED_PARTS, ",\n") .. "\n" .. indent .. "}" else local PARTS = { } for _, key in ipairs(object_keys) do local encoded_val = encode_value(self, TT[key], parents, etc, options, indent) local encoded_key = encode_value(self, tostring(key), parents, etc, options, indent) table.insert(PARTS, string.format("%s:%s", encoded_key, encoded_val)) end result_value = "{" .. table.concat(PARTS, ",") .. "}" end else -- -- An empty array/object... we'll treat it as an array, though it should really be an option -- result_value = "[]" end parents[T] = false return result_value end end function OBJDEF:encode(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode must be called in method format", etc) end return encode_value(self, value, {}, etc, options or nil) end function OBJDEF:encode_pretty(value, etc, options) if type(self) ~= 'table' or self.__index ~= OBJDEF then OBJDEF:onEncodeError("JSON:encode_pretty must be called in method format", etc) end return encode_value(self, value, {}, etc, options or default_pretty_options) end function OBJDEF.__tostring() return "JSON encode/decode package" end OBJDEF.__index = OBJDEF function OBJDEF:new(args) local new = { } if args then for key, val in pairs(args) do new[key] = val end end return setmetatable(new, OBJDEF) end return OBJDEF:new() -- -- Version history: -- -- 20141223.14 The encode_pretty() routine produced fine results for small datasets, but isn't really -- appropriate for anything large, so with help from Alex Aulbach I've made the encode routines -- more flexible, and changed the default encode_pretty() to be more generally useful. -- -- Added a third 'options' argument to the encode() and encode_pretty() routines, to control -- how the encoding takes place. -- -- Updated docs to add assert() call to the loadfile() line, just as good practice so that -- if there is a problem loading JSON.lua, the appropriate error message will percolate up. -- -- 20140920.13 Put back (in a way that doesn't cause warnings about unused variables) the author string, -- so that the source of the package, and its version number, are visible in compiled copies. -- -- 20140911.12 Minor lua cleanup. -- Fixed internal reference to 'JSON.noKeyConversion' to reference 'self' instead of 'JSON'. -- (Thanks to SmugMug's David Parry for these.) -- -- 20140418.11 JSON nulls embedded within an array were being ignored, such that -- ["1",null,null,null,null,null,"seven"], -- would return -- {1,"seven"} -- It's now fixed to properly return -- {1, nil, nil, nil, nil, nil, "seven"} -- Thanks to "haddock" for catching the error. -- -- 20140116.10 The user's JSON.assert() wasn't always being used. Thanks to "blue" for the heads up. -- -- 20131118.9 Update for Lua 5.3... it seems that tostring(2/1) produces "2.0" instead of "2", -- and this caused some problems. -- -- 20131031.8 Unified the code for encode() and encode_pretty(); they had been stupidly separate, -- and had of course diverged (encode_pretty didn't get the fixes that encode got, so -- sometimes produced incorrect results; thanks to Mattie for the heads up). -- -- Handle encoding tables with non-positive numeric keys (unlikely, but possible). -- -- If a table has both numeric and string keys, or its numeric keys are inappropriate -- (such as being non-positive or infinite), the numeric keys are turned into -- string keys appropriate for a JSON object. So, as before, -- JSON:encode({ "one", "two", "three" }) -- produces the array -- ["one","two","three"] -- but now something with mixed key types like -- JSON:encode({ "one", "two", "three", SOMESTRING = "some string" })) -- instead of throwing an error produces an object: -- {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} -- -- To maintain the prior throw-an-error semantics, set -- JSON.noKeyConversion = true -- -- 20131004.7 Release under a Creative Commons CC-BY license, which I should have done from day one, sorry. -- -- 20130120.6 Comment update: added a link to the specific page on my blog where this code can -- be found, so that folks who come across the code outside of my blog can find updates -- more easily. -- -- 20111207.5 Added support for the 'etc' arguments, for better error reporting. -- -- 20110731.4 More feedback from David Kolf on how to make the tests for Nan/Infinity system independent. -- -- 20110730.3 Incorporated feedback from David Kolf at http://lua-users.org/wiki/JsonModules: -- -- * When encoding lua for JSON, Sparse numeric arrays are now handled by -- spitting out full arrays, such that -- JSON:encode({"one", "two", [10] = "ten"}) -- returns -- ["one","two",null,null,null,null,null,null,null,"ten"] -- -- In 20100810.2 and earlier, only up to the first non-null value would have been retained. -- -- * When encoding lua for JSON, numeric value NaN gets spit out as null, and infinity as "1+e9999". -- Version 20100810.2 and earlier created invalid JSON in both cases. -- -- * Unicode surrogate pairs are now detected when decoding JSON. -- -- 20100810.2 added some checking to ensure that an invalid Unicode character couldn't leak in to the UTF-8 encoding -- -- 20100731.1 initial public release --
gpl-2.0
TheAnswer/FirstTest
bin/scripts/items/objects/weapons/pistols/srCombatPistol.lua
1
2465
--Copyright (C) 2007 <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. srCombatPistol = Weapon:new{ objectName = "SR Combat Pistol", templateName = "object/weapon/ranged/pistol/shared_pistol_srcombat.iff", objectCRC = 874294352, objectType = PISTOL, damageType = WEAPON_ENERGY, armorPiercing = WEAPON_LIGHT, certification = "cert_pistol_srcombat", attackSpeed = 3.75, minDamage = 45, maxDamage = 100 }
lgpl-3.0
Shayan123456/botttttt9
plugins/weather.lua
274
1531
do local BASE_URL = "http://api.openweathermap.org/data/2.5/weather" local function get_weather(location) print("Finding weather in ", location) location = string.gsub(location," ","+") local url = BASE_URL url = url..'?q='..location url = url..'&units=metric' url = url..'&appid=bd82977b86bf27fb59a04b61b657fb6f' local b, c, h = http.request(url) if c ~= 200 then return nil end local weather = json:decode(b) local city = weather.name local country = weather.sys.country local temp = 'The temperature in '..city ..' (' ..country..')' ..' is '..weather.main.temp..'°C' local conditions = 'Current conditions are: ' .. weather.weather[1].description if weather.weather[1].main == 'Clear' then conditions = conditions .. ' ☀' elseif weather.weather[1].main == 'Clouds' then conditions = conditions .. ' ☁☁' elseif weather.weather[1].main == 'Rain' then conditions = conditions .. ' ☔' elseif weather.weather[1].main == 'Thunderstorm' then conditions = conditions .. ' ☔☔☔☔' end return temp .. '\n' .. conditions end local function run(msg, matches) local city = 'Madrid,ES' if matches[1] ~= '!weather' then city = matches[1] end local text = get_weather(city) if not text then text = 'Can\'t get weather from that city.' end return text end return { description = "weather in that city (Madrid is default)", usage = "!weather (city)", patterns = { "^!weather$", "^!weather (.*)$" }, run = run } end
gpl-2.0
ArashFaceBook/Virus
libs/redis.lua
566
1214
local Redis = require 'redis' local FakeRedis = require 'fakeredis' local params = { host = os.getenv('REDIS_HOST') or '127.0.0.1', port = tonumber(os.getenv('REDIS_PORT') or 6379) } local database = os.getenv('REDIS_DB') local password = os.getenv('REDIS_PASSWORD') -- Overwrite HGETALL Redis.commands.hgetall = Redis.command('hgetall', { response = function(reply, command, ...) local new_reply = { } for i = 1, #reply, 2 do new_reply[reply[i]] = reply[i + 1] end return new_reply end }) local redis = nil -- Won't launch an error if fails local ok = pcall(function() redis = Redis.connect(params) end) if not ok then local fake_func = function() print('\27[31mCan\'t connect with Redis, install/configure it!\27[39m') end fake_func() fake = FakeRedis.new() print('\27[31mRedis addr: '..params.host..'\27[39m') print('\27[31mRedis port: '..params.port..'\27[39m') redis = setmetatable({fakeredis=true}, { __index = function(a, b) if b ~= 'data' and fake[b] then fake_func(b) end return fake[b] or fake_func end }) else if password then redis:auth(password) end if database then redis:select(database) end end return redis
gpl-2.0
Lunovox/minetest_nibirus_game
mods/base/flowers/mapgen.lua
8
3685
-- -- Mgv6 -- local function register_mgv6_flower(name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.006, spread = {x = 100, y = 100, z = 100}, seed = 436, octaves = 3, persist = 0.6 }, y_min = 1, y_max = 30, decoration = "flowers:"..name, }) end local function register_mgv6_mushroom(name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.04, spread = {x = 100, y = 100, z = 100}, seed = 7133, octaves = 3, persist = 0.6 }, y_min = 1, y_max = 30, decoration = "flowers:"..name, spawn_by = "default:tree", num_spawn_by = 1, }) end local function register_mgv6_waterlily() minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt"}, sidelen = 16, noise_params = { offset = -0.12, scale = 0.3, spread = {x = 100, y = 100, z = 100}, seed = 33, octaves = 3, persist = 0.7 }, y_min = 0, y_max = 0, schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts", rotation = "random", }) end function flowers.register_mgv6_decorations() register_mgv6_flower("rose") register_mgv6_flower("tulip") register_mgv6_flower("dandelion_yellow") register_mgv6_flower("geranium") register_mgv6_flower("viola") register_mgv6_flower("dandelion_white") register_mgv6_mushroom("mushroom_brown") register_mgv6_mushroom("mushroom_red") register_mgv6_waterlily() end -- -- All other biome API mapgens -- local function register_flower(seed, name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = -0.015, scale = 0.025, spread = {x = 200, y = 200, z = 200}, seed = seed, octaves = 3, persist = 0.6 }, biomes = {"grassland", "deciduous_forest", "coniferous_forest", "floatland_grassland", "floatland_coniferous_forest"}, y_min = 1, y_max = 31000, decoration = "flowers:"..name, }) end local function register_mushroom(name) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, scale = 0.006, spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 }, biomes = {"deciduous_forest", "coniferous_forest", "floatland_coniferous_forest"}, y_min = 1, y_max = 31000, decoration = "flowers:"..name, }) end local function register_waterlily() minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt"}, sidelen = 16, noise_params = { offset = -0.12, scale = 0.3, spread = {x = 200, y = 200, z = 200}, seed = 33, octaves = 3, persist = 0.7 }, biomes = {"rainforest_swamp", "savanna_shore", "deciduous_forest_shore"}, y_min = 0, y_max = 0, schematic = minetest.get_modpath("flowers") .. "/schematics/waterlily.mts", rotation = "random", }) end function flowers.register_decorations() register_flower(436, "rose") register_flower(19822, "tulip") register_flower(1220999, "dandelion_yellow") register_flower(36662, "geranium") register_flower(1133, "viola") register_flower(73133, "dandelion_white") register_mushroom("mushroom_brown") register_mushroom("mushroom_red") register_waterlily() end -- -- Detect mapgen to select functions -- local mg_name = minetest.get_mapgen_setting("mg_name") if mg_name == "v6" then flowers.register_mgv6_decorations() else flowers.register_decorations() end
agpl-3.0
shahabsaf1/test
plugins/plugins.lua
1
6075
do -- Returns the key (index) in the config.enabled_plugins table local function plugin_enabled( name ) for k,v in pairs(_config.enabled_plugins) do if name == v then return k end end -- If not found return false end -- Returns true if file exists in plugins folder local function plugin_exists( name ) for k,v in pairs(plugins_names()) do if name..'.lua' == v then return true end end return false end local function list_all_plugins(only_enabled) local text = '' local nsum = 0 for k, v in pairs( plugins_names( )) do -- ✅ enabled, ❎ disabled local status = '❎' nsum = nsum+1 nact = 0 -- Check if is enabled for k2, v2 in pairs(_config.enabled_plugins) do if v == v2..'.lua' then status = '✅' end nact = nact+1 end if not only_enabled or status == '✔' then -- get the name v = string.match (v, "(.*)%.lua") text = text..nsum..'. '..v..' '..status..'\n' end end local text = text..'\nThere are '..nsum..' plugins installed.\n'..nact..' plugins enabled and '..nsum-nact..' disabled' return text end local function list_plugins(only_enabled) local text = '' local nsum = 0 for k, v in pairs( plugins_names( )) do -- ✅ enabled, ❎ disabled local status = '❎' nsum = nsum+1 nact = 0 -- Check if is enabled for k2, v2 in pairs(_config.enabled_plugins) do if v == v2..'.lua' then status = '✅' end nact = nact+1 end if not only_enabled or status == '✔' then -- get the name v = string.match (v, "(.*)%.lua") text = text..v..' '..status..'\n' end end local text = text..'\n'..nact..' plugins enabled from '..nsum..' plugins installed.' return text end local function reload_plugins( ) plugins = {} load_plugins() return list_plugins(true) end local function enable_plugin( plugin_name ) print('checking if '..plugin_name..' exists') -- Check if plugin is enabled if plugin_enabled(plugin_name) then return 'Plugin '..plugin_name..' is enabled' end -- Checks if plugin exists if plugin_exists(plugin_name) then -- Add to the config table table.insert(_config.enabled_plugins, plugin_name) print(plugin_name..' added to _config table') save_config() -- Reload the plugins return reload_plugins( ) else return 'Plugin '..plugin_name..' does not exists' end end local function disable_plugin( name, chat ) -- Check if plugins exists if not plugin_exists(name) then return 'Plugin '..name..' does not exists' end local k = plugin_enabled(name) -- Check if plugin is enabled if not k then return 'Plugin '..name..' not enabled' end -- Disable and reload table.remove(_config.enabled_plugins, k) save_config( ) return reload_plugins(true) end local function disable_plugin_on_chat(receiver, plugin) if not plugin_exists(plugin) then return "Plugin doesn't exists" end if not _config.disabled_plugin_on_chat then _config.disabled_plugin_on_chat = {} end if not _config.disabled_plugin_on_chat[receiver] then _config.disabled_plugin_on_chat[receiver] = {} end _config.disabled_plugin_on_chat[receiver][plugin] = true save_config() return 'Plugin '..plugin..' disabled on this chat' end local function reenable_plugin_on_chat(receiver, plugin) if not _config.disabled_plugin_on_chat then return 'There aren\'t any disabled plugins' end if not _config.disabled_plugin_on_chat[receiver] then return 'There aren\'t any disabled plugins for this chat' end if not _config.disabled_plugin_on_chat[receiver][plugin] then return 'This plugin is not disabled' end _config.disabled_plugin_on_chat[receiver][plugin] = false save_config() return 'Plugin '..plugin..' is enabled again' end local function run(msg, matches) -- Show the available plugins if matches[1] == '!plugins' and is_sudo(msg) then --after changed to moderator mode, set only sudo return list_all_plugins() end -- Re-enable a plugin for this chat if matches[1] == 'enable' and matches[3] == 'chat' then local receiver = get_receiver(msg) local plugin = matches[2] print("enable "..plugin..' on this chat') return reenable_plugin_on_chat(receiver, plugin) end -- Enable a plugin if matches[1] == 'enable' and is_sudo(msg) then --after changed to moderator mode, set only sudo local plugin_name = matches[2] print("enable: "..matches[2]) return enable_plugin(plugin_name) end -- Disable a plugin on a chat if matches[1] == 'disable' and matches[3] == 'chat' then local plugin = matches[2] local receiver = get_receiver(msg) print("disable "..plugin..' on this chat') return disable_plugin_on_chat(receiver, plugin) end -- Disable a plugin if matches[1] == 'disable' and is_sudo(msg) then --after changed to moderator mode, set only sudo if matches[2] == 'plugins' then return 'This plugin can\'t be disabled' end print("disable: "..matches[2]) return disable_plugin(matches[2]) end -- Reload all the plugins! if matches[1] == 'reload' and is_sudo(msg) then --after changed to moderator mode, set only sudo return reload_plugins(true) end end return { description = "Plugin to manage other plugins. Enable, disable or reload.", usage = { moderator = { "!plug - [plugin] gp : disable plugin only this chat.", "!plug + [plugin] gp : enable plugin only this chat.", }, sudo = { "!plug * : list all plugins.", "!plug + [plugin] : enable plugin.", "!plug - [plugin] : disable plugin.", "!plug > : reloads all plugins." }, }, patterns = { "^!plug *$", "^!plug? (+) ([%w_%.%-]+)$", "^!plug? (-) ([%w_%.%-]+)$", "^!plug? (+) ([%w_%.%-]+) (chat)", "^!plug? (-) ([%w_%.%-]+) (chat)", "^!plug? (>)$" }, run = run, moderated = true, -- set to moderator mode --privileged = true } end
gpl-2.0
Andrettin/Wyrmsun
scripts/civilizations/frankish/icons.lua
1
6178
-- _________ __ __ -- / _____// |_____________ _/ |______ ____ __ __ ______ -- \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ -- / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ -- /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > -- \/ \/ \//_____/ \/ -- ______________________ ______________________ -- T H E W A R B E G I N S -- Stratagus - A free fantasy real time strategy game engine -- -- (c) Copyright 2016-2022 by Andrettin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- DefineIcon({ Name = "icon-frank-swordsman-blond-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_swordsman_blond_hair.png" }) DefineIcon({ Name = "icon-frank-swordsman-brown-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_swordsman_brown_hair.png" }) DefineIcon({ Name = "icon-frank-swordsman-gray-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_swordsman_gray_hair.png" }) DefineIcon({ Name = "icon-frank-swordsman-red-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_swordsman_red_hair.png" }) DefineIcon({ Name = "icon-frank-veteran-swordsman-blond-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_veteran_swordsman_blond_hair.png" }) DefineIcon({ Name = "icon-frank-veteran-swordsman-brown-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_veteran_swordsman_brown_hair.png" }) DefineIcon({ Name = "icon-frank-veteran-swordsman-gray-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_veteran_swordsman_gray_hair.png" }) DefineIcon({ Name = "icon-frank-veteran-swordsman-red-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_veteran_swordsman_red_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-swordsman-blond-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_swordsman_blond_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-swordsman-brown-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_swordsman_brown_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-swordsman-gray-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_swordsman_gray_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-swordsman-red-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_swordsman_red_hair.png" }) DefineIcon({ Name = "icon-frank-horseman", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_horseman_brown_hair.png" }) DefineIcon({ Name = "icon-frank-horseman-black-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_horseman_black_hair.png" }) DefineIcon({ Name = "icon-frank-horseman-blond-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_horseman_blond_hair.png" }) DefineIcon({ Name = "icon-frank-horseman-gray-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_horseman_gray_hair.png" }) DefineIcon({ Name = "icon-frank-horseman-red-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_horseman_red_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-horseman", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_horseman_brown_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-horseman-black-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_horseman_black_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-horseman-blond-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_horseman_blond_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-horseman-gray-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_horseman_gray_hair.png" }) DefineIcon({ Name = "icon-frank-heroic-horseman-red-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frank_heroic_horseman_red_hair.png" }) DefineIcon({ Name = "icon-frank-scara-black-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/scara_black_hair.png" }) DefineIcon({ Name = "icon-frank-scara-blond-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/scara_blond_hair.png" }) DefineIcon({ Name = "icon-frank-scara-brown-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/scara_brown_hair.png" }) DefineIcon({ Name = "icon-frank-scara-gray-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/scara_gray_hair.png" }) DefineIcon({ Name = "icon-frank-scara-red-hair", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/scara_red_hair.png" }) DefineIcon({ Name = "icon-frankish-cleric", Size = {46, 38}, File = "frankish/icons/cleric.png" }) DefineIcon({ Name = "icon-frankish-spatha", Size = {46, 38}, File = "dlcs/frankish_faction_flair/graphics/icons/frankish_spatha.png" }) DefineIcon({ Name = "icon-sigibert", Size = {46, 38}, File = "frankish/icons/sigibert.png" })
gpl-2.0
mkwia/jc2atc
scripts/fuel/client/finite_fuel_vehicle.lua
1
1466
class "FiniteFuelVehicle" function FiniteFuelVehicle:__init(vehicle, fuel) self.vehicle = vehicle self.vehicleGasType = self:VehicleGasType() self.fuel = fuel self.tankSize = self:TankSize() local x = nil if self.fuel == nil then x = math.random(100) end if x ~= nil then if x >= 75 then self.fuel = math.random(self.tankSize / 2, self.tankSize) end if x < 75 then self.fuel = math.random(self.tankSize / 8, self.tankSize / 2) end end if self.fuel == "buy" then self.fuel = self.tankSize end local drainage = self:DrainRate(vehicle) local vehicleMass = self.vehicle:GetMass() self.drainRate = self.tankSize * 2 * drainage.accelerate self.idleDrainRate = self.tankSize * 2 * drainage.idle end function FiniteFuelVehicle:VehicleGasType() if not IsValid(self.vehicle) then return FiniteFuelGasTypes.Car end local vehicleGasType = FiniteFuelVehicles[self.vehicle:GetModelId()] if vehicleGasType == nil then return FiniteFuelGasTypes.Car else return vehicleGasType end end function FiniteFuelVehicle:DrainRate() if not IsValid(self.vehicle) then return 1 end local drainage = FiniteFuelDrainageFormulas[self.vehicleGasType] if drainage == nil then return {idle = 0, accelerate = 0} else return drainage end end function FiniteFuelVehicle:TankSize() if not IsValid(self.vehicle) then return 0 end return tonumber(Vehicle.GetMassByModelId(self.vehicle:GetModelId())) / tonumber(FiniteFuelTankSizeFormulas[self.vehicleGasType]) end
mit
m13790115/mahdi
plugins/google.lua
336
1323
do local function googlethat(query) local url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&safe=active&&rsz=5&' local parameters = 'q='..(URL.escape(query) or '') -- Do the request local res, code = https.request(url..parameters) if code ~=200 then return nil end local data = json:decode(res) local results = {} for key,result in ipairs(data.responseData.results) do table.insert(results, { result.titleNoFormatting, result.unescapedUrl or result.url }) end return results end local function stringlinks(results) local stringresults='' i = 0 for key,val in ipairs(results) do i = i+1 stringresults=stringresults..i..'. '..val[1]..'\n'..val[2]..'\n' end return stringresults end local function run(msg, matches) -- comment this line if you want this plugin works in private message. if not is_chat_msg(msg) then return nil end local results = googlethat(matches[1]) return stringlinks(results) end return { description = 'Returns five results from Google. Safe search is enabled by default.', usage = ' !google [terms]: Searches Google and send results', patterns = { '^!google (.*)$', '^%.[g|G]oogle (.*)$' }, run = run } end
gpl-2.0
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/PhysicsJointGear.lua
1
1786
-------------------------------- -- @module PhysicsJointGear -- @extend PhysicsJoint -- @parent_module cc -------------------------------- -- Set the ratio. -- @function [parent=#PhysicsJointGear] setRatio -- @param self -- @param #float ratchet -- @return PhysicsJointGear#PhysicsJointGear self (return value: cc.PhysicsJointGear) -------------------------------- -- Get the angular offset of the two bodies. -- @function [parent=#PhysicsJointGear] getPhase -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Set the angular offset of the two bodies. -- @function [parent=#PhysicsJointGear] setPhase -- @param self -- @param #float phase -- @return PhysicsJointGear#PhysicsJointGear self (return value: cc.PhysicsJointGear) -------------------------------- -- -- @function [parent=#PhysicsJointGear] createConstraints -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- Get the ratio. -- @function [parent=#PhysicsJointGear] getRatio -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Create a gear joint.<br> -- param a A is the body to connect.<br> -- param b B is the body to connect.<br> -- param phase Phase is the initial angular offset of the two bodies.<br> -- param ratio Ratio is always measured in absolute terms.<br> -- return A object pointer. -- @function [parent=#PhysicsJointGear] construct -- @param self -- @param #cc.PhysicsBody a -- @param #cc.PhysicsBody b -- @param #float phase -- @param #float ratio -- @return PhysicsJointGear#PhysicsJointGear ret (return value: cc.PhysicsJointGear) return nil
apache-2.0
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/EaseElasticIn.lua
1
1041
-------------------------------- -- @module EaseElasticIn -- @extend EaseElastic -- @parent_module cc -------------------------------- -- @overload self, cc.ActionInterval -- @overload self, cc.ActionInterval, float -- @function [parent=#EaseElasticIn] create -- @param self -- @param #cc.ActionInterval action -- @param #float period -- @return EaseElasticIn#EaseElasticIn ret (return value: cc.EaseElasticIn) -------------------------------- -- -- @function [parent=#EaseElasticIn] clone -- @param self -- @return EaseElasticIn#EaseElasticIn ret (return value: cc.EaseElasticIn) -------------------------------- -- -- @function [parent=#EaseElasticIn] update -- @param self -- @param #float time -- @return EaseElasticIn#EaseElasticIn self (return value: cc.EaseElasticIn) -------------------------------- -- -- @function [parent=#EaseElasticIn] reverse -- @param self -- @return EaseElastic#EaseElastic ret (return value: cc.EaseElastic) return nil
apache-2.0
wincent/wincent
aspects/nvim/files/.config/nvim/lua/wincent/snippets/common/typescript.lua
1
1590
local luasnip = require('luasnip') local fmt = require('luasnip.extras.fmt').fmt local docblock = require('wincent.snippets.common.docblock') local d = luasnip.dynamic_node local i = luasnip.insert_node local s = luasnip.snippet local sn = luasnip.snippet_node -- Snippets common to JS and TS. local snippets = { -- TODO: make these smart about whether to use trailing semi or -- not, based on directory (or maybe .editorconfig) s( { trig = 'import', dscr = 'import statement' }, fmt("import {} from '{}{}';", { i(1, 'name'), i(2), d(3, function(nodes) local text = nodes[1][1] local _, _, typish, target = text:find('^%s*(%a*)%s*{?%s*(%a+).*}?%s*$') if typish == 'type' and target then return sn(1, { i(1, target) }) elseif typish and target then return sn(1, { i(1, typish .. target) }) else return sn(1, { i(1, 'specifier') }) end end, { 1 }), }) ), s({ trig = 'log', dscr = 'console.log' }, fmt('console.log({});', { i(1, 'value') })), s( { trig = 'require', dscr = 'require statement' }, fmt("const {} = require('{}{}');", { i(1, 'name'), i(2), d(3, function(nodes) local text = nodes[1][1] return sn(1, { i(1, text) }) end, { 1 }), }) ), } -- Can't use `vim.tbl_flatten` to concat `docblock` and these snippets; it will -- silently fail, producing an empty list. 🤦 Seems to only work for primitive -- values. for _, value in ipairs(docblock) do table.insert(snippets, value) end return snippets
unlicense
JarnoVgr/ZombieSurvival
gamemodes/zombiesurvival/entities/entities/status_chemzombieambience/cl_init.lua
1
1620
include("shared.lua") ENT.RenderGroup = RENDERGROUP_TRANSLUCENT ENT.NextEmit = 0 function ENT:Initialize() self:DrawShadow(false) self:SetRenderBounds(Vector(-40, -40, -18), Vector(40, 40, 90)) self.AmbientSound = CreateSound(self, "npc/zombie_poison/pz_breathe_loop1.wav") self.AmbientSound:PlayEx(0.67, 100) end function ENT:OnRemove() self.AmbientSound:Stop() end function ENT:Think() self.AmbientSound:PlayEx(0.67, 100 + math.sin(RealTime())) end local matGlow = Material("sprites/glow04_noz") local colGlow = Color(0, 255, 0, 255) function ENT:DrawTranslucent() local owner = self:GetOwner() if owner:IsValid() and (owner ~= LocalPlayer() or owner:ShouldDrawLocalPlayer()) then local pos = owner:LocalToWorld(owner:OBBCenter()) render.SetMaterial(matGlow) render.DrawSprite(pos, math.Rand(64, 72), math.Rand(64, 72), colGlow) if self.NextEmit <= CurTime() then self.NextEmit = CurTime() + 0.15 local emitter = ParticleEmitter(pos) emitter:SetNearClip(32, 48) local particle = emitter:Add("particle/smokestack", pos) particle:SetVelocity(owner:GetVelocity() * 0.8) particle:SetDieTime(math.Rand(1, 1.35)) particle:SetStartAlpha(220) particle:SetEndAlpha(0) particle:SetStartSize(math.Rand(30, 44)) particle:SetEndSize(20) particle:SetRoll(math.Rand(0, 360)) particle:SetRollDelta(math.Rand(-3, 3)) particle:SetGravity(Vector(0, 0, 125)) particle:SetCollide(true) particle:SetBounce(0.45) particle:SetAirResistance(12) particle:SetColor(0, 200, 0) emitter:Finish() end end end
gpl-2.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/tatooine/npcs/valarian/valarianThief.lua
1
4554
--Copyright (C) 2008 <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. valarianThief = Creature:new { objectName = "valarianThief", -- Lua Object Name creatureType = "NPC", faction = "valarian", factionPoints = 20, gender = "", speciesName = "valarian_thief", stfName = "mob/creature_names", objectCRC = 3873950036, socialGroup = "valarian", level = 10, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 990, healthMin = 810, strength = 0, constitution = 0, actionMax = 990, actionMin = 810, quickness = 0, stamina = 0, mindMax = 990, mindMin = 810, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 1, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 1, killer = 0, ferocity = 0, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 90, weaponMaxDamage = 110, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "valarianAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(valarianThief, 3873950036) -- Add to Global Table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/items/objects/weapons/pistols/cdefPistol.lua
1
2409
--Copyright (C) 2007 <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. cdefPistol = Weapon:new{ objectName = "CDEF Pistol", templateName = "object/weapon/ranged/pistol/shared_pistol_cdef.iff", objectCRC = 937103853, objectType = PISTOL, damageType = WEAPON_ENERGY, certification = "cert_pistol_cdef", attackSpeed = 1.4, minDamage = 9, maxDamage = 19 }
lgpl-3.0
xboot/xboot
examples/graphics/dragme/main.lua
2
2041
local function onMouseDown(self, e) if self:hitTestPoint(e.x, e.y) then self.touchid = -1 self.x0 = e.x self.y0 = e.y e.stop = true end end local function onMouseMove(self, e) if self.touchid == -1 then local x1, y1 = self:globalToLocal(self.x0, self.y0) local x2, y2 = self:globalToLocal(e.x, e.y) self:setX(self:getX() + x2 - x1) self:setY(self:getY() + y2 - y1) self.x0 = e.x self.y0 = e.y e.stop = true end end local function onMouseUp(self, e) if self.touchid == -1 then self.touchid = nil e.stop = true end end local function onTouchBegin(self, e) if self:hitTestPoint(e.x, e.y) then self.touchid = e.id self.x0 = e.x self.y0 = e.y e.stop = true end end local function onTouchMove(self, e) if self.touchid == e.id then local x1, y1 = self:globalToLocal(self.x0, self.y0) local x2, y2 = self:globalToLocal(e.x, e.y) self:setX(self:getX() + x2 - x1) self:setY(self:getY() + y2 - y1) self.x0 = e.x self.y0 = e.y e.stop = true end end local function onTouchEnd(self, e) if self.touchid == e.id then self.touchid = nil e.stop = true end end local sw, sh = stage:getSize() stage:addChild(DisplayImage.new(Image.new("assets/images/bg.png"):extend(sw, sh, "repeat"))) for i = 1, 5 do local image = DisplayImage.new(Image.new(100, 50) :shapeSave() :shapeSetSourceColor(Color.new("#FF000080")) :shapeRectangle(0, 0, 100, 50) :shapeFill() :shapeSetLineWidth(6) :shapeSetSourceColor(Color.new("#282828FF")) :shapeRectangle(0, 0, 100, 50) :shapeStroke() :shapeRestore() ):setPosition(math.random(0, sw - 100), math.random(0, sh - 50)) image:addEventListener("mouse-down", onMouseDown) image:addEventListener("mouse-move", onMouseMove) image:addEventListener("mouse-up", onMouseUp) image:addEventListener("touch-begin", onTouchBegin) image:addEventListener("touch-move", onTouchMove) image:addEventListener("touch-end", onTouchEnd) stage:addChild(image) end
mit
TheAnswer/FirstTest
bin/scripts/slashcommands/skills/aim.lua
1
2510
--Copyright (C) 2007 <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. --true = 1, false = 0 AimSlashCommand = { name = "aim", alternativeNames = "", animation = "", invalidStateMask = 3894804480, --frozen, swimming, glowingJedi, ridingMount, pilotingShip, shipOperations, shipGunner, invalidPostures = "5,7,8,9,10,11,12,13,14,4,", target = 2, targeType = 2, disabled = 0, maxRangeToTarget = 0, --adminLevel = 0, addToCombatQueue = 1, } AddAimSlashCommand(AimSlashCommand)
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/draft_schematic/objects.lua
54
2058
--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.
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/tangible/loot/objects.lua
54
2058
--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.
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/dathomir/creatures/caveGapingSpiderQueen.lua
1
4771
--Copyright (C) 2008 <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. caveGapingSpiderQueen = Creature:new { objectName = "caveGapingSpiderQueen", -- Lua Object Name creatureType = "ANIMAL", gender = "", speciesName = "cave_gaping_spider_queen", stfName = "mob/creature_names", objectCRC = 1435207717, socialGroup = "Nightsister", level = 46, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 12000, healthMin = 10000, strength = 0, constitution = 0, actionMax = 12000, actionMin = 10000, quickness = 0, stamina = 0, mindMax = 12000, mindMin = 10000, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 60, energy = 60, electricity = -1, stun = 0, blast = 40, heat = 25, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 1, killer = 1, ferocity = 0, aggressive = 1, invincible = 0, meleeDefense = 1, rangedDefense = 1, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 345, weaponMaxDamage = 400, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, -- Likely hood to be tamed datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 20, hideType = "", hideMax = 20, meatType = "meat_insect_dathomir", meatMax = 40, --skills = { " Knockdown attack", " Disease attack (poison)", "" } skills = { "gapingSpiderAttack6", "gapingSpiderAttack4" }, respawnTimer = 60, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(caveGapingSpiderQueen, 1435207717) -- Add to Global Table
lgpl-3.0
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/Menu.lua
1
2751
-------------------------------- -- @module Menu -- @extend Layer -- @parent_module cc -------------------------------- -- Set whether the menu is visible.<br> -- The default value is true, a menu is default to visible.<br> -- param value true if menu is enable, false if menu is disable. -- @function [parent=#Menu] setEnabled -- @param self -- @param #bool value -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- Align items vertically. -- @function [parent=#Menu] alignItemsVertically -- @param self -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- Determines if the menu is enable.<br> -- see `setEnabled(bool)`.<br> -- return whether the menu is enabled or not. -- @function [parent=#Menu] isEnabled -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- Align items horizontally. -- @function [parent=#Menu] alignItemsHorizontally -- @param self -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- Align items horizontally with padding.<br> -- since v0.7.2 -- @function [parent=#Menu] alignItemsHorizontallyWithPadding -- @param self -- @param #float padding -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- Align items vertically with padding.<br> -- since v0.7.2 -- @function [parent=#Menu] alignItemsVerticallyWithPadding -- @param self -- @param #float padding -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- @overload self, cc.Node, int -- @overload self, cc.Node -- @overload self, cc.Node, int, int -- @overload self, cc.Node, int, string -- @function [parent=#Menu] addChild -- @param self -- @param #cc.Node child -- @param #int zOrder -- @param #string name -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- -- @function [parent=#Menu] getDescription -- @param self -- @return string#string ret (return value: string) -------------------------------- -- -- @function [parent=#Menu] removeChild -- @param self -- @param #cc.Node child -- @param #bool cleanup -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- -- @function [parent=#Menu] setOpacityModifyRGB -- @param self -- @param #bool bValue -- @return Menu#Menu self (return value: cc.Menu) -------------------------------- -- -- @function [parent=#Menu] isOpacityModifyRGB -- @param self -- @return bool#bool ret (return value: bool) return nil
apache-2.0
Hammerspoon/hammerspoon
extensions/application/application.lua
2
24333
--- === hs.application === --- --- Manipulate running applications local application = require("hs.libapplication") application.watcher = require("hs.libapplicationwatcher") local timer = require "hs.timer" local settings = require "hs.settings" local USERDATA_TAG = "hs.application" local objectMT = hs.getObjectMetatable(USERDATA_TAG) local alternateNameMap = {} local spotlightEnabled = settings.get("HSenableSpotlightForNameSearches") -- internal search tool for alternate names local realNameFor = function(value, exact) if type(value) ~= "string" then error('hint must be a string', 2) end if not exact then local results = {} for k, v in pairs(alternateNameMap) do if k:lower():find(value:lower()) then -- I can foresee someday wanting to know how often a match was found, so make it a -- number rather than a boolean so I can cut & paste this results[v] = (results[v] or 0) + 1 end end local returnedResults = {} for k,_ in pairs(results) do table.insert(returnedResults, k:match("^(.*)%.app$") or k) end return table.unpack(returnedResults) else local realName = alternateNameMap[value] -- hs.application functions/methods do not like the .app at the end of application -- bundles, so remove it. return realName and realName:match("^(.*)%.app$") or realName end end local type,pairs,ipairs=type,pairs,ipairs local tunpack,tpack,tsort=table.unpack,table.pack,table.sort --- hs.application:visibleWindows() -> win[] --- Method --- Returns only the app's windows that are visible. --- --- Parameters: --- * None --- --- Returns: --- * A table containing zero or more hs.window objects function objectMT.visibleWindows(self) local r={} if self:isHidden() then return r -- do not check :isHidden for every window else for _,w in ipairs(self:allWindows()) do if not w:isMinimized() then r[#r+1]=w end end end return r end --- hs.application:activate([allWindows]) -> bool --- Method --- Tries to activate the app (make its key window focused) and returns whether it succeeded; if allWindows is true, all windows of the application are brought forward as well. --- --- Parameters: --- * allWindows - If true, all windows of the application will be brought to the front. Otherwise, only the application's key window will. Defaults to false. --- --- Returns: --- * A boolean value indicating whether or not the application could be activated function objectMT.activate(self, allWindows) allWindows=allWindows and true or false if self:isUnresponsive() then return false end local win = self:focusedWindow() if win then return win:becomeMain() and self:_bringtofront(allWindows) else return self:_activate(allWindows) end end --- hs.application:name() --- Method --- Alias for [`hs.application:title()`](#title) objectMT.name=objectMT.title --- hs.application.get(hint) -> hs.application object --- Constructor --- Gets a running application --- --- Parameters: --- * hint - search criterion for the desired application; it can be: --- - a pid number as per `hs.application:pid()` --- - a bundle ID string as per `hs.application:bundleID()` --- - an application name string as per `hs.application:name()` --- --- Returns: --- * an hs.application object for a running application that matches the supplied search criterion, or `nil` if not found --- --- Notes: --- * see also `hs.application.find` function application.get(hint) return tpack(application.find(hint,false),nil)[1] -- just to be sure, discard extra results end --- hs.application.find(hint) -> hs.application object(s) --- Constructor --- Finds running applications --- --- Parameters: --- * hint - search criterion for the desired application(s); it can be: --- - a pid number as per `hs.application:pid()` --- - a bundle ID string as per `hs.application:bundleID()` --- - a string pattern that matches (via `string.find`) the application name as per `hs.application:name()` (for convenience, the matching will be done on lowercased strings) --- - a string pattern that matches (via `string.find`) the application's window title per `hs.window:title()` (for convenience, the matching will be done on lowercased strings) --- --- Returns: --- * one or more hs.application objects for running applications that match the supplied search criterion, or `nil` if none found --- --- Notes: --- * If multiple results are found, this function will return multiple values. See [https://www.lua.org/pil/5.1.html](https://www.lua.org/pil/5.1.html) for more information on how to work with this --- * for convenience you can call this as `hs.application(hint)` --- * use this function when you don't know the exact name of an application you're interested in, i.e. --- from the console: `hs.application'term' --> hs.application: iTerm2 (0x61000025fb88) hs.application: Terminal (0x618000447588)`. --- But be careful when using it in your `init.lua`: `terminal=hs.application'term'` will assign either "Terminal" or "iTerm2" arbitrarily (or even, --- if neither are running, any other app with a window that happens to have "term" in its title); to make sure you get the right app in your scripts, --- use `hs.application.get` with the exact name: `terminal=hs.application.get'Terminal' --> "Terminal" app, or nil if it's not running` --- --- Usage: --- -- by pid --- hs.application(42):name() --> Finder --- -- by bundle id --- hs.application'com.apple.Safari':name() --> Safari --- -- by name --- hs.application'chrome':name() --> Google Chrome --- -- by window title --- hs.application'bash':name() --> Terminal local findSpotlightWarningGiven = false function application.find(hint,exact) if hint==nil then return end local typ=type(hint) if typ=='number' then return application.applicationForPID(hint) elseif typ~='string' then error('hint must be a number or string',2) end local r=application.applicationsForBundleID(hint) if #r>0 then return tunpack(r) end local apps=application.runningApplications() if exact then for _,a in ipairs(apps) do if a:name()==hint then r[#r+1]=a end end else for _,a in ipairs(apps) do local aname=a:name() if aname and aname:lower():find(hint:lower()) then r[#r+1]=a end end end if spotlightEnabled then for _, v in ipairs(table.pack(realNameFor(hint, exact))) do for _, a in ipairs(apps) do if a:name() ~= nil and v:lower() == a:name():lower() then r[#r+1]=a end end end elseif type(spotlightEnabled) == "nil" and not findSpotlightWarningGiven then findSpotlightWarningGiven = true print("-- Some applications have alternate names which can also be checked if you enable Spotlight support with `hs.application.enableSpotlightForNameSearches(true)`.") end tsort(r,function(a,b)return a:kind()>b:kind()end) -- gui apps first if exact or #r>0 then return tunpack(r) end r=tpack(hs.window.find(hint)) local rs={} for _,w in ipairs(r) do rs[w:application()]=true end -- :toSet for a in pairs(rs) do r[#r+1]=a end -- and back, no dupes if #r>0 then return tunpack(r) end end --- hs.application:findWindow(titlePattern) -> hs.window object(s) --- Method --- Finds windows from this application --- --- Parameters: --- * titlePattern - a string pattern that matches (via `string.find`) the window title(s) as per `hs.window:title()` (for convenience, the matching will be done on lowercased strings) --- --- Returns: --- * one or more hs.window objects belonging to this application that match the supplied search criterion, or `nil` if none found function objectMT.findWindow(self, hint) return hs.window.find(hint,false,self:allWindows()) end --- hs.application:getWindow(title) -> hs.window object --- Method --- Gets a specific window from this application --- --- Parameters: --- * title - the desired window's title string as per `hs.window:title()` --- --- Returns: --- * the desired hs.window object belonging to this application, or `nil` if not found function objectMT.getWindow(self, hint) return tpack(hs.window.find(hint,true,self:allWindows()),nil)[1] end --- hs.application.open(app[, wait, [waitForFirstWindow]]) -> hs.application object --- Constructor --- Launches an application, or activates it if it's already running --- --- Parameters: --- * app - a string describing the application to open; it can be: --- - the application's name as per `hs.application:name()` --- - the full path to an application on disk (including the `.app` suffix) --- - the application's bundle ID as per `hs.application:bundleID()` --- * wait - (optional) the maximum number of seconds to wait for the app to be launched, if not already running; if omitted, defaults to 0; --- if the app takes longer than this to launch, this function will return `nil`, but the app will still launch --- * waitForFirstWindow - (optional) if `true`, additionally wait until the app has spawned its first window (which usually takes a bit longer) --- --- Returns: --- * the `hs.application` object for the launched or activated application; `nil` if not found --- --- Notes: --- * the `wait` parameter will *block all Hammerspoon activity* in order to return the application object "synchronously"; only use it if you --- a) have no time-critical event processing happening elsewhere in your `init.lua` and b) need to act on the application object, or on --- its window(s), right away --- * when launching a "windowless" app (background daemon, menulet, etc.) make sure to omit `waitForFirstWindow` function application.open(app,wait,waitForWindow) if type(app)~='string' then error('app must be a string',2) end if wait and type(wait)~='number' then error('wait must be a number',2) end local r=application.launchOrFocus(app) or application.launchOrFocusByBundleID(app) if not r then return end r=nil wait=(wait or 0)*1000000 local CHECK_INTERVAL=100000 repeat r=r or application.get(app) if r and (not waitForWindow or r:mainWindow()) then return r end timer.usleep(math.min(wait,CHECK_INTERVAL)) wait=wait-CHECK_INTERVAL until wait<=0 return r end --- hs.application.menuGlyphs --- Variable --- A table containing UTF8 representations of the defined key glyphs used in Menus for keybaord shortcuts which are presented pictorially rather than as text (arrow keys, return key, etc.) --- --- These glyphs are indexed numerically where the numeric index matches a possible value for the AXMenuItemCmdGlyph key of an entry returned by `hs.application.getMenus`. If the AXMenuItemCmdGlyph field is non-numeric, then no glyph is used in the presentation of the keyboard shortcut for a menu item. --- --- The following glyphs are defined: --- * "⇥", -- kMenuTabRightGlyph, 0x02, Tab to the right key (for left-to-right script systems) --- * "⇤", -- kMenuTabLeftGlyph, 0x03, Tab to the left key (for right-to-left script systems) --- * "⌤", -- kMenuEnterGlyph, 0x04, Enter key --- * "⇧", -- kMenuShiftGlyph, 0x05, Shift key --- * "⌃", -- kMenuControlGlyph, 0x06, Control key --- * "⌥", -- kMenuOptionGlyph, 0x07, Option key --- * "␣", -- kMenuSpaceGlyph, 0x09, Space (always glyph 3) key --- * "⌦", -- kMenuDeleteRightGlyph, 0x0A, Delete to the right key (for right-to-left script systems) --- * "↩", -- kMenuReturnGlyph, 0x0B, Return key (for left-to-right script systems) --- * "↪", -- kMenuReturnR2LGlyph, 0x0C, Return key (for right-to-left script systems) --- * "", -- kMenuPencilGlyph, 0x0F, Pencil key --- * "↓", -- kMenuDownwardArrowDashedGlyph, 0x10, Downward dashed arrow key --- * "⌘", -- kMenuCommandGlyph, 0x11, Command key --- * "✓", -- kMenuCheckmarkGlyph, 0x12, Checkmark key --- * "⃟", -- kMenuDiamondGlyph, 0x13, Diamond key --- * "", -- kMenuAppleLogoFilledGlyph, 0x14, Apple logo key (filled) --- * "⌫", -- kMenuDeleteLeftGlyph, 0x17, Delete to the left key (for left-to-right script systems) --- * "←", -- kMenuLeftArrowDashedGlyph, 0x18, Leftward dashed arrow key --- * "↑", -- kMenuUpArrowDashedGlyph, 0x19, Upward dashed arrow key --- * "→", -- kMenuRightArrowDashedGlyph, 0x1A, Rightward dashed arrow key --- * "⎋", -- kMenuEscapeGlyph, 0x1B, Escape key --- * "⌧", -- kMenuClearGlyph, 0x1C, Clear key --- * "『", -- kMenuLeftDoubleQuotesJapaneseGlyph, 0x1D, Unassigned (left double quotes in Japanese) --- * "』", -- kMenuRightDoubleQuotesJapaneseGlyph, 0x1E, Unassigned (right double quotes in Japanese) --- * "␢", -- kMenuBlankGlyph, 0x61, Blank key --- * "⇞", -- kMenuPageUpGlyph, 0x62, Page up key --- * "⇪", -- kMenuCapsLockGlyph, 0x63, Caps lock key --- * "←", -- kMenuLeftArrowGlyph, 0x64, Left arrow key --- * "→", -- kMenuRightArrowGlyph, 0x65, Right arrow key --- * "↖", -- kMenuNorthwestArrowGlyph, 0x66, Northwest arrow key --- * "﹖", -- kMenuHelpGlyph, 0x67, Help key --- * "↑", -- kMenuUpArrowGlyph, 0x68, Up arrow key --- * "↘", -- kMenuSoutheastArrowGlyph, 0x69, Southeast arrow key --- * "↓", -- kMenuDownArrowGlyph, 0x6A, Down arrow key --- * "⇟", -- kMenuPageDownGlyph, 0x6B, Page down key --- * "", -- kMenuContextualMenuGlyph, 0x6D, Contextual menu key --- * "⌽", -- kMenuPowerGlyph, 0x6E, Power key --- * "F1", -- kMenuF1Glyph, 0x6F, F1 key --- * "F2", -- kMenuF2Glyph, 0x70, F2 key --- * "F3", -- kMenuF3Glyph, 0x71, F3 key --- * "F4", -- kMenuF4Glyph, 0x72, F4 key --- * "F5", -- kMenuF5Glyph, 0x73, F5 key --- * "F6", -- kMenuF6Glyph, 0x74, F6 key --- * "F7", -- kMenuF7Glyph, 0x75, F7 key --- * "F8", -- kMenuF8Glyph, 0x76, F8 key --- * "F9", -- kMenuF9Glyph, 0x77, F9 key --- * "F10", -- kMenuF10Glyph, 0x78, F10 key --- * "F11", -- kMenuF11Glyph, 0x79, F11 key --- * "F12", -- kMenuF12Glyph, 0x7A, F12 key --- * "F13", -- kMenuF13Glyph, 0x87, F13 key --- * "F14", -- kMenuF14Glyph, 0x88, F14 key --- * "F15", -- kMenuF15Glyph, 0x89, F15 key --- * "⎈", -- kMenuControlISOGlyph, 0x8A, Control key (ISO standard) --- * "⏏", -- kMenuEjectGlyph, 0x8C, Eject key (available on Mac OS X 10.2 and later) --- * "英数", -- kMenuEisuGlyph, 0x8D, Japanese eisu key (available in Mac OS X 10.4 and later) --- * "かな", -- kMenuKanaGlyph, 0x8E, Japanese kana key (available in Mac OS X 10.4 and later) --- * "F16", -- kMenuF16Glyph, 0x8F, F16 key (available in SnowLeopard and later) --- * "F17", -- kMenuF16Glyph, 0x90, F17 key (available in SnowLeopard and later) --- * "F18", -- kMenuF16Glyph, 0x91, F18 key (available in SnowLeopard and later) --- * "F19", -- kMenuF16Glyph, 0x92, F19 key (available in SnowLeopard and later) --- --- Notes: --- * a `__tostring` metamethod is provided for this table so you can view its current contents by typing `hs.application.menuGlyphs` into the Hammerspoon console. --- * This table is provided as a variable so that you can change any representation if you feel you know of a better or more appropriate one for you usage at runtime. --- --- * The glyphs provided are defined in the Carbon framework headers in the Menus.h file, located (as of 10.11) at /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Menus.h. --- * The following constants are defined in Menus.h, but do not seem to correspond to a visible UTF8 character or well defined representation that I could discover. If you believe that you know of a (preferably sanctioned by Apple) proper visual representation, please submit an issue detailing it at the Hammerspoon repository on Github. --- * kMenuNullGlyph, 0x00, Null (always glyph 1) --- * kMenuNonmarkingReturnGlyph, 0x0D, Nonmarking return key --- * kMenuParagraphKoreanGlyph, 0x15, Unassigned (paragraph in Korean) --- * kMenuTrademarkJapaneseGlyph, 0x1F, Unassigned (trademark in Japanese) --- * kMenuAppleLogoOutlineGlyph, 0x6C, Apple logo key (outline) application.menuGlyphs = setmetatable({ [2] = "⇥", -- kMenuTabRightGlyph, 0x02, Tab to the right key (for left-to-right script systems) [3] = "⇤", -- kMenuTabLeftGlyph, 0x03, Tab to the left key (for right-to-left script systems) [4] = "⌤", -- kMenuEnterGlyph, 0x04, Enter key [5] = "⇧", -- kMenuShiftGlyph, 0x05, Shift key [6] = "⌃", -- kMenuControlGlyph, 0x06, Control key [7] = "⌥", -- kMenuOptionGlyph, 0x07, Option key [9] = "␣", -- kMenuSpaceGlyph, 0x09, Space (always glyph 3) key [10] = "⌦", -- kMenuDeleteRightGlyph, 0x0A, Delete to the right key (for right-to-left script systems) [11] = "↩", -- kMenuReturnGlyph, 0x0B, Return key (for left-to-right script systems) [12] = "↪", -- kMenuReturnR2LGlyph, 0x0C, Return key (for right-to-left script systems) [15] = "", -- kMenuPencilGlyph, 0x0F, Pencil key [16] = "↓", -- kMenuDownwardArrowDashedGlyph, 0x10, Downward dashed arrow key [17] = "⌘", -- kMenuCommandGlyph, 0x11, Command key [18] = "✓", -- kMenuCheckmarkGlyph, 0x12, Checkmark key [19] = "◇", -- kMenuDiamondGlyph, 0x13, Diamond key [20] = "", -- kMenuAppleLogoFilledGlyph, 0x14, Apple logo key (filled) [23] = "⌫", -- kMenuDeleteLeftGlyph, 0x17, Delete to the left key (for left-to-right script systems) [24] = "←", -- kMenuLeftArrowDashedGlyph, 0x18, Leftward dashed arrow key [25] = "↑", -- kMenuUpArrowDashedGlyph, 0x19, Upward dashed arrow key [26] = "→", -- kMenuRightArrowDashedGlyph, 0x1A, Rightward dashed arrow key [27] = "⎋", -- kMenuEscapeGlyph, 0x1B, Escape key [28] = "⌧", -- kMenuClearGlyph, 0x1C, Clear key [29] = "『", -- kMenuLeftDoubleQuotesJapaneseGlyph, 0x1D, Unassigned (left double quotes in Japanese) [30] = "』", -- kMenuRightDoubleQuotesJapaneseGlyph, 0x1E, Unassigned (right double quotes in Japanese) [97] = "␢", -- kMenuBlankGlyph, 0x61, Blank key [98] = "⇞", -- kMenuPageUpGlyph, 0x62, Page up key [99] = "⇪", -- kMenuCapsLockGlyph, 0x63, Caps lock key [100] = "←", -- kMenuLeftArrowGlyph, 0x64, Left arrow key [101] = "→", -- kMenuRightArrowGlyph, 0x65, Right arrow key [102] = "↖", -- kMenuNorthwestArrowGlyph, 0x66, Northwest arrow key [103] = "﹖", -- kMenuHelpGlyph, 0x67, Help key [104] = "↑", -- kMenuUpArrowGlyph, 0x68, Up arrow key [105] = "↘", -- kMenuSoutheastArrowGlyph, 0x69, Southeast arrow key [106] = "↓", -- kMenuDownArrowGlyph, 0x6A, Down arrow key [107] = "⇟", -- kMenuPageDownGlyph, 0x6B, Page down key [109] = "", -- kMenuContextualMenuGlyph, 0x6D, Contextual menu key [110] = "⌽", -- kMenuPowerGlyph, 0x6E, Power key [111] = "F1", -- kMenuF1Glyph, 0x6F, F1 key [112] = "F2", -- kMenuF2Glyph, 0x70, F2 key [113] = "F3", -- kMenuF3Glyph, 0x71, F3 key [114] = "F4", -- kMenuF4Glyph, 0x72, F4 key [115] = "F5", -- kMenuF5Glyph, 0x73, F5 key [116] = "F6", -- kMenuF6Glyph, 0x74, F6 key [117] = "F7", -- kMenuF7Glyph, 0x75, F7 key [118] = "F8", -- kMenuF8Glyph, 0x76, F8 key [119] = "F9", -- kMenuF9Glyph, 0x77, F9 key [120] = "F10", -- kMenuF10Glyph, 0x78, F10 key [121] = "F11", -- kMenuF11Glyph, 0x79, F11 key [122] = "F12", -- kMenuF12Glyph, 0x7A, F12 key [135] = "F13", -- kMenuF13Glyph, 0x87, F13 key [136] = "F14", -- kMenuF14Glyph, 0x88, F14 key [137] = "F15", -- kMenuF15Glyph, 0x89, F15 key [138] = "⎈", -- kMenuControlISOGlyph, 0x8A, Control key (ISO standard) [140] = "⏏", -- kMenuEjectGlyph, 0x8C, Eject key (available on Mac OS X 10.2 and later) [141] = "英数", -- kMenuEisuGlyph, 0x8D, Japanese eisu key (available in Mac OS X 10.4 and later) [142] = "かな", -- kMenuKanaGlyph, 0x8E, Japanese kana key (available in Mac OS X 10.4 and later) [143] = "F16", -- kMenuF16Glyph, 0x8F, F16 key (available in SnowLeopard and later) [144] = "F17", -- kMenuF16Glyph, 0x90, F17 key (available in SnowLeopard and later) [145] = "F18", -- kMenuF16Glyph, 0x91, F18 key (available in SnowLeopard and later) [146] = "F19", -- kMenuF16Glyph, 0x92, F19 key (available in SnowLeopard and later) }, { __tostring = function(self) local result = "" for k, v in require("hs.fnutils").sortByKeys(self) do result = result..string.format("%4d %s\n", k, v) end return result end, }) -- handles updates to the alternateNameMap table local modifyNameMap = function(info, add) for _, item in ipairs(info) do local applicationName = item.kMDItemFSName for _, alt in ipairs(item.kMDItemAlternateNames or {}) do alternateNameMap[alt:match("^(.*)%.app$") or alt] = add and applicationName or nil end end end -- local var to hold spotlight query userdata to catch updates local spotlightWatcher -- starts the spotlight query to get the alternate names for applications local buildAlternateNameMap = function() if spotlightWatcher then -- force a rebuild if it's already running spotlightWatcher:stop() spotlightWatcher = nil alternateNameMap = {} application._alternateNameMap = alternateNameMap end spotlightWatcher = require"hs.spotlight".new() spotlightWatcher:queryString([[ kMDItemContentType = "com.apple.application-bundle" ]]) :callbackMessages("didUpdate", "inProgress") :setCallback(function(_, _, info) if info then -- shouldn't be nil for didUpdate and inProgress, but check anyways -- all three can occur in either message, so check them all! if info.kMDQueryUpdateAddedItems then modifyNameMap(info.kMDQueryUpdateAddedItems, true) end if info.kMDQueryUpdateChangedItems then modifyNameMap(info.kMDQueryUpdateChangedItems, true) end if info.kMDQueryUpdateRemovedItems then modifyNameMap(info.kMDQueryUpdateRemovedItems, false) end end end):start() end --- hs.application.enableSpotlightForNameSearches([state]) -> boolean --- Function --- Get or set whether Spotlight should be used to find alternate names for applications. --- --- Parameters: --- * `state` - an optional boolean specifying whether or not Spotlight should be used to try and determine alternate application names for `hs.application.find` and similar functions. --- --- Returns: --- * the current, possibly changed, state --- --- Notes: --- * This setting is persistent across reloading and restarting Hammerspoon. --- * If this was set to true and you set it to true again, it will purge the alternate name map and rebuild it from scratch. --- * You can disable Spotlight alternate name mapping by setting this value to false or nil. If you set this to false, then the notifications indicating that more results might be possible if Spotlight is enabled will be suppressed. application.enableSpotlightForNameSearches = function(...) local args = table.pack(...) if args.n > 0 then if args[1] then settings.set("HSenableSpotlightForNameSearches", true) spotlightEnabled = true buildAlternateNameMap() else settings.set("HSenableSpotlightForNameSearches", args[1]) spotlightEnabled = args[1] if spotlightWatcher then spotlightWatcher:stop() spotlightWatcher = nil end alternateNameMap = {} application._alternateNameMap = alternateNameMap end end return settings.get("HSenableSpotlightForNameSearches") end -- if the setting is set, then go ahead and start the build process if spotlightEnabled then buildAlternateNameMap() end do local mt=getmetatable(application) -- whoever gets it first (window vs application) if not mt.__call then mt.__call=function(t,...) return t.find(...) end end end application._alternateNameMap = alternateNameMap return application
mit
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/tailor/casualWearIBasics/ithorianFrilledJacket.lua
1
4333
--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. ithorianFrilledJacket = Object:new { objectName = "Ithorian Frilled Jacket", stfName = "ith_jacket_s03", stfFile = "wearables_name", objectCRC = 3666328518, groupName = "craftClothingCasualGroupA", -- Group schematic is awarded in (See skills table) craftingToolTab = 8, -- (See DraftSchemticImplementation.h) complexity = 18, size = 3, xpType = "crafting_clothing_general", xp = 100, assemblySkill = "clothing_assembly", experimentingSkill = "clothing_experimentation", ingredientTemplateNames = "craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n", ingredientTitleNames = "binding_and_hardware, liner, shell", ingredientSlotType = "0, 0, 2", resourceTypes = "petrochem_inert, hide, object/tangible/component/clothing/shared_synthetic_cloth.iff", resourceQuantities = "30, 25, 1", combineTypes = "0, 0, 1", contribution = "100, 100, 100", numberExperimentalProperties = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1", experimentalProperties = "XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX", experimentalWeights = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1", experimentalGroupTitles = "null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null", experimentalSubGroupTitles = "null, null, sockets, hitpoints, mod_idx_one, mod_val_one, mod_idx_two, mod_val_two, mod_idx_three, mod_val_three, mod_idx_four, mod_val_four, mod_idx_five, mod_val_five, mod_idx_six, mod_val_six", experimentalMin = "0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", experimentalMax = "0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", experimentalPrecision = "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", tanoAttributes = "objecttype=16777227:objectcrc=1498740846:stfFile=wearables_name:stfName=ith_jacket_s03:stfDetail=:itemmask=63491::", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "", customizationDefaults = "", customizationSkill = "clothing_customization" } DraftSchematics:addDraftSchematic(ithorianFrilledJacket, 3666328518)--- Add to global DraftSchematics table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/endor/npcs/pubam/pubamScout.lua
1
4566
--Copyright (C) 2008 <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. pubamScout = Creature:new { objectName = "pubamScout", -- Lua Object Name creatureType = "NPC", faction = "pubam", factionPoints = 20, gender = "", speciesName = "pubam_scout", stfName = "mob/creature_names", objectCRC = 2350961206, socialGroup = "pubam", level = 37, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 11900, healthMin = 9700, strength = 0, constitution = 0, actionMax = 11900, actionMin = 9700, quickness = 0, stamina = 0, mindMax = 11900, mindMin = 9700, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = -1, energy = -1, electricity = -1, stun = 100, blast = 0, heat = 0, cold = 0, acid = -1, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 1, ferocity = 0, aggressive = 1, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 370, weaponMaxDamage = 450, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 2, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "pubamAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(pubamScout, 2350961206) -- Add to Global Table
lgpl-3.0
Konfess/gcode_4
Assets/Scripts/Events.lua
44
2298
--======================================================================== -- Events.lua : Defines event handler delegate functions for events -- -- Part of the GameCode4 Application -- -- GameCode4 is the sample application that encapsulates much of the source code -- discussed in "Game Coding Complete - 4th Edition" by Mike McShaffry and David -- "Rez" Graham, published by Charles River Media. -- ISBN-10: 1133776574 | ISBN-13: 978-1133776574 -- -- If this source code has found it's way to you, and you think it has helped you -- in any way, do the authors a favor and buy a new copy of the book - there are -- detailed explanations in it that compliment this code well. Buy a copy at Amazon.com -- by clicking here: -- http://www.amazon.com/gp/product/1133776574/ref=olp_product_details?ie=UTF8&me=&seller= -- -- There's a companion web site at http://www.mcshaffry.com/GameCode/ -- -- The source code is managed and maintained through Google Code: -- http://code.google.com/p/gamecode4/ -- -- (c) Copyright 2012 Michael L. McShaffry and David Graham -- -- This program is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser GPL v3 -- as published by the Free Software Foundation. -- -- 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 -- http://www.gnu.org/licenses/lgpl-3.0.txt for more details. -- -- You should have received a copy of the GNU Lesser GPL v3 -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- --======================================================================== function OnPhysicsCollision(eventData) g_actorMgr:OnPhysicsCollision(eventData); end function OnFireWeapon(eventData) g_actorMgr:OnFireWeapon(eventData); end function RegisterListeners() if (EventType.EvtData_PhysCollision ~= nil) then RegisterEventListener(EventType.EvtData_PhysCollision, OnPhysicsCollision); end if (EventType.EvtData_Fire_Weapon ~= nil) then RegisterEventListener(EventType.EvtData_Fire_Weapon, OnFireWeapon); end end
lgpl-3.0
yav/language-lua
lua-5.3.1-tests/verybig.lua
7
3671
-- $Id: verybig.lua,v 1.24 2014/12/26 17:20:53 roberto Exp $ print "testing RK" -- testing opcodes with RK arguments larger than K limit local function foo () local dummy = { -- fill first 256 entries in table of constants 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, } assert(24.5 + 0.6 == 25.1) local t = {foo = function (self, x) return x + self.x end, x = 10} t.t = t assert(t:foo(1.5) == 11.5) assert(t.t:foo(0.5) == 10.5) -- bug in 5.2 alpha assert(24.3 == 24.3) assert((function () return t.x end)() == 10) end foo() foo = nil if _soft then return 10 end print "testing large programs (>64k)" -- template to create a very big test file prog = [[$ local a,b b = {$1$ b30009 = 65534, b30010 = 65535, b30011 = 65536, b30012 = 65537, b30013 = 16777214, b30014 = 16777215, b30015 = 16777216, b30016 = 16777217, b30017 = 0x7fffff, b30018 = -0x7fffff, b30019 = 0x1ffffff, b30020 = -0x1ffffd, b30021 = -65534, b30022 = -65535, b30023 = -65536, b30024 = -0xffffff, b30025 = 15012.5, $2$ }; assert(b.a50008 == 25004 and b["a11"] == -5.5) assert(b.a33007 == -16503.5 and b.a50009 == -25004.5) assert(b["b"..30024] == -0xffffff) function b:xxx (a,b) return a+b end assert(b:xxx(10, 12) == 22) -- pushself with non-constant index b.xxx = nil s = 0; n=0 for a,b in pairs(b) do s=s+b; n=n+1 end -- with 32-bit floats, exact value of 's' depends on summation order assert(81800000.0 < s and s < 81860000 and n == 70001) a = nil; b = nil print'+' function f(x) b=x end a = f{$3$} or 10 assert(a==10) assert(b[1] == "a10" and b[2] == 5 and b[#b-1] == "a50009") function xxxx (x) return b[x] end assert(xxxx(3) == "a11") a = nil; b=nil xxxx = nil return 10 ]] -- functions to fill in the $n$ local function sig (x) return (x % 2 == 0) and '' or '-' end F = { function () -- $1$ for i=10,50009 do io.write('a', i, ' = ', sig(i), 5+((i-10)/2), ',\n') end end, function () -- $2$ for i=30026,50009 do io.write('b', i, ' = ', sig(i), 15013+((i-30026)/2), ',\n') end end, function () -- $3$ for i=10,50009 do io.write('"a', i, '", ', sig(i), 5+((i-10)/2), ',\n') end end, } file = os.tmpname() io.output(file) for s in string.gmatch(prog, "$([^$]+)") do local n = tonumber(s) if not n then io.write(s) else F[n]() end end io.close() result = dofile(file) assert(os.remove(file)) print'OK' return result
bsd-3-clause
TheAnswer/FirstTest
bin/scripts/slashcommands/skills/volleyFire.lua
1
2581
--Copyright (C) 2007 <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. --true = 1, false = 0 VolleyFireSlashCommand = { name = "volleyfire", alternativeNames = "", animation = "", invalidStateMask = 3894871073, --cover, berzerk, tumbling, immobilized, frozen, swimming, glowingJedi, ridingMount, pilotingShip, shipOperations, shipGunner, invalidPostures = "3,5,6,7,8,9,10,11,12,13,14,4,", target = 1, targeType = 1, disabled = 0, maxRangeToTarget = 0, --adminLevel = 0, addToCombatQueue = 1, } AddVolleyFireSlashCommand(VolleyFireSlashCommand)
lgpl-3.0
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/TransitionFadeTR.lua
1
1491
-------------------------------- -- @module TransitionFadeTR -- @extend TransitionScene,TransitionEaseScene -- @parent_module cc -------------------------------- -- -- @function [parent=#TransitionFadeTR] easeActionWithAction -- @param self -- @param #cc.ActionInterval action -- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval) -------------------------------- -- Returns the action that will be performed with size.<br> -- param size A given size.<br> -- return The action that will be performed. -- @function [parent=#TransitionFadeTR] actionWithSize -- @param self -- @param #size_table size -- @return ActionInterval#ActionInterval ret (return value: cc.ActionInterval) -------------------------------- -- Creates a transition with duration and incoming scene.<br> -- param t Duration time, in seconds.<br> -- param scene A given scene.<br> -- return A autoreleased TransitionFadeTR object. -- @function [parent=#TransitionFadeTR] create -- @param self -- @param #float t -- @param #cc.Scene scene -- @return TransitionFadeTR#TransitionFadeTR ret (return value: cc.TransitionFadeTR) -------------------------------- -- -- @function [parent=#TransitionFadeTR] draw -- @param self -- @param #cc.Renderer renderer -- @param #mat4_table transform -- @param #unsigned int flags -- @return TransitionFadeTR#TransitionFadeTR self (return value: cc.TransitionFadeTR) return nil
apache-2.0
TheAnswer/FirstTest
bin/scripts/object/tangible/ship/components/weapon/objects.lua
1
202993
--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_components_weapon_shared_weapon_incom_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/xwing_weapon_neg_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_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, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_weapon_incom_disruptor, 1416211325) object_tangible_ship_components_weapon_shared_weapon_slayn_ioncannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/xwing_weapon_neg_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_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, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_weapon_slayn_ioncannon, 3090870041) object_tangible_ship_components_weapon_shared_weapon_subpro_tripleblaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/xwing_weapon1_neg_s04.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_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, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_weapon_subpro_tripleblaster, 1718453703) object_tangible_ship_components_weapon_shared_weapon_test = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/cmp_xwing_gun_neg_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_01_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_01_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_weapon_test, 583355334) object_tangible_ship_components_weapon_shared_wpn_armek_advanced = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_armek_advanced_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_armek_advanced, 3432873939) object_tangible_ship_components_weapon_shared_wpn_armek_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_armek_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_armek_elite, 2927442761) object_tangible_ship_components_weapon_shared_wpn_armek_sw4 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_armek_sw4_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_armek_sw4, 3078564587) object_tangible_ship_components_weapon_shared_wpn_armek_sw6 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_armek_sw6_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_armek_sw6, 627434993) object_tangible_ship_components_weapon_shared_wpn_armek_sw7 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_armek_sw7_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_armek_sw7, 1818788476) object_tangible_ship_components_weapon_shared_wpn_armek_sw8 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_armek_sw8_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_armek_sw8, 3596791406) object_tangible_ship_components_weapon_shared_wpn_awing_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_awing_blaster", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_awing_blaster", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_awing_blaster, 1392493131) object_tangible_ship_components_weapon_shared_wpn_borstel_rg9 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_borstel_rg9_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_borstel_rg9, 1971958873) object_tangible_ship_components_weapon_shared_wpn_bwing_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_bwing_blaster", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_bwing_blaster", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_bwing_blaster, 1787466156) object_tangible_ship_components_weapon_shared_wpn_capitalship_turret_test = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_turret", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_turret", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_capitalship_turret_test, 3311096308) object_tangible_ship_components_weapon_shared_wpn_corellian_1d = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_corellian_1d_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_corellian_1d, 2087182522) object_tangible_ship_components_weapon_shared_wpn_corellian_ag1g_laser = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_corellian_ag1g_laser_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_corellian_ag1g_laser, 3460040348) object_tangible_ship_components_weapon_shared_wpn_corellian_ag2g_quad_laser = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_corellian_ag2g_quad_laser_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_corellian_ag2g_quad_laser, 2989343947) object_tangible_ship_components_weapon_shared_wpn_corellian_cruiser_grade_blaster_mk1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_corellian_cruiser_grade_blaster_mk1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_corellian_cruiser_grade_blaster_mk1, 2213766317) object_tangible_ship_components_weapon_shared_wpn_corvette_turret_sm_s01 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_turret", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_turret", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_corvette_turret_sm_s01, 1361242261) object_tangible_ship_components_weapon_shared_wpn_cygnus_destroyer_mk1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_cygnus_destroyer_mk1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_cygnus_destroyer_mk1, 4229372390) object_tangible_ship_components_weapon_shared_wpn_cygnus_destroyer_mk2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_cygnus_destroyer_mk2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_cygnus_destroyer_mk2, 654356849) object_tangible_ship_components_weapon_shared_wpn_cygnus_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_cygnus_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_cygnus_elite, 3038804521) object_tangible_ship_components_weapon_shared_wpn_cygnus_eradicator_1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_cygnus_eradicator_1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_cygnus_eradicator_1, 526650114) object_tangible_ship_components_weapon_shared_wpn_freitek_cannoneer_mk1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_freitek_cannoneer_mk1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_freitek_cannoneer_mk1, 373679875) object_tangible_ship_components_weapon_shared_wpn_generic = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_generic", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_generic", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_generic, 1333192542) object_tangible_ship_components_weapon_shared_wpn_gyrhil_auto_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_gyrhil_auto_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_gyrhil_auto_blaster, 90081547) object_tangible_ship_components_weapon_shared_wpn_gyrhil_r9x = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_gyrhil_r9x_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_gyrhil_r9x, 1218898024) object_tangible_ship_components_weapon_shared_wpn_haor_chall_speedblaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_haor_chall_speedblaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_haor_chall_speedblaster, 762044667) object_tangible_ship_components_weapon_shared_wpn_hk_modified_scorcher_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_hk_modified_scorcher_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_hk_modified_scorcher_elite, 2957562610) object_tangible_ship_components_weapon_shared_wpn_hk_scorcher = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_hk_scorcher_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_hk_scorcher, 1555262455) object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_hk_scorcher_2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_2, 2715164541) object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_3 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_hk_scorcher_3_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_3, 3906697456) object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_advanced = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_hk_scorcher_advanced_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_advanced, 3110719195) object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_hk_scorcher_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_elite, 146304976) object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_heavy = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_hk_scorcher_heavy_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_hk_scorcher_heavy, 2570101673) object_tangible_ship_components_weapon_shared_wpn_incom_advanced_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_advanced_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_advanced_blaster, 939423053) object_tangible_ship_components_weapon_shared_wpn_incom_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_blaster, 3446201616) object_tangible_ship_components_weapon_shared_wpn_incom_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_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, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_disruptor, 3407371780) object_tangible_ship_components_weapon_shared_wpn_incom_elite_quad_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_elite_quad_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_elite_quad_blaster, 655771385) object_tangible_ship_components_weapon_shared_wpn_incom_heavy_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_heavy_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_heavy_blaster, 2709580640) object_tangible_ship_components_weapon_shared_wpn_incom_heavy_quad_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_heavy_quad_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_heavy_quad_blaster, 4090385282) object_tangible_ship_components_weapon_shared_wpn_incom_light_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_light_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_light_blaster, 745205415) object_tangible_ship_components_weapon_shared_wpn_incom_proton_missile_s01 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/missile_proton_torpedo_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_01_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_01_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_proton_missile_s01, 2585546139) object_tangible_ship_components_weapon_shared_wpn_incom_quad_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_quad_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_quad_blaster, 2691880126) object_tangible_ship_components_weapon_shared_wpn_incom_seismic_missile_s01 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/missile_proton_torpedo_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_01_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_01_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_seismic_missile_s01, 134787828) object_tangible_ship_components_weapon_shared_wpn_incom_shredder = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_shredder_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_shredder, 819793875) object_tangible_ship_components_weapon_shared_wpn_incom_tt13 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_tt13_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_tt13, 3885305221) object_tangible_ship_components_weapon_shared_wpn_incom_tt8 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_incom_tt8_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_incom_tt8, 4021441179) object_tangible_ship_components_weapon_shared_wpn_kdy_pounder_mk1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kdy_pounder_mk1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kdy_pounder_mk1, 667601641) object_tangible_ship_components_weapon_shared_wpn_kessel_imperial_rendili_prototype_x = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kessel_imperial_rendili_prototype_x_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kessel_imperial_rendili_prototype_x, 1429969329) object_tangible_ship_components_weapon_shared_wpn_kessel_imperial_sds_experimental_secret_ops = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kessel_imperial_sds_experimental_secret_ops_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kessel_imperial_sds_experimental_secret_ops, 3083127705) object_tangible_ship_components_weapon_shared_wpn_kessel_imperial_sfs_elite_ops = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kessel_imperial_sfs_elite_ops_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kessel_imperial_sfs_elite_ops, 4028755301) object_tangible_ship_components_weapon_shared_wpn_kessel_rebel_incom_dualcore_flashcannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kessel_rebel_incom_dualcore_flashcannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kessel_rebel_incom_dualcore_flashcannon, 2645130727) object_tangible_ship_components_weapon_shared_wpn_kessel_rebel_riiz_combine_slammer_cannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kessel_rebel_riiz_combine_slammer_cannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kessel_rebel_riiz_combine_slammer_cannon, 89824351) object_tangible_ship_components_weapon_shared_wpn_kessel_rebel_unknown_rayslinger = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kessel_rebel_unknown_rayslinger_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kessel_rebel_unknown_rayslinger, 953073966) object_tangible_ship_components_weapon_shared_wpn_koensayr_deluxe_ion_accelerator = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_koensayr_deluxe_ion_accelerator_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_koensayr_deluxe_ion_accelerator, 3911315270) object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_koensayr_ion_accelerator_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator, 2517260475) object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator_2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_koensayr_ion_accelerator_2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator_2, 3827108741) object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator_3 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_koensayr_ion_accelerator_3_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator_3, 2903534600) object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator_advanced = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_koensayr_ion_accelerator_advanced_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_koensayr_ion_accelerator_advanced, 3935855718) object_tangible_ship_components_weapon_shared_wpn_koensayr_light_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_koensayr_light_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_koensayr_light_disruptor, 2964865390) object_tangible_ship_components_weapon_shared_wpn_koensayr_tuned_light_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_koensayr_tuned_light_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_koensayr_tuned_light_disruptor, 2324723441) object_tangible_ship_components_weapon_shared_wpn_kse_double_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kse_double_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kse_double_blaster, 1309584223) object_tangible_ship_components_weapon_shared_wpn_kse_light_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_kse_light_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_kse_light_disruptor, 1496618540) object_tangible_ship_components_weapon_shared_wpn_mandal_advanced_annihilator = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_advanced_annihilator_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_advanced_annihilator, 1864468167) object_tangible_ship_components_weapon_shared_wpn_mandal_annihilator_mk2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_annihilator_mk2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_annihilator_mk2, 2171243660) object_tangible_ship_components_weapon_shared_wpn_mandal_annilhator_mk1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_annilhator_mk1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_annilhator_mk1, 3043215801) object_tangible_ship_components_weapon_shared_wpn_mandal_elite_annihilator = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_elite_annihilator_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_elite_annihilator, 1203586695) object_tangible_ship_components_weapon_shared_wpn_mandal_enhanced_mangler_mk1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_enhanced_mangler_mk1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_enhanced_mangler_mk1, 945058875) object_tangible_ship_components_weapon_shared_wpn_mandal_heavy_annihilator = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_heavy_annihilator_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_heavy_annihilator, 4039829327) object_tangible_ship_components_weapon_shared_wpn_mandal_mangler_mk1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_mangler_mk1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_mangler_mk1, 3229356354) object_tangible_ship_components_weapon_shared_wpn_mandal_qv3_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_qv3_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_qv3_disruptor, 2181339101) object_tangible_ship_components_weapon_shared_wpn_mandal_qv5_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_qv5_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_qv5_disruptor, 1168567199) object_tangible_ship_components_weapon_shared_wpn_mandal_super_mangler = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mandal_super_mangler_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mandal_super_mangler, 1966553634) object_tangible_ship_components_weapon_shared_wpn_mission_reward_imperial_cygnus_starblaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mission_reward_imperial_cygnus_starblaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mission_reward_imperial_cygnus_starblaster, 2216406766) object_tangible_ship_components_weapon_shared_wpn_mission_reward_imperial_sds_boltdriver = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mission_reward_imperial_sds_boltdriver_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mission_reward_imperial_sds_boltdriver, 1584266196) object_tangible_ship_components_weapon_shared_wpn_mission_reward_neutral_borstel_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mission_reward_neutral_borstel_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mission_reward_neutral_borstel_disruptor, 1515757719) object_tangible_ship_components_weapon_shared_wpn_mission_reward_neutral_hk_military_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mission_reward_neutral_hk_military_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mission_reward_neutral_hk_military_blaster, 2865416858) object_tangible_ship_components_weapon_shared_wpn_mission_reward_neutral_mandal_light_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mission_reward_neutral_mandal_light_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mission_reward_neutral_mandal_light_blaster, 4071002762) object_tangible_ship_components_weapon_shared_wpn_mission_reward_rebel_incom_tricannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mission_reward_rebel_incom_tricannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mission_reward_rebel_incom_tricannon, 3498715160) object_tangible_ship_components_weapon_shared_wpn_mission_reward_rebel_taim_ion_driver = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_mission_reward_rebel_taim_ion_driver_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_mission_reward_rebel_taim_ion_driver, 219326346) object_tangible_ship_components_weapon_shared_wpn_moncal_light_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_moncal_light_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_moncal_light_blaster, 3697933765) object_tangible_ship_components_weapon_shared_wpn_prototype_weapon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_prototype", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_prototype_weapon, 1904433726) object_tangible_ship_components_weapon_shared_wpn_prototype_weapon_tie = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_prototype", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_prototype_weapon_tie, 1097828961) object_tangible_ship_components_weapon_shared_wpn_rendili_advanced = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_rendili_advanced_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_rendili_advanced, 1966255607) object_tangible_ship_components_weapon_shared_wpn_rendili_fr13_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_rendili_fr13_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_rendili_fr13_disruptor, 459008853) object_tangible_ship_components_weapon_shared_wpn_rendili_fr9_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_rendili_fr9_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_rendili_fr9_disruptor, 100362336) object_tangible_ship_components_weapon_shared_wpn_rendili_sc3_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_rendili_sc3_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_rendili_sc3_disruptor, 2784983723) object_tangible_ship_components_weapon_shared_wpn_rendili_sc8_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_rendili_sc8_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_rendili_sc8_disruptor, 886506152) object_tangible_ship_components_weapon_shared_wpn_reward_incom_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_reward", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_reward_incom_elite", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_reward_incom_elite, 983721375) object_tangible_ship_components_weapon_shared_wpn_reward_seinar_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_reward", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_reward_seinar_elite", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_reward_seinar_elite, 3491884496) object_tangible_ship_components_weapon_shared_wpn_reward_slayn_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_reward", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_reward_slayn_elite", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_reward_slayn_elite, 2898046675) object_tangible_ship_components_weapon_shared_wpn_reward_subpro_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_reward", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_reward_subpro_elite", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_reward_subpro_elite, 1280281292) object_tangible_ship_components_weapon_shared_wpn_reward_taim_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_reward", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_reward_taim_elite", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_reward_taim_elite, 2885961571) object_tangible_ship_components_weapon_shared_wpn_rss_imperial_cannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_rss_imperial_cannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_rss_imperial_cannon, 3583705980) object_tangible_ship_components_weapon_shared_wpn_sds_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sds_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sds_elite, 3939485307) object_tangible_ship_components_weapon_shared_wpn_sds_heavy_imperial_spc_forces_cannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sds_heavy_imperial_spc_forces_cannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sds_heavy_imperial_spc_forces_cannon, 1624083757) object_tangible_ship_components_weapon_shared_wpn_sds_imperial_blaster_1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sds_imperial_blaster_1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sds_imperial_blaster_1, 3660124331) object_tangible_ship_components_weapon_shared_wpn_sds_imperial_blaster_2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sds_imperial_blaster_2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sds_imperial_blaster_2, 20887612) object_tangible_ship_components_weapon_shared_wpn_sds_imperial_special_forces_cannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sds_imperial_special_forces_cannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sds_imperial_special_forces_cannon, 326500083) object_tangible_ship_components_weapon_shared_wpn_sds_modified_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sds_modified_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sds_modified_elite, 3416463612) object_tangible_ship_components_weapon_shared_wpn_seinar_concussion_missile_s01 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/missile_proton_torpedo_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_01_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_01_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_seinar_concussion_missile_s01, 1499653630) object_tangible_ship_components_weapon_shared_wpn_seinar_disruptor = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_seinar_disruptor_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_seinar_disruptor, 3046767372) object_tangible_ship_components_weapon_shared_wpn_seinar_heatseeker_missile_s01 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/missile_proton_torpedo_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_01_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_01_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_seinar_heatseeker_missile_s01, 1500305519) object_tangible_ship_components_weapon_shared_wpn_seinar_ion_cannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_seinar_ion_cannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_seinar_ion_cannon, 1847953292) object_tangible_ship_components_weapon_shared_wpn_seinar_linked_cannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_seinar_linked_cannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_seinar_linked_cannon, 3708108391) object_tangible_ship_components_weapon_shared_wpn_seinar_ls1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_seinar_ls1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_seinar_ls1, 2396153703) object_tangible_ship_components_weapon_shared_wpn_seinar_ls72 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_seinar_ls72_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_seinar_ls72, 4266722432) object_tangible_ship_components_weapon_shared_wpn_sfs_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sfs_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sfs_elite, 3844210807) object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_1 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sfs_imperial_blaster_1_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_1, 1173398646) object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sfs_imperial_blaster_2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_2, 2665942241) object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_3 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sfs_imperial_blaster_3_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_3, 3622464364) object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_4 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sfs_imperial_blaster_4_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_blaster_4, 738803832) object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_special_forces_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sfs_imperial_special_forces_blaster_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sfs_imperial_special_forces_blaster, 994450521) object_tangible_ship_components_weapon_shared_wpn_sfs_improved_imperial_blaster_2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_sfs_improved_imperial_blaster_2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_sfs_improved_imperial_blaster_2, 3810806571) object_tangible_ship_components_weapon_shared_wpn_slayn_deluxe_light_ioncannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_slayn_deluxe_light_ioncannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_slayn_deluxe_light_ioncannon, 674088640) object_tangible_ship_components_weapon_shared_wpn_slayn_imagerec_missile_s01 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/missile_proton_torpedo_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_01_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_01_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_slayn_imagerec_missile_s01, 3037690567) object_tangible_ship_components_weapon_shared_wpn_slayn_ioncannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_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, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_slayn_ioncannon, 659233376) object_tangible_ship_components_weapon_shared_wpn_slayn_light_ioncannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_slayn_light_ioncannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_slayn_light_ioncannon, 1606284757) object_tangible_ship_components_weapon_shared_wpn_spacestation_rebel_turret_s01 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_turret", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_turret", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_spacestation_rebel_turret_s01, 2455152329) object_tangible_ship_components_weapon_shared_wpn_spacestation_rebel_turret_s02 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_turret", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_turret", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_spacestation_rebel_turret_s02, 1229000286) object_tangible_ship_components_weapon_shared_wpn_star_destroyer_turret_dome = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:star_destroyer_dome_turret", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:star_destroyer_dome_turret", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_star_destroyer_turret_dome, 3564769891) object_tangible_ship_components_weapon_shared_wpn_star_destroyer_turret_med = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:star_destroyer_med_turret", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:star_destroyer_med_turret", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_star_destroyer_turret_med, 52712658) object_tangible_ship_components_weapon_shared_wpn_star_destroyer_turret_square = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:star_destroyer_square_turret", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:star_destroyer_square_turret", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_star_destroyer_turret_square, 1162390806) object_tangible_ship_components_weapon_shared_wpn_std_countermeasure = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_std_countermeasure", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_std_countermeasure", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_std_countermeasure, 1265550250) object_tangible_ship_components_weapon_shared_wpn_subpro_advanced_cannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_subpro_advanced_cannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_advanced_cannon, 4160278616) object_tangible_ship_components_weapon_shared_wpn_subpro_improved_light_ioncannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_subpro_improved_light_ioncannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_improved_light_ioncannon, 2401708828) object_tangible_ship_components_weapon_shared_wpn_subpro_light_ioncannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_subpro_light_ioncannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_light_ioncannon, 3317340182) object_tangible_ship_components_weapon_shared_wpn_subpro_modified_tricannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_subpro_modified_tricannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_modified_tricannon, 1471920679) object_tangible_ship_components_weapon_shared_wpn_subpro_tricannon = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level3"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_subpro_tricannon_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_tricannon, 1320399548) object_tangible_ship_components_weapon_shared_wpn_subpro_tripleblaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_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, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_tripleblaster, 3508512617) object_tangible_ship_components_weapon_shared_wpn_subpro_tripleblaster_mark2 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_subpro_tripleblaster_mark2_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_tripleblaster_mark2, 449709518) object_tangible_ship_components_weapon_shared_wpn_subpro_tripleblaster_mark3 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_subpro_tripleblaster_mark3_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_subpro_tripleblaster_mark3, 1405313603) object_tangible_ship_components_weapon_shared_wpn_taim_elite = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_levelten"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_taim_elite_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_taim_elite, 3622160774) object_tangible_ship_components_weapon_shared_wpn_taim_heavy_laser = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level8"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_taim_heavy_laser_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_taim_heavy_laser, 1640800907) object_tangible_ship_components_weapon_shared_wpn_taim_ix4 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level4"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_taim_ix4_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_taim_ix4, 2408591552) object_tangible_ship_components_weapon_shared_wpn_taim_ix5 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level5"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_taim_ix5_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_taim_ix5, 3332200269) object_tangible_ship_components_weapon_shared_wpn_taim_kx5 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level6"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_taim_kx5_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_taim_kx5, 1479772015) object_tangible_ship_components_weapon_shared_wpn_taim_kx8 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level7"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_taim_kx8_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_taim_kx8, 1881367655) object_tangible_ship_components_weapon_shared_wpn_taim_kx9 = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level9"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:generic_weapon_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_taim_kx9_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_taim_kx9, 959316970) object_tangible_ship_components_weapon_shared_wpn_tieadvanced_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_tieadvanced_blaster", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_tieadvanced_blaster", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_tieadvanced_blaster, 6623562) object_tangible_ship_components_weapon_shared_wpn_tiefighter_basic = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_tiefighter_basic_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_tiefighter_basic_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_tiefighter_basic, 1543754587) object_tangible_ship_components_weapon_shared_wpn_z95_basic = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_z95_basic_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_z95_basic_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_z95_basic, 4095704307) object_tangible_ship_components_weapon_shared_wpn_z95_blaster = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/ship_component_weapon_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level2"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:wpn_z95_blaster", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:wpn_z95_blaster", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_wpn_z95_blaster, 3374006977) object_tangible_ship_components_weapon_shared_xwing_weapon_s01_test = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/xwing_weapon_neg_s01.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_01_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_01_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_xwing_weapon_s01_test, 4194726205) object_tangible_ship_components_weapon_shared_xwing_weapon_s02_test = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/xwing_weapon_neg_s02.apt", arrangementDescriptorFilename = "", certificationsRequired = {"cert_ordnance_level1"}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@space/space_item:weapon_test_02_d", gameObjectType = 1073741829, locationReservationRadius = 0, lookAtText = "string_id_table", noBuildRadius = 0, objectName = "@space/space_item:weapon_test_02_n", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_shared_xwing_weapon_s02_test, 2138475555)
lgpl-3.0
RockySeven3161/Unknown
plugins/vote.lua
615
2128
do local _file_votes = './data/votes.lua' function read_file_votes () local f = io.open(_file_votes, "r+") if f == nil then print ('Created voting file '.._file_votes) serialize_to_file({}, _file_votes) else print ('Values loaded: '.._file_votes) f:close() end return loadfile (_file_votes)() end function clear_votes (chat) local _votes = read_file_votes () _votes [chat] = {} serialize_to_file(_votes, _file_votes) end function votes_result (chat) local _votes = read_file_votes () local results = {} local result_string = "" if _votes [chat] == nil then _votes[chat] = {} end for user,vote in pairs (_votes[chat]) do if (results [vote] == nil) then results [vote] = user else results [vote] = results [vote] .. ", " .. user end end for vote,users in pairs (results) do result_string = result_string .. vote .. " : " .. users .. "\n" end return result_string end function save_vote(chat, user, vote) local _votes = read_file_votes () if _votes[chat] == nil then _votes[chat] = {} end _votes[chat][user] = vote serialize_to_file(_votes, _file_votes) end function run(msg, matches) if (matches[1] == "ing") then if (matches [2] == "reset") then clear_votes (tostring(msg.to.id)) return "Voting statistics reset.." elseif (matches [2] == "stats") then local votes_result = votes_result (tostring(msg.to.id)) if (votes_result == "") then votes_result = "[No votes registered]\n" end return "Voting statistics :\n" .. votes_result end else save_vote(tostring(msg.to.id), msg.from.print_name, tostring(tonumber(matches[2]))) return "Vote registered : " .. msg.from.print_name .. " " .. tostring(tonumber(matches [2])) end end return { description = "Plugin for voting in groups.", usage = { "!voting reset: Reset all the votes.", "!vote [number]: Cast the vote.", "!voting stats: Shows the statistics of voting." }, patterns = { "^!vot(ing) (reset)", "^!vot(ing) (stats)", "^!vot(e) ([0-9]+)$" }, run = run } end
gpl-2.0
shahabsaf1/test
plugins/vote.lua
615
2128
do local _file_votes = './data/votes.lua' function read_file_votes () local f = io.open(_file_votes, "r+") if f == nil then print ('Created voting file '.._file_votes) serialize_to_file({}, _file_votes) else print ('Values loaded: '.._file_votes) f:close() end return loadfile (_file_votes)() end function clear_votes (chat) local _votes = read_file_votes () _votes [chat] = {} serialize_to_file(_votes, _file_votes) end function votes_result (chat) local _votes = read_file_votes () local results = {} local result_string = "" if _votes [chat] == nil then _votes[chat] = {} end for user,vote in pairs (_votes[chat]) do if (results [vote] == nil) then results [vote] = user else results [vote] = results [vote] .. ", " .. user end end for vote,users in pairs (results) do result_string = result_string .. vote .. " : " .. users .. "\n" end return result_string end function save_vote(chat, user, vote) local _votes = read_file_votes () if _votes[chat] == nil then _votes[chat] = {} end _votes[chat][user] = vote serialize_to_file(_votes, _file_votes) end function run(msg, matches) if (matches[1] == "ing") then if (matches [2] == "reset") then clear_votes (tostring(msg.to.id)) return "Voting statistics reset.." elseif (matches [2] == "stats") then local votes_result = votes_result (tostring(msg.to.id)) if (votes_result == "") then votes_result = "[No votes registered]\n" end return "Voting statistics :\n" .. votes_result end else save_vote(tostring(msg.to.id), msg.from.print_name, tostring(tonumber(matches[2]))) return "Vote registered : " .. msg.from.print_name .. " " .. tostring(tonumber(matches [2])) end end return { description = "Plugin for voting in groups.", usage = { "!voting reset: Reset all the votes.", "!vote [number]: Cast the vote.", "!voting stats: Shows the statistics of voting." }, patterns = { "^!vot(ing) (reset)", "^!vot(ing) (stats)", "^!vot(e) ([0-9]+)$" }, run = run } end
gpl-2.0
BakaBBQ/siki.lua
love-frames/objects/menu.lua
15
7654
--[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ -- get the current require path local path = string.sub(..., 1, string.len(...) - string.len(".objects.menu")) local loveframes = require(path .. ".libraries.common") -- menu object local newobject = loveframes.NewObject("menu", "loveframes_object_menu", true) --[[--------------------------------------------------------- - func: initialize() - desc: initializes the object --]]--------------------------------------------------------- function newobject:initialize(menu) self.type = "menu" self.width = 80 self.height = 25 self.largest_item_width = 0 self.largest_item_height = 0 self.is_sub_menu = false self.internal = false self.parentmenu = nil self.options = {} self.internals = {} end --[[--------------------------------------------------------- - func: update(deltatime) - desc: updates the object --]]--------------------------------------------------------- function newobject:update(dt) local state = loveframes.state local selfstate = self.state if state ~= selfstate then return end local visible = self.visible local alwaysupdate = self.alwaysupdate if not visible then if not alwaysupdate then return end end self:CheckHover() local hover = self.hover local parent = self.parent local base = loveframes.base local update = self.Update -- move to parent if there is a parent if parent ~= base then self.x = self.parent.x + self.staticx self.y = self.parent.y + self.staticy end for k, v in ipairs(self.internals) do local width = v.contentwidth local height = v.contentheight if width > self.largest_item_width then self.largest_item_width = width end if height > self.largest_item_height then self.largest_item_height = height end end local y = 0 self.height = 0 for k, v in ipairs(self.internals) do v:SetWidth(self.largest_item_width) if v.option_type ~= "divider" then v:SetHeight(self.largest_item_height) else v:SetHeight(5) end v:SetY(y) self.height = self.height + v.height y = y + v.height v:update(dt) end self.width = self.largest_item_width self.largest_item_width = 0 self.largest_item_height = 0 local screen_width = love.graphics.getWidth() local screen_height = love.graphics.getHeight() local sx = self.x local sy = self.y local width = self.width local height = self.height local x1 = sx + width if sx + width > screen_width then self.x = screen_width - width end if sy + self.height > screen_height then self.y = screen_height - self.height end if update then update(self, dt) end end --[[--------------------------------------------------------- - func: draw() - desc: draws the object --]]--------------------------------------------------------- function newobject:draw() local state = loveframes.state local selfstate = self.state if state ~= selfstate then return end local visible = self.visible if not visible then return end local skins = loveframes.skins.available local skinindex = loveframes.config["ACTIVESKIN"] local defaultskin = loveframes.config["DEFAULTSKIN"] local selfskin = self.skin local skin = skins[selfskin] or skins[skinindex] local drawfunc = skin.DrawMenu or skins[defaultskin].DrawMenu local draw = self.Draw local drawoverfunc = skin.DrawOverMenu or skins[defaultskin].DrawOverMenu local drawcount = loveframes.drawcount -- set the object's draw order self:SetDrawOrder() if draw then draw(self) else drawfunc(self) end for k, v in ipairs(self.internals) do v:draw() end if drawoverfunc then drawoverfunc(self) end end --[[--------------------------------------------------------- - func: mousepressed(x, y, button) - desc: called when the player presses a mouse button --]]--------------------------------------------------------- function newobject:mousepressed(x, y, button) local state = loveframes.state local selfstate = self.state if state ~= selfstate then return end local visible = self.visible if not visible then return end end --[[--------------------------------------------------------- - func: mousereleased(x, y, button) - desc: called when the player releases a mouse button --]]--------------------------------------------------------- function newobject:mousereleased(x, y, button) local state = loveframes.state local selfstate = self.state if state ~= selfstate then return end local visible = self.visible if not visible then return end local internals = self.internals for k, v in ipairs(internals) do v:mousereleased(x, y, button) end end --[[--------------------------------------------------------- - func: AddOption(text, icon, func) - desc: adds an option to the object --]]--------------------------------------------------------- function newobject:AddOption(text, icon, func) local menuoption = loveframes.objects["menuoption"]:new(self) menuoption:SetText(text) menuoption:SetIcon(icon) menuoption:SetFunction(func) table.insert(self.internals, menuoption) return self end --[[--------------------------------------------------------- - func: RemoveOption(id) - desc: removes an option --]]--------------------------------------------------------- function newobject:RemoveOption(id) for k, v in ipairs(self.internals) do if k == id then table.remove(self.internals, k) return end end return self end --[[--------------------------------------------------------- - func: AddSubMenu(text, icon, menu) - desc: adds a submenu to the object --]]--------------------------------------------------------- function newobject:AddSubMenu(text, icon, menu) local function activatorFunc(object) if menu:GetVisible() then local hoverobject = loveframes.hoverobject if hoverobject ~= object and hoverobject:GetBaseParent() ~= menu then menu:SetVisible(false) end else menu:SetVisible(true) menu:SetPos(object:GetX() + object:GetWidth(), object:GetY()) end end menu:SetVisible(false) local menuoption = loveframes.objects["menuoption"]:new(self, "submenu_activator", menu) menuoption:SetText(text) menuoption:SetIcon(icon) if menu then menu.is_sub_menu = true menu.parentmenu = self end table.insert(self.internals, menuoption) return self end --[[--------------------------------------------------------- - func: AddDivider() - desc: adds a divider to the object --]]--------------------------------------------------------- function newobject:AddDivider() local menuoption = loveframes.objects["menuoption"]:new(self, "divider") table.insert(self.internals, menuoption) return self end --[[--------------------------------------------------------- - func: GetBaseMenu(t) - desc: gets the object's base menu --]]--------------------------------------------------------- function newobject:GetBaseMenu(t) local t = t or {} if self.parentmenu then table.insert(t, self.parentmenu) self.parentmenu:GetBaseMenu(t) else return self end return t[#t] end --[[--------------------------------------------------------- - func: SetVisible(bool) - desc: sets the object's visibility --]]--------------------------------------------------------- function newobject:SetVisible(bool) self.visible = bool if not bool then local internals = self.internals for k, v in ipairs(internals) do if v.menu then v.activated = false v.menu:SetVisible(bool) end end end return self end
mit
TheAnswer/FirstTest
bin/scripts/creatures/objects/npcs/imperial/imperialCivilPatrolman.lua
1
4771
--Copyright (C) 2008 <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. imperialCivilPatrolman = Creature:new { objectName = "imperialCivilPatrolman", -- Lua Object Name creatureType = "NPC", faction = "Imperial", gender = "", name = "Civilian patrolman", objectCRC = 16556953, socialGroup = "Imperial", named = FALSE, level = 6, xp = 147, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 220, healthMin = 180, strength = 0, constitution = 0, actionMax = 220, actionMin = 180, quickness = 0, stamina = 0, mindMax = 220, mindMin = 180, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 1, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 0, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "", -- File path to weapon -> object\xxx\xxx\xx weaponName = "", -- Name ex. 'a Vibrolance' weaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 0, weaponMaxDamage = 0, weaponAttackSpeed = 0, weaponDamageType = "", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = 0, -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "", "", "" } -- respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(imperialCivilPatrolman, 16556953) -- Add to Global Table
lgpl-3.0
chrisdugne/ludum-dare-36
src/libs/Underscore.lua
1
1317
-------------------------------------------------------------------------------- --- -- Picked up Underscore tools from : -- https://github.com/mirven/underscore.lua/blob/master/lib/underscore.lua -- -- Applied some modifications for Uralys -- -------------------------------------------------------------------------------- local Underscore = {} -------------------------------------------------------------------------------- --- -- http://underscorejs.org/#extend -- -- Copy all of the properties in the source objects over -- to the destination object, and return the destination object. -- -- It's in-order, so the last source will override properties -- of the same name in previous arguments. -- function Underscore.extend (destination, source) if(source == nil) then return destination end for k,v in pairs(source) do destination[k] = v end return destination end --- -- http://underscorejs.org/#defaults -- -- Fill in undefined properties in object with the first -- value present in the following list of defaults objects. -- function Underscore.defaults (object, default) for k,v in pairs(default) do if(object[k] == nil) then object[k] = v end end return object end ------------------------------------- return Underscore
bsd-3-clause
TheAnswer/FirstTest
bin/scripts/creatures/objects/endor/npcs/gundula/gundulaCub.lua
1
4547
--Copyright (C) 2008 <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. gundulaCub = Creature:new { objectName = "gundulaCub", -- Lua Object Name creatureType = "NPC", faction = "gundula_tribe", factionPoints = 20, gender = "", speciesName = "gundula_cub", stfName = "mob/creature_names", objectCRC = 556229826, socialGroup = "gundula_tribe", level = 5, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 165, healthMin = 135, strength = 0, constitution = 0, actionMax = 165, actionMin = 135, quickness = 0, stamina = 0, mindMax = 165, mindMin = 135, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 0, ferocity = 0, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 45, weaponMaxDamage = 50, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "gundulaAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(gundulaCub, 556229826) -- Add to Global Table
lgpl-3.0
yav/language-lua
lua-5.3.1-tests/nextvar.lua
4
13790
-- $Id: nextvar.lua,v 1.77 2015/04/06 21:12:51 roberto Exp $ print('testing tables, next, and for') local a = {} -- make sure table has lots of space in hash part for i=1,100 do a[i.."+"] = true end for i=1,100 do a[i.."+"] = nil end -- fill hash part with numeric indices testing size operator for i=1,100 do a[i] = true assert(#a == i) end -- testing ipairs local x = 0 for k,v in ipairs{10,20,30;x=12} do x = x + 1 assert(k == x and v == x * 10) end for _ in ipairs{x=12, y=24} do assert(nil) end -- test for 'false' x ipair x = false local i = 0 for k,v in ipairs{true,false,true,false} do i = i + 1 x = not x assert(x == v) end assert(i == 4) -- iterator function is always the same assert(type(ipairs{}) == 'function' and ipairs{} == ipairs{}) if not T then (Message or print) ('\n >>> testC not active: skipping tests for table sizes <<<\n') else --[ -- testing table sizes local function log2 (x) return math.log(x, 2) end local function mp2 (n) -- minimum power of 2 >= n local mp = 2^math.ceil(log2(n)) assert(n == 0 or (mp/2 < n and n <= mp)) return mp end local function fb (n) local r, nn = T.int2fb(n) assert(r < 256) return nn end -- test fb function for a = 1, 10000 do -- all numbers up to 10^4 local n = fb(a) assert(a <= n and n <= a*1.125) end local a = 1024 -- plus a few up to 2 ^30 local lim = 2^30 while a < lim do local n = fb(a) assert(a <= n and n <= a*1.125) a = math.ceil(a*1.3) end local function check (t, na, nh) local a, h = T.querytab(t) if a ~= na or h ~= nh then print(na, nh, a, h) assert(nil) end end -- testing C library sizes do local s = 0 for _ in pairs(math) do s = s + 1 end check(math, 0, mp2(s)) end -- testing constructor sizes local lim = 40 local s = 'return {' for i=1,lim do s = s..i..',' local s = s for k=0,lim do local t = load(s..'}', '')() assert(#t == i) check(t, fb(i), mp2(k)) s = string.format('%sa%d=%d,', s, k, k) end end -- tests with unknown number of elements local a = {} for i=1,lim do a[i] = i end -- build auxiliary table for k=0,lim do local a = {table.unpack(a,1,k)} assert(#a == k) check(a, k, 0) a = {1,2,3,table.unpack(a,1,k)} check(a, k+3, 0) assert(#a == k + 3) end -- testing tables dynamically built local lim = 130 local a = {}; a[2] = 1; check(a, 0, 1) a = {}; a[0] = 1; check(a, 0, 1); a[2] = 1; check(a, 0, 2) a = {}; a[0] = 1; a[1] = 1; check(a, 1, 1) a = {} for i = 1,lim do a[i] = 1 assert(#a == i) check(a, mp2(i), 0) end a = {} for i = 1,lim do a['a'..i] = 1 assert(#a == 0) check(a, 0, mp2(i)) end a = {} for i=1,16 do a[i] = i end check(a, 16, 0) do for i=1,11 do a[i] = nil end for i=30,50 do a[i] = nil end -- force a rehash (?) check(a, 0, 8) -- only 5 elements in the table a[10] = 1 for i=30,50 do a[i] = nil end -- force a rehash (?) check(a, 0, 8) -- only 6 elements in the table for i=1,14 do a[i] = nil end for i=18,50 do a[i] = nil end -- force a rehash (?) check(a, 0, 4) -- only 2 elements ([15] and [16]) end -- reverse filling for i=1,lim do local a = {} for i=i,1,-1 do a[i] = i end -- fill in reverse check(a, mp2(i), 0) end -- size tests for vararg lim = 35 function foo (n, ...) local arg = {...} check(arg, n, 0) assert(select('#', ...) == n) arg[n+1] = true check(arg, mp2(n+1), 0) arg.x = true check(arg, mp2(n+1), 1) end local a = {} for i=1,lim do a[i] = true; foo(i, table.unpack(a)) end end --] -- test size operation on empty tables assert(#{} == 0) assert(#{nil} == 0) assert(#{nil, nil} == 0) assert(#{nil, nil, nil} == 0) assert(#{nil, nil, nil, nil} == 0) print'+' local nofind = {} a,b,c = 1,2,3 a,b,c = nil -- next uses always the same iteraction function assert(next{} == next{}) local function find (name) local n,v while 1 do n,v = next(_G, n) if not n then return nofind end assert(v ~= nil) if n == name then return v end end end local function find1 (name) for n,v in pairs(_G) do if n==name then return v end end return nil -- not found end assert(print==find("print") and print == find1("print")) assert(_G["print"]==find("print")) assert(assert==find1("assert")) assert(nofind==find("return")) assert(not find1("return")) _G["ret" .. "urn"] = nil assert(nofind==find("return")) _G["xxx"] = 1 assert(xxx==find("xxx")) -- invalid key to 'next' assert(string.find(select(2, pcall(next, {10,20}, 3)), "invalid key")) -- both 'pairs' and 'ipairs' need an argument assert(string.find(select(2, pcall(pairs)), "bad argument")) assert(string.find(select(2, pcall(ipairs)), "bad argument")) print('+') a = {} for i=0,10000 do if math.fmod(i,10) ~= 0 then a['x'..i] = i end end n = {n=0} for i,v in pairs(a) do n.n = n.n+1 assert(i and v and a[i] == v) end assert(n.n == 9000) a = nil do -- clear global table local a = {} for n,v in pairs(_G) do a[n]=v end for n,v in pairs(a) do if not package.loaded[n] and type(v) ~= "function" and not string.find(n, "^[%u_]") then _G[n] = nil end collectgarbage() end end -- local function checknext (a) local b = {} do local k,v = next(a); while k do b[k] = v; k,v = next(a,k) end end for k,v in pairs(b) do assert(a[k] == v) end for k,v in pairs(a) do assert(b[k] == v) end end checknext{1,x=1,y=2,z=3} checknext{1,2,x=1,y=2,z=3} checknext{1,2,3,x=1,y=2,z=3} checknext{1,2,3,4,x=1,y=2,z=3} checknext{1,2,3,4,5,x=1,y=2,z=3} assert(#{} == 0) assert(#{[-1] = 2} == 0) assert(#{1,2,3,nil,nil} == 3) for i=0,40 do local a = {} for j=1,i do a[j]=j end assert(#a == i) end -- 'maxn' is now deprecated, but it is easily defined in Lua function table.maxn (t) local max = 0 for k in pairs(t) do max = (type(k) == 'number') and math.max(max, k) or max end return max end assert(table.maxn{} == 0) assert(table.maxn{["1000"] = true} == 0) assert(table.maxn{["1000"] = true, [24.5] = 3} == 24.5) assert(table.maxn{[1000] = true} == 1000) assert(table.maxn{[10] = true, [100*math.pi] = print} == 100*math.pi) table.maxn = nil -- int overflow a = {} for i=0,50 do a[2^i] = true end assert(a[#a]) print('+') -- erasing values local t = {[{1}] = 1, [{2}] = 2, [string.rep("x ", 4)] = 3, [100.3] = 4, [4] = 5} local n = 0 for k, v in pairs( t ) do n = n+1 assert(t[k] == v) t[k] = nil collectgarbage() assert(t[k] == nil) end assert(n == 5) local function test (a) assert(not pcall(table.insert, a, 2, 20)); table.insert(a, 10); table.insert(a, 2, 20); table.insert(a, 1, -1); table.insert(a, 40); table.insert(a, #a+1, 50) table.insert(a, 2, -2) assert(not pcall(table.insert, a, 0, 20)); assert(not pcall(table.insert, a, #a + 2, 20)); assert(table.remove(a,1) == -1) assert(table.remove(a,1) == -2) assert(table.remove(a,1) == 10) assert(table.remove(a,1) == 20) assert(table.remove(a,1) == 40) assert(table.remove(a,1) == 50) assert(table.remove(a,1) == nil) assert(table.remove(a) == nil) assert(table.remove(a, #a) == nil) end a = {n=0, [-7] = "ban"} test(a) assert(a.n == 0 and a[-7] == "ban") a = {[-7] = "ban"}; test(a) assert(a.n == nil and #a == 0 and a[-7] == "ban") a = {[-1] = "ban"} test(a) assert(#a == 0 and table.remove(a) == nil and a[-1] == "ban") a = {[0] = "ban"} assert(#a == 0 and table.remove(a) == "ban" and a[0] == nil) table.insert(a, 1, 10); table.insert(a, 1, 20); table.insert(a, 1, -1) assert(table.remove(a) == 10) assert(table.remove(a) == 20) assert(table.remove(a) == -1) assert(table.remove(a) == nil) a = {'c', 'd'} table.insert(a, 3, 'a') table.insert(a, 'b') assert(table.remove(a, 1) == 'c') assert(table.remove(a, 1) == 'd') assert(table.remove(a, 1) == 'a') assert(table.remove(a, 1) == 'b') assert(table.remove(a, 1) == nil) assert(#a == 0 and a.n == nil) a = {10,20,30,40} assert(table.remove(a, #a + 1) == nil) assert(not pcall(table.remove, a, 0)) assert(a[#a] == 40) assert(table.remove(a, #a) == 40) assert(a[#a] == 30) assert(table.remove(a, 2) == 20) assert(a[#a] == 30 and #a == 2) do -- testing table library with metamethods local function test (proxy, t) for i = 1, 10 do table.insert(proxy, 1, i) end assert(#proxy == 10 and #t == 10) for i = 1, 10 do assert(t[i] == 11 - i) end table.sort(proxy) for i = 1, 10 do assert(t[i] == i and proxy[i] == i) end assert(table.concat(proxy, ",") == "1,2,3,4,5,6,7,8,9,10") for i = 1, 8 do assert(table.remove(proxy, 1) == i) end assert(#proxy == 2 and #t == 2) local a, b, c = table.unpack(proxy) assert(a == 9 and b == 10 and c == nil) end -- all virtual local t = {} local proxy = setmetatable({}, { __len = function () return #t end, __index = t, __newindex = t, }) test(proxy, t) -- only __newindex local count = 0 t = setmetatable({}, { __newindex = function (t,k,v) count = count + 1; rawset(t,k,v) end}) test(t, t) assert(count == 10) -- after first 10, all other sets are not new -- no __newindex t = setmetatable({}, { __index = function (_,k) return k + 1 end, __len = function (_) return 5 end}) assert(table.concat(t, ";") == "2;3;4;5;6") end do -- Test to ensure that, when there are no metamethods, -- library uses raw access. -- (tricky: assumes undocumented behavior that test for presence of -- metamethods is done before getting the length of the table) local t = setmetatable({}, { -- once 'len' is called, only raw access will work __len = function (t) getmetatable(t).__index = error getmetatable(t).__newindex = error return 10 end }) table.insert(t, 1, 10) -- work assert(rawget(t, 1) == 10) assert(not pcall(table.insert, t, 20)) -- does not work any more -- still does not work assert(not pcall(table.sort, t, function (_,_) return false end)) -- reset access getmetatable(t).__index = nil getmetatable(t).__newindex = nil -- now it works again assert(pcall(table.sort, t, function (_,_) return false end)) -- not any more assert(not pcall(table.sort, t, function (_,_) return false end)) end print('+') a = {} for i=1,1000 do a[i] = i; a[i-1] = nil end assert(next(a,nil) == 1000 and next(a,1000) == nil) assert(next({}) == nil) assert(next({}, nil) == nil) for a,b in pairs{} do error"not here" end for i=1,0 do error'not here' end for i=0,1,-1 do error'not here' end a = nil; for i=1,1 do assert(not a); a=1 end; assert(a) a = nil; for i=1,1,-1 do assert(not a); a=1 end; assert(a) do print("testing floats in numeric for") local a -- integer count a = 0; for i=1, 1, 1 do a=a+1 end; assert(a==1) a = 0; for i=10000, 1e4, -1 do a=a+1 end; assert(a==1) a = 0; for i=1, 0.99999, 1 do a=a+1 end; assert(a==0) a = 0; for i=9999, 1e4, -1 do a=a+1 end; assert(a==0) a = 0; for i=1, 0.99999, -1 do a=a+1 end; assert(a==1) -- float count a = 0; for i=0, 0.999999999, 0.1 do a=a+1 end; assert(a==10) a = 0; for i=1.0, 1, 1 do a=a+1 end; assert(a==1) a = 0; for i=-1.5, -1.5, 1 do a=a+1 end; assert(a==1) a = 0; for i=1e6, 1e6, -1 do a=a+1 end; assert(a==1) a = 0; for i=1.0, 0.99999, 1 do a=a+1 end; assert(a==0) a = 0; for i=99999, 1e5, -1.0 do a=a+1 end; assert(a==0) a = 0; for i=1.0, 0.99999, -1 do a=a+1 end; assert(a==1) end -- conversion a = 0; for i="10","1","-2" do a=a+1 end; assert(a==5) do -- checking types local c local function checkfloat (i) assert(math.type(i) == "float") c = c + 1 end c = 0; for i = 1.0, 10 do checkfloat(i) end assert(c == 10) c = 0; for i = -1, -10, -1.0 do checkfloat(i) end assert(c == 10) local function checkint (i) assert(math.type(i) == "integer") c = c + 1 end local m = math.maxinteger c = 0; for i = m, m - 10, -1 do checkint(i) end assert(c == 11) c = 0; for i = 1, 10.9 do checkint(i) end assert(c == 10) c = 0; for i = 10, 0.001, -1 do checkint(i) end assert(c == 10) c = 0; for i = 1, "10.8" do checkint(i) end assert(c == 10) c = 0; for i = 9, "3.4", -1 do checkint(i) end assert(c == 6) c = 0; for i = 0, " -3.4 ", -1 do checkint(i) end assert(c == 4) c = 0; for i = 100, "96.3", -2 do checkint(i) end assert(c == 2) c = 0; for i = 1, math.huge do if i > 10 then break end; checkint(i) end assert(c == 10) c = 0; for i = -1, -math.huge, -1 do if i < -10 then break end; checkint(i) end assert(c == 10) for i = math.mininteger, -10e100 do assert(false) end for i = math.maxinteger, 10e100, -1 do assert(false) end end collectgarbage() -- testing generic 'for' local function f (n, p) local t = {}; for i=1,p do t[i] = i*10 end return function (_,n) if n > 0 then n = n-1 return n, table.unpack(t) end end, nil, n end local x = 0 for n,a,b,c,d in f(5,3) do x = x+1 assert(a == 10 and b == 20 and c == 30 and d == nil) end assert(x == 5) -- testing __pairs and __ipairs metamethod a = {} do local x,y,z = pairs(a) assert(type(x) == 'function' and y == a and z == nil) end local function foo (e,i) assert(e == a) if i <= 10 then return i+1, i+2 end end local function foo1 (e,i) i = i + 1 assert(e == a) if i <= e.n then return i,a[i] end end setmetatable(a, {__pairs = function (x) return foo, x, 0 end}) local i = 0 for k,v in pairs(a) do i = i + 1 assert(k == i and v == k+1) end a.n = 5 a[3] = 30 -- testing ipairs with metamethods a = {n=10} setmetatable(a, { __index = function (t,k) if k <= t.n then return k * 10 end end}) i = 0 for k,v in ipairs(a) do i = i + 1 assert(k == i and v == i * 10) end assert(i == a.n) print"OK"
bsd-3-clause
TheAnswer/FirstTest
bin/scripts/items/objects/weapons/polearm/nightsisterLance.lua
1
2392
--Copyright (C) 2007 <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. nightsisterLance = Weapon:new{ objectName = "Nightsister energy lance", templateName = "object/weapon/melee/polearm/shared_lance_nightsister_npc_version.iff", objectCRC = 770226321, objectType = POLEARM, damageType = WEAPON_ENERGY, certification = "cert_lance_vibrolance", attackSpeed = 3.0, minDamage = 11, maxDamage = 214 }
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/armorsmith/personalArmorIiiUbese/advancedPaddedArmorSegment.lua
1
4859
--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. advancedPaddedArmorSegment = Object:new { objectName = "Advanced Padded Armor Segment", stfName = "armor_segment_padded_advanced", stfFile = "craft_clothing_ingredients_n", objectCRC = 626237841, groupName = "craftArmorPersonalGroupD", -- Group schematic is awarded in (See skills table) craftingToolTab = 2, -- (See DraftSchemticImplementation.h) complexity = 25, size = 6, xpType = "crafting_clothing_armor", xp = 50, assemblySkill = "armor_assembly", experimentingSkill = "armor_experimentation", ingredientTemplateNames = "craft_armor_ingredients_n, craft_armor_ingredients_n, craft_armor_ingredients_n, craft_armor_ingredients_n, craft_armor_ingredients_n, craft_armor_ingredients_n", ingredientTitleNames = "segment_layer_assembly_plate, armor_layer_weld_tabs, segment_mounting_tabs, defensive_layer, defensive_layer_2, segment_enhancement", ingredientSlotType = "0, 0, 0, 4, 4, 4", resourceTypes = "hide_wooly_yavin4, steel_cubirian, steel_duralloy, object/tangible/component/armor/shared_armor_layer.iff, object/tangible/component/armor/shared_armor_layer.iff, object/tangible/component/armor/shared_base_armor_segment_enhancement.iff", resourceQuantities = "25, 16, 8, 1, 1, 1", combineTypes = "0, 0, 0, 1, 1, 1", contribution = "100, 100, 100, 100, 100, 100", numberExperimentalProperties = "1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 1", experimentalProperties = "XX, XX, XX, OQ, SR, OQ, UT, MA, OQ, MA, OQ, MA, OQ, XX, XX, OQ, SR, XX", experimentalWeights = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1", experimentalGroupTitles = "null, null, exp_durability, exp_quality, exp_durability, exp_durability, exp_durability, exp_durability, null, null, exp_resistance, null", experimentalSubGroupTitles = "null, null, hit_points, armor_effectiveness, armor_integrity, armor_health_encumbrance, armor_action_encumbrance, armor_mind_encumbrance, armor_rating, armor_special_type, armor_special_effectiveness, armor_special_integrity", experimentalMin = "0, 0, 1000, 1, 100, 9, 12, 6, 1, 4, 1, 100", experimentalMax = "0, 0, 1000, 20, 1000, 1, 1, 1, 1, 4, 30, 1000", experimentalPrecision = "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", tanoAttributes = "objecttype=262145:objectcrc=3071514894:stfFile=craft_clothing_ingredients_n:stfName=armor_segment_padded_advanced:stfDetail=:itemmask=65535:customattributes=specialprotection=blasteffectiveness;:", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "", customizationDefaults = "", customizationSkill = "armor_customization" } DraftSchematics:addDraftSchematic(advancedPaddedArmorSegment, 626237841)--- Add to global DraftSchematics table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/tangible/deed/turret_deed/objects.lua
1
5991
--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_deed_turret_deed_shared_turret_block_large_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_block_large_deed_name", gameObjectType = 8388610, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_block_large_deed_name", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_turret_deed_shared_turret_block_large_deed, 662025863) object_tangible_deed_turret_deed_shared_turret_block_medium_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_block_medium_deed_name", gameObjectType = 8388610, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_block_medium_deed_name", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_turret_deed_shared_turret_block_medium_deed, 3770943764) object_tangible_deed_turret_deed_shared_turret_block_small_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_block_small_deed_name", gameObjectType = 8388610, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_block_small_deed_name", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_turret_deed_shared_turret_block_small_deed, 1744023588)
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/object/tangible/deed/faction_perk/turret/objects.lua
1
12297
--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_deed_faction_perk_turret_shared_block_lg_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_block_lg", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_block_lg", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_block_lg_deed, 629647552) object_tangible_deed_faction_perk_turret_shared_block_med_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_block_med", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_block_med", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_block_med_deed, 4221569030) object_tangible_deed_faction_perk_turret_shared_block_sm_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_block_sm", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_block_sm", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_block_sm_deed, 2743566481) object_tangible_deed_faction_perk_turret_shared_dish_lg_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_dish_lg", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_dish_lg", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_dish_lg_deed, 4034604910) object_tangible_deed_faction_perk_turret_shared_dish_sm_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_dish_sm", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_dish_sm", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_dish_sm_deed, 1987774271) object_tangible_deed_faction_perk_turret_shared_tower_lg_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_tower_lg", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_tower_lg", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_tower_lg_deed, 3732331701) object_tangible_deed_faction_perk_turret_shared_tower_med_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_tower_med", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_tower_med", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_tower_med_deed, 2821147502) object_tangible_deed_faction_perk_turret_shared_tower_sm_deed = SharedTangibleObjectTemplate:new { appearanceFilename = "appearance/eqp_tool_datapad.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 0, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "@deed_detail:turret_tower_sm", gameObjectType = 8388608, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@deed:turret_tower_sm", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "", surfaceType = 0, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_tangible_deed_faction_perk_turret_shared_tower_sm_deed, 1484190948)
lgpl-3.0
mabruckner/automation
projector_lights_off/main.lua
2
1454
high = gpio.HIGH low = gpio.LOW pins = {false,false,false,false,false} for i=0,table.getn(pins) do gpio.mode(i,gpio.OUTPUT); end srv = net.createServer(net.TCP, 30) thing = gpio.HIGH srv:listen(80,function(conn) conn:on('receive', function(conn,payload) print(payload) q = string.match(payload,"GET%s+%S+") print("AASDF :"..q..":\n") si,ei = string.find(q,"GET%s+") path = string.sub(q,ei+1,string.len(q)) print(path) num = tonumber(string.match(path,"%d")) print(num) if num == nil then conn:send('HTTP/1.1 500 ERROR\n\n') conn:send('invalid query, no number\n') conn:on('sent',function(conn) conn:close() end) return end num = num + 1 if string.find(path,"on") then pins[num] = true elseif string.find(path,"off") then pins[num] = false else if pins[num] then pins[num] = false else pins[num] = true end end if pins[num] then gpio.write(num-1,gpio.HIGH) else gpio.write(num-1,gpio.LOW) end conn:send('HTTP/1.1 200 OK\n\n') for i=1,table.getn(pins) do print(i..'') conn:send((i-1)..' : '..tostring(pins[i])..'\n') end conn:on('sent',function(conn) conn:close() end) end) end)
mit
TheAnswer/FirstTest
bin/scripts/creatures/objects/dantooine/npcs/kunga/kungaHarvester.lua
1
4867
--Copyright (C) 2008 <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. kungaHarvester = Creature:new { objectName = "kungaHarvester", -- Lua Object Name creatureType = "NPC", faction = "kunga_tribe", factionPoints = 20, gender = "", speciesName = "kunga_harvester", stfName = "mob/creature_names", objectCRC = 4083847450, socialGroup = "kunga_tribe", level = 28, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 9900, healthMin = 8100, strength = 500, constitution = 500, actionMax = 9900, actionMin = 8100, quickness = 500, stamina = 500, mindMax = 9900, mindMin = 8100, focus = 500, willpower = 500, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 40, electricity = 60, stun = -1, blast = 0, heat = -1, cold = -1, acid = 40, lightsaber = 0, accuracy = 300, healer = 0, pack = 1, herd = 1, stalker = 0, killer = 0, ferocity = 0, aggressive = 0, invincible = 0, meleeDefense = 1, rangedDefense = 1, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/melee/polearm/shared_lance_staff_wood_s1.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "a Wooden Staff", -- Name ex. 'a Vibrolance' weaponTemp = "lance_staff_wood_s1", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "PolearmMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 1, weaponMinDamage = 260, weaponMaxDamage = 270, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "object/weapon/melee/knife/shared_knife_stone.iff", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "a Stone Knife", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "knife_stone", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "OneHandedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 1, alternateWeaponMinDamage = 260, alternateWeaponMaxDamage = 270, alternateweaponAttackSpeed = 2, alternateWeaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0,11,15,19,33", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "kungaAttack01", "kungaAttack02", "kungaAttack03", "kungaAttack04", "kungaAttack05", "kungaAttack06", "kungaAttack07", "kungaAttack08" }, respawnTimer = 300, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(kungaHarvester, 4083847450) -- Add to Global Table
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/slashcommands/generic/setWaypointActiveStatus.lua
1
2489
--Copyright (C) 2007 <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. --true = 1, false = 0 SetWaypointActiveStatusSlashCommand = { name = "setwaypointactivestatus", alternativeNames = "", animation = "", invalidStateMask = 2097152, --glowingJedi, invalidPostures = "", target = 2, targeType = 1, disabled = 0, maxRangeToTarget = 0, --adminLevel = 0, addToCombatQueue = 0, } AddSetWaypointActiveStatusSlashCommand(SetWaypointActiveStatusSlashCommand)
lgpl-3.0
Modified-MW-DF/modified-MDF
MWDF Project/Dwarf Fortress/hack/scripts/modtools/reaction-trigger-transition.lua
2
4748
-- help transition from autoSyndrome -- author expwnent --[====[ modtools/reaction-trigger-transition ==================================== Prints useful things to the console and a file to help modders transition from ``autoSyndrome`` to `modtools/reaction-trigger`. This script is basically an apology for breaking backward compatibility in June 2014, and will be removed eventually. ]====] local function maybeQuote(str) if str == '' or string.find(str,' ') then return ('"' .. str .. '"') else return str end end warnings = '' output = '' for _,reaction in ipairs(df.global.world.raws.reactions) do local function foreachProduct(product) local prodType = product:getType() if prodType ~= df.reaction_product_type.item then return end if product.item_type ~= df.item_type.BOULDER then return end if product.mat_index < 0 then return end local inorganic = df.global.world.raws.inorganics[product.mat_index] local didInorganicName for _,syndrome in ipairs(inorganic.material.syndrome) do local workerOnly = true local allowMultipleTargets = false; local command local commandStr local destroyRock = true; local foundAutoSyndrome = false; local resetPolicy; for i,synclass in ipairs(syndrome.syn_class) do synclass = synclass.value if false then elseif synclass == '\\AUTO_SYNDROME' then foundAutoSyndrome = true elseif synclass == '\\ALLOW_NONWORKER_TARGETS' then workerOnly = false elseif synclass == '\\ALLOW_MULTIPLE_TARGETS' then allowMultipleTargets = true elseif synclass == '\\PRESERVE_ROCK' then destroyRock = false elseif synclass == '\\RESET_POLICY DoNothing' then resetPolicy = 'DoNothing' elseif synclass == '\\RESET_POLICY ResetDuration' then resetPolicy = 'ResetDuration' elseif synclass == '\\RESET_POLICY AddDuration' then resetPolicy = 'AddDuration' elseif synclass == '\\RESET_POLICY NewInstance' then resetPolicy = 'NewInstance' elseif synclass == '\\COMMAND' then command = '' elseif command then if synclass == '\\LOCATION' then command = command .. '\\LOCATION ' elseif synclass == '\\WORKER_ID' then command = command .. '\\WORKER_ID ' elseif synclass == '\\REACTION_INDEX' then warnings = warnings .. ('Warning: \\REACTION_INDEX is deprecated. Use \\REACTION_NAME instead.\n') command = command .. '\\REACTION_NAME ' else commandStr = true command = command .. maybeQuote(synclass) .. ' ' end end end if foundAutoSyndrome then if destroyRock then warnings = warnings .. ('Warning: instead of destroying the rock, do not produce it in the first place.\n') end if workerOnly then workerOnly = 'true' else workerOnly = 'false' end if allowMultipleTargets then allowMultipleTargets = 'true' else allowMultipleTargets = 'false' end local reactionTriggerStr = 'modtools/reaction-trigger -reactionName ' .. maybeQuote(reaction.code) --.. '"' if workerOnly ~= 'true' then reactionTriggerStr = reactionTriggerStr .. ' -workerOnly ' .. workerOnly end if allowMultipleTargets ~= 'false' then reactionTriggerStr = reactionTriggerStr .. ' -allowMultipleTargets ' .. allowMultipleTargets end if resetPolicy and resetPolicy ~= 'NewInstance' then reactionTriggerStr = reactionTriggerStr .. ' -resetPolicy ' .. resetPolicy end if #syndrome.ce > 0 then if syndrome.syn_name == '' then warnings = warnings .. ('Warning: give this syndrome a name!\n') end reactionTriggerStr = reactionTriggerStr .. ' -syndrome ' .. maybeQuote(syndrome.syn_name) .. '' end if command and commandStr then reactionTriggerStr = reactionTriggerStr .. ' -command [ ' .. command .. ']' end if (not command or command == '') and (not syndrome.syn_name or syndrome.syn_name == '') then --output = output .. '#' else if not didInorganicName then -- output = output .. '# ' .. (inorganic.id) .. '\n' didInorganicName = true end output = output .. (reactionTriggerStr) .. '\n' end end end end for _,product in ipairs(reaction.products) do foreachProduct(product) end end print(warnings) print('\n\n\n\n') print(output) local file = io.open('reaction-trigger-transition.txt', 'w+') --io.output(file) --file:write(warnings) --file:write('\n\n\n\n') file:write(output) file:flush() --io.flush(file) io.close(file) --io.output() print('transition information written to reaction-trigger-transition.txt')
mit
TheAnswer/FirstTest
bin/scripts/creatures/objects/talus/npcs/fedDub/fedDubCommander.lua
1
4571
--Copyright (C) 2008 <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. fedDubCommander = Creature:new { objectName = "fedDubCommander", -- Lua Object Name creatureType = "NPC", faction = "fed_dub", factionPoints = 20, gender = "", speciesName = "fed_dub_commander", stfName = "mob/creature_names", objectCRC = 2942933226, socialGroup = "fed_dub", level = 23, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG, healthMax = 6600, healthMin = 5400, strength = 0, constitution = 0, actionMax = 6600, actionMin = 5400, quickness = 0, stamina = 0, mindMax = 6600, mindMin = 5400, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 30, electricity = 40, stun = -1, blast = 0, heat = 40, cold = -1, acid = -1, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 1, stalker = 0, killer = 0, ferocity = 0, aggressive = 0, invincible = 0, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 200, weaponMaxDamage = 210, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 0, hideType = "", hideMax = 0, meatType = "", meatMax = 0, skills = { "fedDubAttack1" }, respawnTimer = 180, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(fedDubCommander, 2942933226) -- Add to Global Table
lgpl-3.0
javierojan/copia
plugins/lyrics.lua
695
2113
do local BASE_LNM_URL = 'http://api.lyricsnmusic.com/songs' local LNM_APIKEY = '1f5ea5cf652d9b2ba5a5118a11dba5' local BASE_LYRICS_URL = 'http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect' local function getInfo(query) print('Getting info of ' .. query) local url = BASE_LNM_URL..'?api_key='..LNM_APIKEY ..'&q='..URL.escape(query) local b, c = http.request(url) if c ~= 200 then return nil end local result = json:decode(b) local artist = result[1].artist.name local track = result[1].title return artist, track end local function getLyrics(query) local artist, track = getInfo(query) if artist and track then local url = BASE_LYRICS_URL..'?artist='..URL.escape(artist) ..'&song='..URL.escape(track) local b, c = http.request(url) if c ~= 200 then return nil end local xml = require("xml") local result = xml.load(b) if not result then return nil end if xml.find(result, 'LyricSong') then track = xml.find(result, 'LyricSong')[1] end if xml.find(result, 'LyricArtist') then artist = xml.find(result, 'LyricArtist')[1] end local lyric if xml.find(result, 'Lyric') then lyric = xml.find(result, 'Lyric')[1] else lyric = nil end local cover if xml.find(result, 'LyricCovertArtUrl') then cover = xml.find(result, 'LyricCovertArtUrl')[1] else cover = nil end return artist, track, lyric, cover else return nil end end local function run(msg, matches) local artist, track, lyric, cover = getLyrics(matches[1]) if track and artist and lyric then if cover then local receiver = get_receiver(msg) send_photo_from_url(receiver, cover) end return '🎵 ' .. artist .. ' - ' .. track .. ' 🎵\n----------\n' .. lyric else return 'Oops! Lyrics not found or something like that! :/' end end return { description = 'Getting lyrics of a song', usage = '!lyrics [track or artist - track]: Search and get lyrics of the song', patterns = { '^!lyrics? (.*)$' }, run = run } end
gpl-2.0
dani-sj/danyal01
plugins/Lyrics.lua
695
2113
do local BASE_LNM_URL = 'http://api.lyricsnmusic.com/songs' local LNM_APIKEY = '1f5ea5cf652d9b2ba5a5118a11dba5' local BASE_LYRICS_URL = 'http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect' local function getInfo(query) print('Getting info of ' .. query) local url = BASE_LNM_URL..'?api_key='..LNM_APIKEY ..'&q='..URL.escape(query) local b, c = http.request(url) if c ~= 200 then return nil end local result = json:decode(b) local artist = result[1].artist.name local track = result[1].title return artist, track end local function getLyrics(query) local artist, track = getInfo(query) if artist and track then local url = BASE_LYRICS_URL..'?artist='..URL.escape(artist) ..'&song='..URL.escape(track) local b, c = http.request(url) if c ~= 200 then return nil end local xml = require("xml") local result = xml.load(b) if not result then return nil end if xml.find(result, 'LyricSong') then track = xml.find(result, 'LyricSong')[1] end if xml.find(result, 'LyricArtist') then artist = xml.find(result, 'LyricArtist')[1] end local lyric if xml.find(result, 'Lyric') then lyric = xml.find(result, 'Lyric')[1] else lyric = nil end local cover if xml.find(result, 'LyricCovertArtUrl') then cover = xml.find(result, 'LyricCovertArtUrl')[1] else cover = nil end return artist, track, lyric, cover else return nil end end local function run(msg, matches) local artist, track, lyric, cover = getLyrics(matches[1]) if track and artist and lyric then if cover then local receiver = get_receiver(msg) send_photo_from_url(receiver, cover) end return '🎵 ' .. artist .. ' - ' .. track .. ' 🎵\n----------\n' .. lyric else return 'Oops! Lyrics not found or something like that! :/' end end return { description = 'Getting lyrics of a song', usage = '!lyrics [track or artist - track]: Search and get lyrics of the song', patterns = { '^!lyrics? (.*)$' }, run = run } end
gpl-2.0
praveenjha527/Algorithm-Implementations
Factorial/Lua/Yonaba/factorial_test.lua
27
1336
-- Tests for factorial.lua local fact = require 'factorial' local total, pass = 0, 0 local function dec(str, len) return #str < len and str .. (('.'):rep(len-#str)) or str:sub(1,len) end local function run(message, f) total = total + 1 local ok, err = pcall(f) if ok then pass = pass + 1 end local status = ok and 'PASSED' or 'FAILED' print(('%02d. %68s: %s'):format(total, dec(message,68), status)) end run('Factorial.recursive should fail these tests', function() assert(not pcall(fact.recursive)) assert(not pcall(fact.recursive, -1)) end) run('Testing factorial.recursive', function() assert(fact.recursive(0) == 1) assert(fact.recursive(1) == 1) assert(fact.recursive(5) == 120) assert(fact.recursive(15) == 1307674368000) end) run('Factorial.iterative should fail these tests', function() assert(not pcall(fact.iterative)) assert(not pcall(fact.iterative, -1)) end) run('Testing factorial.iterative', function() assert(fact.iterative(0) == 1) assert(fact.iterative(1) == 1) assert(fact.iterative(5) == 120) assert(fact.iterative(15) == 1307674368000) end) print(('-'):rep(80)) print(('Total : %02d: Pass: %02d - Failed : %02d - Success: %.2f %%') :format(total, pass, total-pass, (pass*100/total)))
mit
Andrettin/Wyrmsun
scripts/civilizations/magyar/factions.lua
1
1420
-- _________ __ __ -- / _____// |_____________ _/ |______ ____ __ __ ______ -- \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ -- / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ -- /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > -- \/ \/ \//_____/ \/ -- ______________________ ______________________ -- T H E W A R B E G I N S -- Stratagus - A free fantasy real time strategy game engine -- -- (c) Copyright 2016-2022 by Andrettin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --
gpl-2.0
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/tailor/noviceTailor/ribbedShirt.lua
1
3789
--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. ribbedShirt = Object:new { objectName = "Ribbed Shirt", stfName = "shirt_s09", stfFile = "wearables_name", objectCRC = 356008946, groupName = "craftClothingNoviceGroupB", -- Group schematic is awarded in (See skills table) craftingToolTab = 8, -- (See DraftSchemticImplementation.h) complexity = 17, size = 3, xpType = "crafting_clothing_general", xp = 140, assemblySkill = "clothing_assembly", experimentingSkill = "clothing_experimentation", ingredientTemplateNames = "craft_clothing_ingredients_n, craft_clothing_ingredients_n", ingredientTitleNames = "body, binding_and_hardware", ingredientSlotType = "0, 0", resourceTypes = "fiberplast, metal", resourceQuantities = "30, 30", combineTypes = "0, 0", contribution = "100, 100", numberExperimentalProperties = "1, 1, 1, 1", experimentalProperties = "XX, XX, XX, XX", experimentalWeights = "1, 1, 1, 1", experimentalGroupTitles = "null, null, null, null", experimentalSubGroupTitles = "null, null, sockets, hitpoints", experimentalMin = "0, 0, 0, 1000", experimentalMax = "0, 0, 0, 1000", experimentalPrecision = "0, 0, 0, 0", tanoAttributes = "objecttype=16777230:objectcrc=2938825966:stfFile=craft_clothing_ingredients_n:stfName=clothing_shirt_field_09:stfDetail=:itemmask=62975::", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "/private/index_color_1, /private/index_color_2", customizationDefaults = "158, 255", customizationSkill = "clothing_customization" } DraftSchematics:addDraftSchematic(ribbedShirt, 356008946)--- Add to global DraftSchematics table
lgpl-3.0
Lunovox/minetest_nibirus_game
mods/add/modify_coal/init.lua
1
1539
local recipes = {"default:tree", "default:jungletree", "watershed:pinetree", "watershed:acaciatree"} --Materiais q deve ser queimados --Faz carvao queimando lenhas!!!! minetest.register_craftitem(":default:coal_lump", { description = "Pepita de Carvao", inventory_image = "default_coal_lump.png", liquids_pointable = true, -- Pode apontar para node de Liquidos (mais tarde podera coletar agua) on_use = function(itemstack, user, pointed_thing) if pointed_thing.under~=nil then local node = minetest.get_node(pointed_thing.under) --minetest.chat_send_player(user:get_player_name(), "Voce esta apontando para '".. node.name .."'!") if node.name == "default:water_source" or node.name == "default:water_flowing" then minetest.sound_play("sfx_water", { pos=user:getpos(), gain = 6.0, max_hear_distance = 5, }) user:get_inventory():add_item("main", ItemStack("dye:dark_grey")) itemstack:take_item() return itemstack else minetest.chat_send_player(user:get_player_name(), "Voce nao pode molhar esse carvao aqui!") --minetest.sound_play("sound_healing", {pos=user.pos, max_hear_distance = 30}) --toca som "sound_healing".ogg a distancia de 30 blocos do usuario. return end end end, }) for n, obj in pairs(recipes) do minetest.register_craft({ type = "cooking", output = "default:coal_lump", recipe = recipes[n], cooktime = 2, --2 segundos de queima }) end minetest.log('action',"[MODIFY_COAL] Reinstanciando funcao 'on_use()' no 'carvao' do mod 'default'...")
agpl-3.0
TheAnswer/FirstTest
bin/scripts/crafting/objects/draftschematics/tailor/casualWearIvComplexClothing/shortSkirt.lua
1
4543
--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. shortSkirt = Object:new { objectName = "Short Skirt", stfName = "pants_s18", stfFile = "wearables_name", objectCRC = 3253979633, groupName = "craftClothingCasualGroupD", -- Group schematic is awarded in (See skills table) craftingToolTab = 8, -- (See DraftSchemticImplementation.h) complexity = 17, size = 3, xpType = "crafting_clothing_general", xp = 110, assemblySkill = "clothing_assembly", experimentingSkill = "clothing_experimentation", ingredientTemplateNames = "craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n, craft_clothing_ingredients_n", ingredientTitleNames = "body, binding_and_reinforcement, hardware, lining", ingredientSlotType = "2, 0, 1, 1", resourceTypes = "object/tangible/component/clothing/shared_synthetic_cloth.iff, petrochem_inert, object/tangible/component/clothing/shared_metal_fasteners.iff, object/tangible/component/clothing/shared_synthetic_cloth.iff", resourceQuantities = "1, 40, 3, 2", combineTypes = "1, 0, 1, 1", contribution = "100, 100, 100, 100", numberExperimentalProperties = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1", experimentalProperties = "XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX", experimentalWeights = "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1", experimentalGroupTitles = "null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null", experimentalSubGroupTitles = "null, null, sockets, hitpoints, mod_idx_one, mod_val_one, mod_idx_two, mod_val_two, mod_idx_three, mod_val_three, mod_idx_four, mod_val_four, mod_idx_five, mod_val_five, mod_idx_six, mod_val_six", experimentalMin = "0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", experimentalMax = "0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", experimentalPrecision = "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", tanoAttributes = "objecttype=16777234:objectcrc=951254169:stfFile=craft_clothing_ingredients_n:stfName=clothing_skirt_short:stfDetail=:itemmask=62974::", blueFrogAttributes = "", blueFrogEnabled = False, customizationOptions = "/private/index_color_1, /private/index_color_2", customizationDefaults = "18, 13", customizationSkill = "clothing_customization" } DraftSchematics:addDraftSchematic(shortSkirt, 3253979633)--- Add to global DraftSchematics table
lgpl-3.0
Andrettin/Wyrmsun
scripts/languages/slavic/czech.lua
1
2864
-- _________ __ __ -- / _____// |_____________ _/ |______ ____ __ __ ______ -- \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ -- / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ -- /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > -- \/ \/ \//_____/ \/ -- ______________________ ______________________ -- T H E W A R B E G I N S -- Stratagus - A free fantasy real time strategy game engine -- -- (c) Copyright 2016-2022 by Andrettin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- DefineLanguageWord("Bitva", { -- Source: Carl D. Buck, "Words for 'Battle,' 'War,' 'Army,' and 'Soldier'", 1919, p. 4. Language = "czech", -- source gives Bohemian Type = "noun", Meanings = {"Battle"} }) DefineLanguageWord("Boj", { -- Source: Carl D. Buck, "Words for 'Battle,' 'War,' 'Army,' and 'Soldier'", 1919, p. 4. Language = "czech", -- source gives Bohemian Type = "noun", Meanings = {"Battle"} }) DefineLanguageWord("Perun", { -- Source: H. Munro Chadwick, "The Oak and the Thunder-God", 1900, p. 27. Language = "czech", -- source gives "Čech." Type = "noun", Meanings = {"Thunderbolt"} }) DefineLanguageWord("Pluk", { -- Source: Carl D. Buck, "Words for 'Battle,' 'War,' 'Army,' and 'Soldier'", 1919, p. 9. Language = "czech", -- source gives Bohemian Type = "noun", Meanings = {"Regiment"} }) DefineLanguageWord("Vojak", { -- Source: Carl D. Buck, "Words for 'Battle,' 'War,' 'Army,' and 'Soldier'", 1919, p. 16. Language = "czech", -- source gives Bohemian Type = "noun", Meanings = {"Soldier"} }) DefineLanguageWord("Vojna", { -- Source: Carl D. Buck, "Words for 'Battle,' 'War,' 'Army,' and 'Soldier'", 1919, p. 8. Language = "czech", -- source gives Bohemian Type = "noun", Meanings = {"War"} }) DefineLanguageWord("Vojsko", { -- Source: Carl D. Buck, "Words for 'Battle,' 'War,' 'Army,' and 'Soldier'", 1919, p. 15. Language = "czech", -- source gives Bohemian Type = "noun", Meanings = {"Army"} })
gpl-2.0
Andrettin/Wyrmsun
scripts/world_earth_tiles_scandinavia.lua
1
2976
-- _________ __ __ -- / _____// |_____________ _/ |______ ____ __ __ ______ -- \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ -- / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ -- /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > -- \/ \/ \//_____/ \/ -- ______________________ ______________________ -- T H E W A R B E G I N S -- Stratagus - A free fantasy real time strategy game engine -- -- (c) Copyright 2016-2022 by Andrettin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- DefineWorldMapTile({495, 84}, { World = "earth", CulturalSettlementNames = { "norse", "Bergen" } }) DefineWorldMapTile({496, 88}, { World = "earth", CulturalSettlementNames = { "norse", "Stavanger" } }) DefineWorldMapTile({508, 86}, { World = "earth", CulturalSettlementNames = { "norse", "Skiringssalr", -- Source: Snorri Sturlson, "Heimskringla", 1844, vol. 1, p. 257. "norse", "Geirstadir" -- Source: Snorri Sturlson, "Heimskringla", 1844, vol. 1, p. 261. } }) DefineWorldMapTile({509, 75}, { World = "earth", CulturalSettlementNames = { "norse", "Trondheim" } }) DefineWorldMapTile({510, 81}, { World = "earth", CulturalSettlementNames = { "norse", "Lillehammar" } }) DefineWorldMapTile({511, 86}, { World = "earth", CulturalSettlementNames = { "norse", "Moss" } }) DefineWorldMapTile({512, 73}, { World = "earth", CulturalSettlementNames = { "norse", "Steinkjet" } }) DefineWorldMapTile({521, 64}, { World = "earth", CulturalSettlementNames = { "norse", "Bodø" } }) DefineWorldMapTile({530, 77}, { World = "earth", CulturalSettlementNames = { "norse", "Härnösand" } }) -- Fyrisvellir: name of the plains around Upsal-water (Sweden); Source: Snorri Sturlson, "Heimskringla", 1844, vol. 1, p. 235. -- Myrkvafiord: name of a fiord in Sodermanland (Sweden); Source: Snorri Sturlson, "Heimskringla", 1844, vol. 1, p. 251. -- Eydiskogr: name of a great uninhabited forest which used to cover the Swedish-Norwegian border on the south; Source: Snorri Sturlson, "Heimskringla", 1844, vol. 1, p. 256.
gpl-2.0
yobiya/tdd_game_sample
cross/cocos2d/external/lua/luajit/src/src/jit/bcsave.lua
78
18123
---------------------------------------------------------------------------- -- LuaJIT module to save/list bytecode. -- -- Copyright (C) 2005-2013 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- -- This module saves or lists the bytecode for an input file. -- It's run by the -b command line option. -- ------------------------------------------------------------------------------ local jit = require("jit") assert(jit.version_num == 20001, "LuaJIT core/library version mismatch") local bit = require("bit") -- Symbol name prefix for LuaJIT bytecode. local LJBC_PREFIX = "luaJIT_BC_" ------------------------------------------------------------------------------ local function usage() io.stderr:write[[ Save LuaJIT bytecode: luajit -b[options] input output -l Only list bytecode. -s Strip debug info (default). -g Keep debug info. -n name Set module name (default: auto-detect from input name). -t type Set output file type (default: auto-detect from output name). -a arch Override architecture for object files (default: native). -o os Override OS for object files (default: native). -e chunk Use chunk string as input. -- Stop handling options. - Use stdin as input and/or stdout as output. File types: c h obj o raw (default) ]] os.exit(1) end local function check(ok, ...) if ok then return ok, ... end io.stderr:write("luajit: ", ...) io.stderr:write("\n") os.exit(1) end local function readfile(input) if type(input) == "function" then return input end if input == "-" then input = nil end return check(loadfile(input)) end local function savefile(name, mode) if name == "-" then return io.stdout end return check(io.open(name, mode)) end ------------------------------------------------------------------------------ local map_type = { raw = "raw", c = "c", h = "h", o = "obj", obj = "obj", } local map_arch = { x86 = true, x64 = true, arm = true, ppc = true, ppcspe = true, mips = true, mipsel = true, } local map_os = { linux = true, windows = true, osx = true, freebsd = true, netbsd = true, openbsd = true, solaris = true, } local function checkarg(str, map, err) str = string.lower(str) local s = check(map[str], "unknown ", err) return s == true and str or s end local function detecttype(str) local ext = string.match(string.lower(str), "%.(%a+)$") return map_type[ext] or "raw" end local function checkmodname(str) check(string.match(str, "^[%w_.%-]+$"), "bad module name") return string.gsub(str, "[%.%-]", "_") end local function detectmodname(str) if type(str) == "string" then local tail = string.match(str, "[^/\\]+$") if tail then str = tail end local head = string.match(str, "^(.*)%.[^.]*$") if head then str = head end str = string.match(str, "^[%w_.%-]+") else str = nil end check(str, "cannot derive module name, use -n name") return string.gsub(str, "[%.%-]", "_") end ------------------------------------------------------------------------------ local function bcsave_tail(fp, output, s) local ok, err = fp:write(s) if ok and output ~= "-" then ok, err = fp:close() end check(ok, "cannot write ", output, ": ", err) end local function bcsave_raw(output, s) local fp = savefile(output, "wb") bcsave_tail(fp, output, s) end local function bcsave_c(ctx, output, s) local fp = savefile(output, "w") if ctx.type == "c" then fp:write(string.format([[ #ifdef _cplusplus extern "C" #endif #ifdef _WIN32 __declspec(dllexport) #endif const char %s%s[] = { ]], LJBC_PREFIX, ctx.modname)) else fp:write(string.format([[ #define %s%s_SIZE %d static const char %s%s[] = { ]], LJBC_PREFIX, ctx.modname, #s, LJBC_PREFIX, ctx.modname)) end local t, n, m = {}, 0, 0 for i=1,#s do local b = tostring(string.byte(s, i)) m = m + #b + 1 if m > 78 then fp:write(table.concat(t, ",", 1, n), ",\n") n, m = 0, #b + 1 end n = n + 1 t[n] = b end bcsave_tail(fp, output, table.concat(t, ",", 1, n).."\n};\n") end local function bcsave_elfobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; uint16_t type, machine; uint32_t version; uint32_t entry, phofs, shofs; uint32_t flags; uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; } ELF32header; typedef struct { uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7]; uint16_t type, machine; uint32_t version; uint64_t entry, phofs, shofs; uint32_t flags; uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx; } ELF64header; typedef struct { uint32_t name, type, flags, addr, ofs, size, link, info, align, entsize; } ELF32sectheader; typedef struct { uint32_t name, type; uint64_t flags, addr, ofs, size; uint32_t link, info; uint64_t align, entsize; } ELF64sectheader; typedef struct { uint32_t name, value, size; uint8_t info, other; uint16_t sectidx; } ELF32symbol; typedef struct { uint32_t name; uint8_t info, other; uint16_t sectidx; uint64_t value, size; } ELF64symbol; typedef struct { ELF32header hdr; ELF32sectheader sect[6]; ELF32symbol sym[2]; uint8_t space[4096]; } ELF32obj; typedef struct { ELF64header hdr; ELF64sectheader sect[6]; ELF64symbol sym[2]; uint8_t space[4096]; } ELF64obj; ]] local symname = LJBC_PREFIX..ctx.modname local is64, isbe = false, false if ctx.arch == "x64" then is64 = true elseif ctx.arch == "ppc" or ctx.arch == "ppcspe" or ctx.arch == "mips" then isbe = true end -- Handle different host/target endianess. local function f32(x) return x end local f16, fofs = f32, f32 if ffi.abi("be") ~= isbe then f32 = bit.bswap function f16(x) return bit.rshift(bit.bswap(x), 16) end if is64 then local two32 = ffi.cast("int64_t", 2^32) function fofs(x) return bit.bswap(x)*two32 end else fofs = f32 end end -- Create ELF object and fill in header. local o = ffi.new(is64 and "ELF64obj" or "ELF32obj") local hdr = o.hdr if ctx.os == "bsd" or ctx.os == "other" then -- Determine native hdr.eosabi. local bf = assert(io.open("/bin/ls", "rb")) local bs = bf:read(9) bf:close() ffi.copy(o, bs, 9) check(hdr.emagic[0] == 127, "no support for writing native object files") else hdr.emagic = "\127ELF" hdr.eosabi = ({ freebsd=9, netbsd=2, openbsd=12, solaris=6 })[ctx.os] or 0 end hdr.eclass = is64 and 2 or 1 hdr.eendian = isbe and 2 or 1 hdr.eversion = 1 hdr.type = f16(1) hdr.machine = f16(({ x86=3, x64=62, arm=40, ppc=20, ppcspe=20, mips=8, mipsel=8 })[ctx.arch]) if ctx.arch == "mips" or ctx.arch == "mipsel" then hdr.flags = 0x50001006 end hdr.version = f32(1) hdr.shofs = fofs(ffi.offsetof(o, "sect")) hdr.ehsize = f16(ffi.sizeof(hdr)) hdr.shentsize = f16(ffi.sizeof(o.sect[0])) hdr.shnum = f16(6) hdr.shstridx = f16(2) -- Fill in sections and symbols. local sofs, ofs = ffi.offsetof(o, "space"), 1 for i,name in ipairs{ ".symtab", ".shstrtab", ".strtab", ".rodata", ".note.GNU-stack", } do local sect = o.sect[i] sect.align = fofs(1) sect.name = f32(ofs) ffi.copy(o.space+ofs, name) ofs = ofs + #name+1 end o.sect[1].type = f32(2) -- .symtab o.sect[1].link = f32(3) o.sect[1].info = f32(1) o.sect[1].align = fofs(8) o.sect[1].ofs = fofs(ffi.offsetof(o, "sym")) o.sect[1].entsize = fofs(ffi.sizeof(o.sym[0])) o.sect[1].size = fofs(ffi.sizeof(o.sym)) o.sym[1].name = f32(1) o.sym[1].sectidx = f16(4) o.sym[1].size = fofs(#s) o.sym[1].info = 17 o.sect[2].type = f32(3) -- .shstrtab o.sect[2].ofs = fofs(sofs) o.sect[2].size = fofs(ofs) o.sect[3].type = f32(3) -- .strtab o.sect[3].ofs = fofs(sofs + ofs) o.sect[3].size = fofs(#symname+1) ffi.copy(o.space+ofs+1, symname) ofs = ofs + #symname + 2 o.sect[4].type = f32(1) -- .rodata o.sect[4].flags = fofs(2) o.sect[4].ofs = fofs(sofs + ofs) o.sect[4].size = fofs(#s) o.sect[5].type = f32(1) -- .note.GNU-stack o.sect[5].ofs = fofs(sofs + ofs + #s) -- Write ELF object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) bcsave_tail(fp, output, s) end local function bcsave_peobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint16_t arch, nsects; uint32_t time, symtabofs, nsyms; uint16_t opthdrsz, flags; } PEheader; typedef struct { char name[8]; uint32_t vsize, vaddr, size, ofs, relocofs, lineofs; uint16_t nreloc, nline; uint32_t flags; } PEsection; typedef struct __attribute((packed)) { union { char name[8]; uint32_t nameref[2]; }; uint32_t value; int16_t sect; uint16_t type; uint8_t scl, naux; } PEsym; typedef struct __attribute((packed)) { uint32_t size; uint16_t nreloc, nline; uint32_t cksum; uint16_t assoc; uint8_t comdatsel, unused[3]; } PEsymaux; typedef struct { PEheader hdr; PEsection sect[2]; // Must be an even number of symbol structs. PEsym sym0; PEsymaux sym0aux; PEsym sym1; PEsymaux sym1aux; PEsym sym2; PEsym sym3; uint32_t strtabsize; uint8_t space[4096]; } PEobj; ]] local symname = LJBC_PREFIX..ctx.modname local is64 = false if ctx.arch == "x86" then symname = "_"..symname elseif ctx.arch == "x64" then is64 = true end local symexport = " /EXPORT:"..symname..",DATA " -- The file format is always little-endian. Swap if the host is big-endian. local function f32(x) return x end local f16 = f32 if ffi.abi("be") then f32 = bit.bswap function f16(x) return bit.rshift(bit.bswap(x), 16) end end -- Create PE object and fill in header. local o = ffi.new("PEobj") local hdr = o.hdr hdr.arch = f16(({ x86=0x14c, x64=0x8664, arm=0x1c0, ppc=0x1f2, mips=0x366, mipsel=0x366 })[ctx.arch]) hdr.nsects = f16(2) hdr.symtabofs = f32(ffi.offsetof(o, "sym0")) hdr.nsyms = f32(6) -- Fill in sections and symbols. o.sect[0].name = ".drectve" o.sect[0].size = f32(#symexport) o.sect[0].flags = f32(0x00100a00) o.sym0.sect = f16(1) o.sym0.scl = 3 o.sym0.name = ".drectve" o.sym0.naux = 1 o.sym0aux.size = f32(#symexport) o.sect[1].name = ".rdata" o.sect[1].size = f32(#s) o.sect[1].flags = f32(0x40300040) o.sym1.sect = f16(2) o.sym1.scl = 3 o.sym1.name = ".rdata" o.sym1.naux = 1 o.sym1aux.size = f32(#s) o.sym2.sect = f16(2) o.sym2.scl = 2 o.sym2.nameref[1] = f32(4) o.sym3.sect = f16(-1) o.sym3.scl = 2 o.sym3.value = f32(1) o.sym3.name = "@feat.00" -- Mark as SafeSEH compliant. ffi.copy(o.space, symname) local ofs = #symname + 1 o.strtabsize = f32(ofs + 4) o.sect[0].ofs = f32(ffi.offsetof(o, "space") + ofs) ffi.copy(o.space + ofs, symexport) ofs = ofs + #symexport o.sect[1].ofs = f32(ffi.offsetof(o, "space") + ofs) -- Write PE object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs)) bcsave_tail(fp, output, s) end local function bcsave_machobj(ctx, output, s, ffi) ffi.cdef[[ typedef struct { uint32_t magic, cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags; } mach_header; typedef struct { mach_header; uint32_t reserved; } mach_header_64; typedef struct { uint32_t cmd, cmdsize; char segname[16]; uint32_t vmaddr, vmsize, fileoff, filesize; uint32_t maxprot, initprot, nsects, flags; } mach_segment_command; typedef struct { uint32_t cmd, cmdsize; char segname[16]; uint64_t vmaddr, vmsize, fileoff, filesize; uint32_t maxprot, initprot, nsects, flags; } mach_segment_command_64; typedef struct { char sectname[16], segname[16]; uint32_t addr, size; uint32_t offset, align, reloff, nreloc, flags; uint32_t reserved1, reserved2; } mach_section; typedef struct { char sectname[16], segname[16]; uint64_t addr, size; uint32_t offset, align, reloff, nreloc, flags; uint32_t reserved1, reserved2, reserved3; } mach_section_64; typedef struct { uint32_t cmd, cmdsize, symoff, nsyms, stroff, strsize; } mach_symtab_command; typedef struct { int32_t strx; uint8_t type, sect; int16_t desc; uint32_t value; } mach_nlist; typedef struct { uint32_t strx; uint8_t type, sect; uint16_t desc; uint64_t value; } mach_nlist_64; typedef struct { uint32_t magic, nfat_arch; } mach_fat_header; typedef struct { uint32_t cputype, cpusubtype, offset, size, align; } mach_fat_arch; typedef struct { struct { mach_header hdr; mach_segment_command seg; mach_section sec; mach_symtab_command sym; } arch[1]; mach_nlist sym_entry; uint8_t space[4096]; } mach_obj; typedef struct { struct { mach_header_64 hdr; mach_segment_command_64 seg; mach_section_64 sec; mach_symtab_command sym; } arch[1]; mach_nlist_64 sym_entry; uint8_t space[4096]; } mach_obj_64; typedef struct { mach_fat_header fat; mach_fat_arch fat_arch[4]; struct { mach_header hdr; mach_segment_command seg; mach_section sec; mach_symtab_command sym; } arch[4]; mach_nlist sym_entry; uint8_t space[4096]; } mach_fat_obj; ]] local symname = '_'..LJBC_PREFIX..ctx.modname local isfat, is64, align, mobj = false, false, 4, "mach_obj" if ctx.arch == "x64" then is64, align, mobj = true, 8, "mach_obj_64" elseif ctx.arch == "arm" then isfat, mobj = true, "mach_fat_obj" else check(ctx.arch == "x86", "unsupported architecture for OSX") end local function aligned(v, a) return bit.band(v+a-1, -a) end local be32 = bit.bswap -- Mach-O FAT is BE, supported archs are LE. -- Create Mach-O object and fill in header. local o = ffi.new(mobj) local mach_size = aligned(ffi.offsetof(o, "space")+#symname+2, align) local cputype = ({ x86={7}, x64={0x01000007}, arm={7,12,12,12} })[ctx.arch] local cpusubtype = ({ x86={3}, x64={3}, arm={3,6,9,11} })[ctx.arch] if isfat then o.fat.magic = be32(0xcafebabe) o.fat.nfat_arch = be32(#cpusubtype) end -- Fill in sections and symbols. for i=0,#cpusubtype-1 do local ofs = 0 if isfat then local a = o.fat_arch[i] a.cputype = be32(cputype[i+1]) a.cpusubtype = be32(cpusubtype[i+1]) -- Subsequent slices overlap each other to share data. ofs = ffi.offsetof(o, "arch") + i*ffi.sizeof(o.arch[0]) a.offset = be32(ofs) a.size = be32(mach_size-ofs+#s) end local a = o.arch[i] a.hdr.magic = is64 and 0xfeedfacf or 0xfeedface a.hdr.cputype = cputype[i+1] a.hdr.cpusubtype = cpusubtype[i+1] a.hdr.filetype = 1 a.hdr.ncmds = 2 a.hdr.sizeofcmds = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)+ffi.sizeof(a.sym) a.seg.cmd = is64 and 0x19 or 0x1 a.seg.cmdsize = ffi.sizeof(a.seg)+ffi.sizeof(a.sec) a.seg.vmsize = #s a.seg.fileoff = mach_size-ofs a.seg.filesize = #s a.seg.maxprot = 1 a.seg.initprot = 1 a.seg.nsects = 1 ffi.copy(a.sec.sectname, "__data") ffi.copy(a.sec.segname, "__DATA") a.sec.size = #s a.sec.offset = mach_size-ofs a.sym.cmd = 2 a.sym.cmdsize = ffi.sizeof(a.sym) a.sym.symoff = ffi.offsetof(o, "sym_entry")-ofs a.sym.nsyms = 1 a.sym.stroff = ffi.offsetof(o, "sym_entry")+ffi.sizeof(o.sym_entry)-ofs a.sym.strsize = aligned(#symname+2, align) end o.sym_entry.type = 0xf o.sym_entry.sect = 1 o.sym_entry.strx = 1 ffi.copy(o.space+1, symname) -- Write Macho-O object file. local fp = savefile(output, "wb") fp:write(ffi.string(o, mach_size)) bcsave_tail(fp, output, s) end local function bcsave_obj(ctx, output, s) local ok, ffi = pcall(require, "ffi") check(ok, "FFI library required to write this file type") if ctx.os == "windows" then return bcsave_peobj(ctx, output, s, ffi) elseif ctx.os == "osx" then return bcsave_machobj(ctx, output, s, ffi) else return bcsave_elfobj(ctx, output, s, ffi) end end ------------------------------------------------------------------------------ local function bclist(input, output) local f = readfile(input) require("jit.bc").dump(f, savefile(output, "w"), true) end local function bcsave(ctx, input, output) local f = readfile(input) local s = string.dump(f, ctx.strip) local t = ctx.type if not t then t = detecttype(output) ctx.type = t end if t == "raw" then bcsave_raw(output, s) else if not ctx.modname then ctx.modname = detectmodname(input) end if t == "obj" then bcsave_obj(ctx, output, s) else bcsave_c(ctx, output, s) end end end local function docmd(...) local arg = {...} local n = 1 local list = false local ctx = { strip = true, arch = jit.arch, os = string.lower(jit.os), type = false, modname = false, } while n <= #arg do local a = arg[n] if type(a) == "string" and string.sub(a, 1, 1) == "-" and a ~= "-" then table.remove(arg, n) if a == "--" then break end for m=2,#a do local opt = string.sub(a, m, m) if opt == "l" then list = true elseif opt == "s" then ctx.strip = true elseif opt == "g" then ctx.strip = false else if arg[n] == nil or m ~= #a then usage() end if opt == "e" then if n ~= 1 then usage() end arg[1] = check(loadstring(arg[1])) elseif opt == "n" then ctx.modname = checkmodname(table.remove(arg, n)) elseif opt == "t" then ctx.type = checkarg(table.remove(arg, n), map_type, "file type") elseif opt == "a" then ctx.arch = checkarg(table.remove(arg, n), map_arch, "architecture") elseif opt == "o" then ctx.os = checkarg(table.remove(arg, n), map_os, "OS name") else usage() end end end else n = n + 1 end end if list then if #arg == 0 or #arg > 2 then usage() end bclist(arg[1], arg[2] or "-") else if #arg ~= 2 then usage() end bcsave(ctx, arg[1], arg[2]) end end ------------------------------------------------------------------------------ -- Public module functions. module(...) start = docmd -- Process -b command line option.
mit
TheAnswer/FirstTest
bin/scripts/slashcommands/skills/healStates.lua
1
2560
--Copyright (C) 2007 <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. --true = 1, false = 0 HealStatesSlashCommand = { name = "healstates", alternativeNames = "", animation = "", invalidStateMask = 3894805544, --aiming, berzerk, tumbling, frozen, swimming, glowingJedi, ridingMount, pilotingShip, shipOperations, shipGunner, invalidPostures = "3,5,6,9,10,11,13,14,", target = 0, targeType = 2, disabled = 0, maxRangeToTarget = 0, --adminLevel = 0, addToCombatQueue = 1, } AddHealStatesSlashCommand(HealStatesSlashCommand)
lgpl-3.0
Xeltor/ovale
dist/spellhelpers/shaman_restoration_helper.lua
1
3839
local __exports = LibStub:GetLibrary("ovale/scripts/ovale_shaman") if not __exports then return end __exports.registerShamanRestorationHelper = function(OvaleScripts) do local name = "SHAWMUNRESTOhelp" local desc = "[Xel][7.x] Spellhelper: Restoration" local code = [[ AddIcon { # Remove a line when you have its colour # Spells Texture(spell_nature_healingwavelesser) # Healing Wave Texture(spell_nature_healingway) # Healing Surge Texture(spell_nature_riptide) # Riptide Texture(spell_nature_healingwavegreater) # Chain Heal Texture(spell_nature_giftofthewaterspirit) # Healing Rain Texture(ability_shaman_cleansespirit) # Purify Spirit Texture(spell_nature_cyclone) # Wind Shear # Buffs Texture(spell_shaman_spiritwalkersgrace) # Spiritwalker's Grace Texture(ability_shaman_astralshift) # Astral Shift Texture(inv_spear_04) # Healing Stream Totem Texture(ability_shaman_healingtide) # Healing Tide Totem Texture(spell_shaman_spiritlink) # Spirit Link Totem Texture(spell_nature_spiritwolf) # Ghost Wolf # Artifact Texture(inv_mace_1h_artifactazshara_d_02) # Gift of the Queen # Heart of Azeroth Skills Texture(spell_azerite_essence_15) # Concentrated Flame Texture(spell_azerite_essence05) # Memory of Lucid Dreams Texture(298277) # Blood of the Enemy Texture(spell_azerite_essence14) # Guardian of Azeroth Texture(spell_azerite_essence12) # Focused Azerite Beam Texture(spell_azerite_essence04) # Purifying Blast Texture(spell_azerite_essence10) # Ripple in Space Texture(spell_azerite_essence03) # The Unbound Force Texture(inv_misc_azerite_01) # Worldvein Resonance Texture(ability_essence_reapingflames) # Reaping Flames Texture(ability_essence_momentofglory) # Moment of Glory Texture(ability_essence_replicaofknowledge) # Replica of Knowledge # Talents Texture(spell_shaman_unleashweapon_life) # Unleash Life (T1) Texture(ability_skyreach_four_wind) # Gust of Wind (T2) Texture(ability_shaman_windwalktotem) # Wind Rush Totem (T2) Texture(spell_nature_brilliance) # Lightning Surge Totem (T3) Texture(spell_nature_stranglevines) # Earthgrab Totem (T3) Texture(spell_totem_wardofdraining) # Voodoo Totem (T3) Texture(ability_shaman_ancestralguidance) # Ancestral Guidance (T4) Texture(spell_nature_reincarnation) # Ancestral Protection Totem (T5) Texture(spell_nature_stoneskintotem) # Earthen Shield Totem (T5) Texture(ability_shaman_condensationtotem) # Cloudburst Totem (T6) Texture(spell_fire_elementaldevastation) # Ascendance (T7) Texture(ability_shawaterelemental_split) # Wellspring (T7) # Racials Texture(racial_orc_berserkerstrength) # Blood Fury (Orc) Texture(racial_troll_berserk) # Berserking (Troll) Texture(ability_warstomp) # War Stomp (Tauren) Texture(spell_shadow_raisedead) # Will of the Forsaken (Undead) Texture(inv_gizmo_rocketlauncher) # Rocket Barrage (Goblin) Texture(pandarenracial_quiveringpain) # Quaking Palm (Pandaren) Texture(spell_shadow_unholystrength) # Stoneform (Dwarf) Texture(spell_holy_holyprotection) # Gift of the Naaru (Draenei) Texture(ability_racial_forceshield) # Arcane Pulse (Nightborne) Texture(ability_racial_bullrush) # Bull Rush (Highmountain Tauren) Texture(ability_racial_orbitalstrike) # Light's Judgment (Lightforged Draenei) Texture(ability_racial_ancestralcall) # Ancestral Call (Mag'har Orcs) Texture(ability_racial_fireblood) # Fireblood (Dark Iron Dwarves) Texture(ability_racial_haymaker) # Haymaker (Kul Tiran Human) Texture(ability_racial_regeneratin) # Regeneratin (Zandalari Trolls) Texture(ability_racial_hyperorganiclightoriginator) # Hyper Organic Light Originator (Mechagnome) Texture(ability_racial_bagoftricks) # Bag of Tricks (Vulpera) } ]] OvaleScripts:RegisterScript("SHAMAN", "restoration", name, desc, code, "script") end end
mit
TheAnswer/FirstTest
bin/scripts/sceneobjects/objects/lairs/endor/bordokLair.lua
1
2502
--Copyright (C) 2007 <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. bordokLair = Lair:new { objectName = "bordokLair", stfName = "rock_shelter", objectCRC = 2816531423, maxCondition = 10000, positionX = 0, positionY = 0, positionZ = 0, planet = 3, creatureCRC = 622383012, creatureName = "bordok", creaturestfName = "a bordok", spawnSize = 5, babiesPerMillion = 500000 } Objects:addObject(bordokLair, "bordokLair") --- Add to global object
lgpl-3.0
TheAnswer/FirstTest
bin/scripts/creatures/objects/lok/creatures/vespHunter.lua
1
4748
--Copyright (C) 2008 <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. vespHunter = Creature:new { objectName = "vespHunter", -- Lua Object Name creatureType = "ANIMAL", gender = "", speciesName = "vesp_hunter", stfName = "mob/creature_names", objectCRC = 3698435149, socialGroup = "Vesp", level = 25, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 6100, healthMin = 5000, strength = 0, constitution = 0, actionMax = 6100, actionMin = 5000, quickness = 0, stamina = 0, mindMax = 6100, mindMin = 5000, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 20, energy = 20, electricity = 0, stun = -1, blast = 0, heat = 50, cold = 0, acid = 50, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 0, stalker = 0, killer = 0, ferocity = 0, aggressive = 1, invincible = 0, meleeDefense = 1, rangedDefense = 1, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 240, weaponMaxDamage = 250, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0.25, -- Likely hood to be tamed datapadItemCRC = 58797746, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 20, hideType = "hide_leathery_lok", hideMax = 5, meatType = "meat_reptilian_lok", meatMax = 10, --skills = { " Ranged attack (spit)", " Posture down attack", " Blind attack" } skills = { "vespAttack4", "vespAttack6", "vespAttack3" }, respawnTimer = 60, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(vespHunter, 3698435149) -- Add to Global Table
lgpl-3.0
zain211/zain.aliraqe
en-azan.lua
5
3803
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY jOker ▀▄ ▄▀ ▀▄ ▄▀ BY joker (@fuck_8_you) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY joker ▀▄ ▄▀ ▀▄ ▄▀ broadcast : الاذان ▀▄ ▄▀ ▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀ --]] do function run_bash(str) local cmd = io.popen(str) local result = cmd:read('*all') return result end local api_key = nil local base_api = "https://maps.googleapis.com/maps/api" function get_latlong(area) local api = base_api .. "/geocode/json?" local parameters = "address=".. (URL.escape(area) or "") if api_key ~= nil then parameters = parameters .. "&key="..api_key end local res, code = https.request(api..parameters) if code ~=200 then return nil end local data = json:decode(res) if (data.status == "ZERO_RESULTS") then return nil end if (data.status == "OK") then lat = data.results[1].geometry.location.lat lng = data.results[1].geometry.location.lng acc = data.results[1].geometry.location_type types= data.results[1].types return lat,lng,acc,types end end function get_staticmap(area) local api = base_api .. "/staticmap?" local lat,lng,acc,types = get_latlong(area) local scale = types[1] if scale=="locality" then zoom=8 elseif scale=="country" then zoom=4 else zoom = 13 end local parameters = "size=600x300" .. "&zoom=" .. zoom .. "&center=" .. URL.escape(area) .. "&markers=color:red"..URL.escape("|"..area) if api_key ~=nil and api_key ~= "" then parameters = parameters .. "&key="..api_key end return lat, lng, api..parameters end function DevPoint(msg, matches) local hash = 'usecommands:'..msg.from.id..':'..msg.to.id redis:incr(hash) local receiver = get_receiver(msg) local city = matches[1] if matches[1] == 'azan' then city = 'Baghdad' end local lat,lng,url = get_staticmap(city) local dumptime = run_bash('date +%s') local code = http.request('http://api.aladhan.com/timings/'..dumptime..'?latitude='..lat..'&longitude='..lng..'&timezonestring=Asia/Baghdad&method=7') local jdat = json:decode(code) local data = jdat.data.timings local text = '⛪️مدينة : '..city text = text..'\n🕌آذان الصبح: '..data.Fajr text = text..'\n🕌شروق الشمس: '..data.Sunrise text = text..'\n🕌آذان الظهر: '..data.Dhuhr text = text..'\n🕌الغروب: '..data.Sunset text = text..'\n🕌آذان المغرب: '..data.Maghrib text = text..'\n🕌آذان العشاء : '..data.Isha text = text..'\n\nchannel : @help_tele' if string.match(text, '0') then text = string.gsub(text, '0', '0') end if string.match(text, '1') then text = string.gsub(text, '1', '1') end if string.match(text, '2') then text = string.gsub(text, '2', '2') end if string.match(text, '3') then text = string.gsub(text, '3', '3') end if string.match(text, '4') then text = string.gsub(text, '4', '4') end if string.match(text, '5') then text = string.gsub(text, '5', '5') end if string.match(text, '6') then text = string.gsub(text, '6', '6') end if string.match(text, '7') then text = string.gsub(text, '7', '7') end if string.match(text, '8') then text = string.gsub(text, '8', '8') end if string.match(text, '9') then text = string.gsub(text, '9', '9') end return text end return { patterns = {"^azan (.*)$","^(azan)$"}, run =DevPoint } end
gpl-3.0
frioux/sysdig
userspace/sysdig/chisels/topprocs_file.lua
12
1746
--[[ Copyright (C) 2013-2014 Draios inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. --]] -- Chisel description description = "Shows the top processes in terms of total (in+out) bytes to disk. This chisel is compatable with containers using the sysdig -pc or -pcontainer argument, otherwise no container information will be shown." short_description = "Top processes by R+W disk bytes" category = "I/O" -- Chisel argument list args = {} -- The number of items to show TOP_NUMBER = 10 -- Argument notification callback function on_set_arg(name, val) return false end -- Initialization callback function on_init() -- The -pc or -pcontainer options was supplied on the cmd line print_container = sysdig.is_print_container_data() if print_container then chisel.exec("table_generator", "proc.name,proc.pid,thread.vtid,container.name", "Process,Host_pid,Container_pid,container.name", "evt.rawarg.res", "Bytes", "fd.type=file and evt.is_io=true", "" .. TOP_NUMBER, "bytes") else chisel.exec("table_generator", "proc.name,proc.pid", "Process,PID", "evt.rawarg.res", "Bytes", "fd.type=file and evt.is_io=true", "" .. TOP_NUMBER, "bytes") end return true end
gpl-2.0
JarnoVgr/ZombieSurvival
gamemodes/zombiesurvival/entities/weapons/weapon_zs_sledgehammer.lua
1
1474
AddCSLuaFile() if CLIENT then SWEP.PrintName = "Sledgehammer" SWEP.ViewModelFOV = 75 SWEP.ShowViewModel = false SWEP.ShowWorldModel = true SWEP.VElements = { ["sledge"] = { type = "Model", model = "models/weapons/w_sledgehammer.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(3.144, 1.421, 8.611), angle = Angle(0, 0, 180), size = Vector(0.899, 0.899, 0.899), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} } } end SWEP.Base = "weapon_zs_basemelee" SWEP.HoldType = "melee2" SWEP.DamageType = DMG_CLUB --SWEP.ViewModel = "models/weapons/v_sledgehammer/v_sledgehammer.mdl" SWEP.ViewModel = "models/weapons/c_stunstick.mdl" SWEP.UseHands = true SWEP.WorldModel = "models/weapons/w_sledgehammer.mdl" SWEP.MeleeDamage = 95 SWEP.MeleeRange = 64 SWEP.MeleeSize = 1.75 SWEP.MeleeKnockBack = SWEP.MeleeDamage * 1.2 SWEP.Primary.Delay = 1.3 SWEP.WalkSpeed = SPEED_SLOWEST SWEP.SwingRotation = Angle(60, 0, -80) SWEP.SwingOffset = Vector(0, -30, 0) SWEP.SwingTime = 0.75 SWEP.SwingHoldType = "melee" function SWEP:PlaySwingSound() self:EmitSound("weapons/iceaxe/iceaxe_swing1.wav", 75, math.random(35, 45)) end function SWEP:PlayHitSound() self:EmitSound("physics/metal/metal_canister_impact_hard"..math.random(3)..".wav", 75, math.Rand(86, 90)) end function SWEP:PlayHitFleshSound() self:EmitSound("physics/body/body_medium_break"..math.random(2, 4)..".wav", 75, math.Rand(86, 90)) end
gpl-2.0
sweetbot0/sweetbot
plugin/blockword.lua
1
3066
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY SAJJAD NOORI ▀▄ ▄▀ ▀▄ ▄▀ BY SAJAD NOORI (@SAJJADNOORI) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY SAJJAD NOORI ▀▄ ▄▀ ▀▄ ▄▀ block word : منع كلمات ▀▄ ▄▀ ▀▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀▄▄▀▀▄▄▀▄▄▀▀ --]] local function addword(msg, name) local hash = 'chat:'..msg.to.id..':badword' redis:hset(hash, name, 'newword') return "Add a new word has been to block list\n>"..name end local function get_variables_hash(msg) return 'chat:'..msg.to.id..':badword' end local function list_variablesbad(msg) local hash = get_variables_hash(msg) if hash then local names = redis:hkeys(hash) local text = 'Block list banned words:\n\n' for i=1, #names do text = text..'> '..names[i]..'\n' end return text else return end end function clear_commandbad(msg, var_name) --Save on redis local hash = get_variables_hash(msg) redis:del(hash, var_name) return 'It has been cleaned block list' end local function list_variables2(msg, value) local hash = get_variables_hash(msg) if hash then local names = redis:hkeys(hash) local text = '' for i=1, #names do if string.match(value, names[i]) and not is_momod(msg) then if msg.to.type == 'channel' then delete_msg(msg.id,ok_cb,false) else kick_user(msg.from.id, msg.to.id) end return end --text = text..names[i]..'\n' end end end local function get_valuebad(msg, var_name) local hash = get_variables_hash(msg) if hash then local value = redis:hget(hash, var_name) if not value then return else return value end end end function clear_commandsbad(msg, cmd_name) --Save on redis local hash = get_variables_hash(msg) redis:hdel(hash, cmd_name) return ''..cmd_name..'canceled from block list' end local function run(msg, matches) if matches[2] == 'block' then if not is_momod(msg) then return 'only for moderators' end local name = string.sub(matches[3], 1, 50) local text = addword(msg, name) return text end if matches[2] == 'block list' then return list_variablesbad(msg) elseif matches[2] == 'clean block list' then if not is_momod(msg) then return '_|_' end local asd = '1' return clear_commandbad(msg, asd) elseif matches[2] == 'unblock' or matches[2] == 'rw' then if not is_momod(msg) then return '_|_' end return clear_commandsbad(msg, matches[3]) else --local name = user_print_name(msg.from) return list_variables2(msg, matches[1]) end end return { patterns = { "^(/)(bword) (.*)$", "^(/)(uword) (.*)$", "^()(listwords)$", "^(/)(cword)$", "^(.+)$", }, run = run }
gpl-3.0
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua
1
42539
-------------------------------- -- @module cc -------------------------------------------------------- -- the cc Ref -- @field [parent=#cc] Ref#Ref Ref preloaded module -------------------------------------------------------- -- the cc Console -- @field [parent=#cc] Console#Console Console preloaded module -------------------------------------------------------- -- the cc Texture2D -- @field [parent=#cc] Texture2D#Texture2D Texture2D preloaded module -------------------------------------------------------- -- the cc Touch -- @field [parent=#cc] Touch#Touch Touch preloaded module -------------------------------------------------------- -- the cc Event -- @field [parent=#cc] Event#Event Event preloaded module -------------------------------------------------------- -- the cc EventTouch -- @field [parent=#cc] EventTouch#EventTouch EventTouch preloaded module -------------------------------------------------------- -- the cc EventKeyboard -- @field [parent=#cc] EventKeyboard#EventKeyboard EventKeyboard preloaded module -------------------------------------------------------- -- the cc Node -- @field [parent=#cc] Node#Node Node preloaded module -------------------------------------------------------- -- the cc Scene -- @field [parent=#cc] Scene#Scene Scene preloaded module -------------------------------------------------------- -- the cc GLView -- @field [parent=#cc] GLView#GLView GLView preloaded module -------------------------------------------------------- -- the cc Director -- @field [parent=#cc] Director#Director Director preloaded module -------------------------------------------------------- -- the cc Timer -- @field [parent=#cc] Timer#Timer Timer preloaded module -------------------------------------------------------- -- the cc Scheduler -- @field [parent=#cc] Scheduler#Scheduler Scheduler preloaded module -------------------------------------------------------- -- the cc FileUtils -- @field [parent=#cc] FileUtils#FileUtils FileUtils preloaded module -------------------------------------------------------- -- the cc ZipUtils -- @field [parent=#cc] ZipUtils#ZipUtils ZipUtils preloaded module -------------------------------------------------------- -- the cc ZipFile -- @field [parent=#cc] ZipFile#ZipFile ZipFile preloaded module -------------------------------------------------------- -- the cc UserDefault -- @field [parent=#cc] UserDefault#UserDefault UserDefault preloaded module -------------------------------------------------------- -- the cc EventListener -- @field [parent=#cc] EventListener#EventListener EventListener preloaded module -------------------------------------------------------- -- the cc EventDispatcher -- @field [parent=#cc] EventDispatcher#EventDispatcher EventDispatcher preloaded module -------------------------------------------------------- -- the cc EventListenerTouchOneByOne -- @field [parent=#cc] EventListenerTouchOneByOne#EventListenerTouchOneByOne EventListenerTouchOneByOne preloaded module -------------------------------------------------------- -- the cc EventListenerTouchAllAtOnce -- @field [parent=#cc] EventListenerTouchAllAtOnce#EventListenerTouchAllAtOnce EventListenerTouchAllAtOnce preloaded module -------------------------------------------------------- -- the cc EventListenerKeyboard -- @field [parent=#cc] EventListenerKeyboard#EventListenerKeyboard EventListenerKeyboard preloaded module -------------------------------------------------------- -- the cc EventMouse -- @field [parent=#cc] EventMouse#EventMouse EventMouse preloaded module -------------------------------------------------------- -- the cc EventListenerMouse -- @field [parent=#cc] EventListenerMouse#EventListenerMouse EventListenerMouse preloaded module -------------------------------------------------------- -- the cc EventAcceleration -- @field [parent=#cc] EventAcceleration#EventAcceleration EventAcceleration preloaded module -------------------------------------------------------- -- the cc EventListenerAcceleration -- @field [parent=#cc] EventListenerAcceleration#EventListenerAcceleration EventListenerAcceleration preloaded module -------------------------------------------------------- -- the cc EventCustom -- @field [parent=#cc] EventCustom#EventCustom EventCustom preloaded module -------------------------------------------------------- -- the cc EventListenerCustom -- @field [parent=#cc] EventListenerCustom#EventListenerCustom EventListenerCustom preloaded module -------------------------------------------------------- -- the cc EventFocus -- @field [parent=#cc] EventFocus#EventFocus EventFocus preloaded module -------------------------------------------------------- -- the cc EventListenerFocus -- @field [parent=#cc] EventListenerFocus#EventListenerFocus EventListenerFocus preloaded module -------------------------------------------------------- -- the cc Action -- @field [parent=#cc] Action#Action Action preloaded module -------------------------------------------------------- -- the cc FiniteTimeAction -- @field [parent=#cc] FiniteTimeAction#FiniteTimeAction FiniteTimeAction preloaded module -------------------------------------------------------- -- the cc Speed -- @field [parent=#cc] Speed#Speed Speed preloaded module -------------------------------------------------------- -- the cc Follow -- @field [parent=#cc] Follow#Follow Follow preloaded module -------------------------------------------------------- -- the cc SpriteFrame -- @field [parent=#cc] SpriteFrame#SpriteFrame SpriteFrame preloaded module -------------------------------------------------------- -- the cc AnimationFrame -- @field [parent=#cc] AnimationFrame#AnimationFrame AnimationFrame preloaded module -------------------------------------------------------- -- the cc Animation -- @field [parent=#cc] Animation#Animation Animation preloaded module -------------------------------------------------------- -- the cc ActionInterval -- @field [parent=#cc] ActionInterval#ActionInterval ActionInterval preloaded module -------------------------------------------------------- -- the cc Sequence -- @field [parent=#cc] Sequence#Sequence Sequence preloaded module -------------------------------------------------------- -- the cc Repeat -- @field [parent=#cc] Repeat#Repeat Repeat preloaded module -------------------------------------------------------- -- the cc RepeatForever -- @field [parent=#cc] RepeatForever#RepeatForever RepeatForever preloaded module -------------------------------------------------------- -- the cc Spawn -- @field [parent=#cc] Spawn#Spawn Spawn preloaded module -------------------------------------------------------- -- the cc RotateTo -- @field [parent=#cc] RotateTo#RotateTo RotateTo preloaded module -------------------------------------------------------- -- the cc RotateBy -- @field [parent=#cc] RotateBy#RotateBy RotateBy preloaded module -------------------------------------------------------- -- the cc MoveBy -- @field [parent=#cc] MoveBy#MoveBy MoveBy preloaded module -------------------------------------------------------- -- the cc MoveTo -- @field [parent=#cc] MoveTo#MoveTo MoveTo preloaded module -------------------------------------------------------- -- the cc SkewTo -- @field [parent=#cc] SkewTo#SkewTo SkewTo preloaded module -------------------------------------------------------- -- the cc SkewBy -- @field [parent=#cc] SkewBy#SkewBy SkewBy preloaded module -------------------------------------------------------- -- the cc JumpBy -- @field [parent=#cc] JumpBy#JumpBy JumpBy preloaded module -------------------------------------------------------- -- the cc JumpTo -- @field [parent=#cc] JumpTo#JumpTo JumpTo preloaded module -------------------------------------------------------- -- the cc BezierBy -- @field [parent=#cc] BezierBy#BezierBy BezierBy preloaded module -------------------------------------------------------- -- the cc BezierTo -- @field [parent=#cc] BezierTo#BezierTo BezierTo preloaded module -------------------------------------------------------- -- the cc ScaleTo -- @field [parent=#cc] ScaleTo#ScaleTo ScaleTo preloaded module -------------------------------------------------------- -- the cc ScaleBy -- @field [parent=#cc] ScaleBy#ScaleBy ScaleBy preloaded module -------------------------------------------------------- -- the cc Blink -- @field [parent=#cc] Blink#Blink Blink preloaded module -------------------------------------------------------- -- the cc FadeTo -- @field [parent=#cc] FadeTo#FadeTo FadeTo preloaded module -------------------------------------------------------- -- the cc FadeIn -- @field [parent=#cc] FadeIn#FadeIn FadeIn preloaded module -------------------------------------------------------- -- the cc FadeOut -- @field [parent=#cc] FadeOut#FadeOut FadeOut preloaded module -------------------------------------------------------- -- the cc TintTo -- @field [parent=#cc] TintTo#TintTo TintTo preloaded module -------------------------------------------------------- -- the cc TintBy -- @field [parent=#cc] TintBy#TintBy TintBy preloaded module -------------------------------------------------------- -- the cc DelayTime -- @field [parent=#cc] DelayTime#DelayTime DelayTime preloaded module -------------------------------------------------------- -- the cc Animate -- @field [parent=#cc] Animate#Animate Animate preloaded module -------------------------------------------------------- -- the cc TargetedAction -- @field [parent=#cc] TargetedAction#TargetedAction TargetedAction preloaded module -------------------------------------------------------- -- the cc ActionCamera -- @field [parent=#cc] ActionCamera#ActionCamera ActionCamera preloaded module -------------------------------------------------------- -- the cc OrbitCamera -- @field [parent=#cc] OrbitCamera#OrbitCamera OrbitCamera preloaded module -------------------------------------------------------- -- the cc ActionManager -- @field [parent=#cc] ActionManager#ActionManager ActionManager preloaded module -------------------------------------------------------- -- the cc ActionEase -- @field [parent=#cc] ActionEase#ActionEase ActionEase preloaded module -------------------------------------------------------- -- the cc EaseRateAction -- @field [parent=#cc] EaseRateAction#EaseRateAction EaseRateAction preloaded module -------------------------------------------------------- -- the cc EaseIn -- @field [parent=#cc] EaseIn#EaseIn EaseIn preloaded module -------------------------------------------------------- -- the cc EaseOut -- @field [parent=#cc] EaseOut#EaseOut EaseOut preloaded module -------------------------------------------------------- -- the cc EaseInOut -- @field [parent=#cc] EaseInOut#EaseInOut EaseInOut preloaded module -------------------------------------------------------- -- the cc EaseExponentialIn -- @field [parent=#cc] EaseExponentialIn#EaseExponentialIn EaseExponentialIn preloaded module -------------------------------------------------------- -- the cc EaseExponentialOut -- @field [parent=#cc] EaseExponentialOut#EaseExponentialOut EaseExponentialOut preloaded module -------------------------------------------------------- -- the cc EaseExponentialInOut -- @field [parent=#cc] EaseExponentialInOut#EaseExponentialInOut EaseExponentialInOut preloaded module -------------------------------------------------------- -- the cc EaseSineIn -- @field [parent=#cc] EaseSineIn#EaseSineIn EaseSineIn preloaded module -------------------------------------------------------- -- the cc EaseSineOut -- @field [parent=#cc] EaseSineOut#EaseSineOut EaseSineOut preloaded module -------------------------------------------------------- -- the cc EaseSineInOut -- @field [parent=#cc] EaseSineInOut#EaseSineInOut EaseSineInOut preloaded module -------------------------------------------------------- -- the cc EaseElastic -- @field [parent=#cc] EaseElastic#EaseElastic EaseElastic preloaded module -------------------------------------------------------- -- the cc EaseElasticIn -- @field [parent=#cc] EaseElasticIn#EaseElasticIn EaseElasticIn preloaded module -------------------------------------------------------- -- the cc EaseElasticOut -- @field [parent=#cc] EaseElasticOut#EaseElasticOut EaseElasticOut preloaded module -------------------------------------------------------- -- the cc EaseElasticInOut -- @field [parent=#cc] EaseElasticInOut#EaseElasticInOut EaseElasticInOut preloaded module -------------------------------------------------------- -- the cc EaseBounce -- @field [parent=#cc] EaseBounce#EaseBounce EaseBounce preloaded module -------------------------------------------------------- -- the cc EaseBounceIn -- @field [parent=#cc] EaseBounceIn#EaseBounceIn EaseBounceIn preloaded module -------------------------------------------------------- -- the cc EaseBounceOut -- @field [parent=#cc] EaseBounceOut#EaseBounceOut EaseBounceOut preloaded module -------------------------------------------------------- -- the cc EaseBounceInOut -- @field [parent=#cc] EaseBounceInOut#EaseBounceInOut EaseBounceInOut preloaded module -------------------------------------------------------- -- the cc EaseBackIn -- @field [parent=#cc] EaseBackIn#EaseBackIn EaseBackIn preloaded module -------------------------------------------------------- -- the cc EaseBackOut -- @field [parent=#cc] EaseBackOut#EaseBackOut EaseBackOut preloaded module -------------------------------------------------------- -- the cc EaseBackInOut -- @field [parent=#cc] EaseBackInOut#EaseBackInOut EaseBackInOut preloaded module -------------------------------------------------------- -- the cc EaseBezierAction -- @field [parent=#cc] EaseBezierAction#EaseBezierAction EaseBezierAction preloaded module -------------------------------------------------------- -- the cc EaseQuadraticActionIn -- @field [parent=#cc] EaseQuadraticActionIn#EaseQuadraticActionIn EaseQuadraticActionIn preloaded module -------------------------------------------------------- -- the cc EaseQuadraticActionOut -- @field [parent=#cc] EaseQuadraticActionOut#EaseQuadraticActionOut EaseQuadraticActionOut preloaded module -------------------------------------------------------- -- the cc EaseQuadraticActionInOut -- @field [parent=#cc] EaseQuadraticActionInOut#EaseQuadraticActionInOut EaseQuadraticActionInOut preloaded module -------------------------------------------------------- -- the cc EaseQuarticActionIn -- @field [parent=#cc] EaseQuarticActionIn#EaseQuarticActionIn EaseQuarticActionIn preloaded module -------------------------------------------------------- -- the cc EaseQuarticActionOut -- @field [parent=#cc] EaseQuarticActionOut#EaseQuarticActionOut EaseQuarticActionOut preloaded module -------------------------------------------------------- -- the cc EaseQuarticActionInOut -- @field [parent=#cc] EaseQuarticActionInOut#EaseQuarticActionInOut EaseQuarticActionInOut preloaded module -------------------------------------------------------- -- the cc EaseQuinticActionIn -- @field [parent=#cc] EaseQuinticActionIn#EaseQuinticActionIn EaseQuinticActionIn preloaded module -------------------------------------------------------- -- the cc EaseQuinticActionOut -- @field [parent=#cc] EaseQuinticActionOut#EaseQuinticActionOut EaseQuinticActionOut preloaded module -------------------------------------------------------- -- the cc EaseQuinticActionInOut -- @field [parent=#cc] EaseQuinticActionInOut#EaseQuinticActionInOut EaseQuinticActionInOut preloaded module -------------------------------------------------------- -- the cc EaseCircleActionIn -- @field [parent=#cc] EaseCircleActionIn#EaseCircleActionIn EaseCircleActionIn preloaded module -------------------------------------------------------- -- the cc EaseCircleActionOut -- @field [parent=#cc] EaseCircleActionOut#EaseCircleActionOut EaseCircleActionOut preloaded module -------------------------------------------------------- -- the cc EaseCircleActionInOut -- @field [parent=#cc] EaseCircleActionInOut#EaseCircleActionInOut EaseCircleActionInOut preloaded module -------------------------------------------------------- -- the cc EaseCubicActionIn -- @field [parent=#cc] EaseCubicActionIn#EaseCubicActionIn EaseCubicActionIn preloaded module -------------------------------------------------------- -- the cc EaseCubicActionOut -- @field [parent=#cc] EaseCubicActionOut#EaseCubicActionOut EaseCubicActionOut preloaded module -------------------------------------------------------- -- the cc EaseCubicActionInOut -- @field [parent=#cc] EaseCubicActionInOut#EaseCubicActionInOut EaseCubicActionInOut preloaded module -------------------------------------------------------- -- the cc ActionInstant -- @field [parent=#cc] ActionInstant#ActionInstant ActionInstant preloaded module -------------------------------------------------------- -- the cc Show -- @field [parent=#cc] Show#Show Show preloaded module -------------------------------------------------------- -- the cc Hide -- @field [parent=#cc] Hide#Hide Hide preloaded module -------------------------------------------------------- -- the cc ToggleVisibility -- @field [parent=#cc] ToggleVisibility#ToggleVisibility ToggleVisibility preloaded module -------------------------------------------------------- -- the cc RemoveSelf -- @field [parent=#cc] RemoveSelf#RemoveSelf RemoveSelf preloaded module -------------------------------------------------------- -- the cc FlipX -- @field [parent=#cc] FlipX#FlipX FlipX preloaded module -------------------------------------------------------- -- the cc FlipY -- @field [parent=#cc] FlipY#FlipY FlipY preloaded module -------------------------------------------------------- -- the cc Place -- @field [parent=#cc] Place#Place Place preloaded module -------------------------------------------------------- -- the cc CallFunc -- @field [parent=#cc] CallFunc#CallFunc CallFunc preloaded module -------------------------------------------------------- -- the cc GridAction -- @field [parent=#cc] GridAction#GridAction GridAction preloaded module -------------------------------------------------------- -- the cc Grid3DAction -- @field [parent=#cc] Grid3DAction#Grid3DAction Grid3DAction preloaded module -------------------------------------------------------- -- the cc TiledGrid3DAction -- @field [parent=#cc] TiledGrid3DAction#TiledGrid3DAction TiledGrid3DAction preloaded module -------------------------------------------------------- -- the cc StopGrid -- @field [parent=#cc] StopGrid#StopGrid StopGrid preloaded module -------------------------------------------------------- -- the cc ReuseGrid -- @field [parent=#cc] ReuseGrid#ReuseGrid ReuseGrid preloaded module -------------------------------------------------------- -- the cc Waves3D -- @field [parent=#cc] Waves3D#Waves3D Waves3D preloaded module -------------------------------------------------------- -- the cc FlipX3D -- @field [parent=#cc] FlipX3D#FlipX3D FlipX3D preloaded module -------------------------------------------------------- -- the cc FlipY3D -- @field [parent=#cc] FlipY3D#FlipY3D FlipY3D preloaded module -------------------------------------------------------- -- the cc Lens3D -- @field [parent=#cc] Lens3D#Lens3D Lens3D preloaded module -------------------------------------------------------- -- the cc Ripple3D -- @field [parent=#cc] Ripple3D#Ripple3D Ripple3D preloaded module -------------------------------------------------------- -- the cc Shaky3D -- @field [parent=#cc] Shaky3D#Shaky3D Shaky3D preloaded module -------------------------------------------------------- -- the cc Liquid -- @field [parent=#cc] Liquid#Liquid Liquid preloaded module -------------------------------------------------------- -- the cc Waves -- @field [parent=#cc] Waves#Waves Waves preloaded module -------------------------------------------------------- -- the cc Twirl -- @field [parent=#cc] Twirl#Twirl Twirl preloaded module -------------------------------------------------------- -- the cc PageTurn3D -- @field [parent=#cc] PageTurn3D#PageTurn3D PageTurn3D preloaded module -------------------------------------------------------- -- the cc ProgressTo -- @field [parent=#cc] ProgressTo#ProgressTo ProgressTo preloaded module -------------------------------------------------------- -- the cc ProgressFromTo -- @field [parent=#cc] ProgressFromTo#ProgressFromTo ProgressFromTo preloaded module -------------------------------------------------------- -- the cc ShakyTiles3D -- @field [parent=#cc] ShakyTiles3D#ShakyTiles3D ShakyTiles3D preloaded module -------------------------------------------------------- -- the cc ShatteredTiles3D -- @field [parent=#cc] ShatteredTiles3D#ShatteredTiles3D ShatteredTiles3D preloaded module -------------------------------------------------------- -- the cc ShuffleTiles -- @field [parent=#cc] ShuffleTiles#ShuffleTiles ShuffleTiles preloaded module -------------------------------------------------------- -- the cc FadeOutTRTiles -- @field [parent=#cc] FadeOutTRTiles#FadeOutTRTiles FadeOutTRTiles preloaded module -------------------------------------------------------- -- the cc FadeOutBLTiles -- @field [parent=#cc] FadeOutBLTiles#FadeOutBLTiles FadeOutBLTiles preloaded module -------------------------------------------------------- -- the cc FadeOutUpTiles -- @field [parent=#cc] FadeOutUpTiles#FadeOutUpTiles FadeOutUpTiles preloaded module -------------------------------------------------------- -- the cc FadeOutDownTiles -- @field [parent=#cc] FadeOutDownTiles#FadeOutDownTiles FadeOutDownTiles preloaded module -------------------------------------------------------- -- the cc TurnOffTiles -- @field [parent=#cc] TurnOffTiles#TurnOffTiles TurnOffTiles preloaded module -------------------------------------------------------- -- the cc WavesTiles3D -- @field [parent=#cc] WavesTiles3D#WavesTiles3D WavesTiles3D preloaded module -------------------------------------------------------- -- the cc JumpTiles3D -- @field [parent=#cc] JumpTiles3D#JumpTiles3D JumpTiles3D preloaded module -------------------------------------------------------- -- the cc SplitRows -- @field [parent=#cc] SplitRows#SplitRows SplitRows preloaded module -------------------------------------------------------- -- the cc SplitCols -- @field [parent=#cc] SplitCols#SplitCols SplitCols preloaded module -------------------------------------------------------- -- the cc ActionTween -- @field [parent=#cc] ActionTween#ActionTween ActionTween preloaded module -------------------------------------------------------- -- the cc CardinalSplineTo -- @field [parent=#cc] CardinalSplineTo#CardinalSplineTo CardinalSplineTo preloaded module -------------------------------------------------------- -- the cc CardinalSplineBy -- @field [parent=#cc] CardinalSplineBy#CardinalSplineBy CardinalSplineBy preloaded module -------------------------------------------------------- -- the cc CatmullRomTo -- @field [parent=#cc] CatmullRomTo#CatmullRomTo CatmullRomTo preloaded module -------------------------------------------------------- -- the cc CatmullRomBy -- @field [parent=#cc] CatmullRomBy#CatmullRomBy CatmullRomBy preloaded module -------------------------------------------------------- -- the cc ProtectedNode -- @field [parent=#cc] ProtectedNode#ProtectedNode ProtectedNode preloaded module -------------------------------------------------------- -- the cc GLProgramState -- @field [parent=#cc] GLProgramState#GLProgramState GLProgramState preloaded module -------------------------------------------------------- -- the cc AtlasNode -- @field [parent=#cc] AtlasNode#AtlasNode AtlasNode preloaded module -------------------------------------------------------- -- the cc DrawNode -- @field [parent=#cc] DrawNode#DrawNode DrawNode preloaded module -------------------------------------------------------- -- the cc LabelAtlas -- @field [parent=#cc] LabelAtlas#LabelAtlas LabelAtlas preloaded module -------------------------------------------------------- -- the cc SpriteBatchNode -- @field [parent=#cc] SpriteBatchNode#SpriteBatchNode SpriteBatchNode preloaded module -------------------------------------------------------- -- the cc Label -- @field [parent=#cc] Label#Label Label preloaded module -------------------------------------------------------- -- the cc Layer -- @field [parent=#cc] Layer#Layer Layer preloaded module -------------------------------------------------------- -- the cc LayerColor -- @field [parent=#cc] LayerColor#LayerColor LayerColor preloaded module -------------------------------------------------------- -- the cc LayerGradient -- @field [parent=#cc] LayerGradient#LayerGradient LayerGradient preloaded module -------------------------------------------------------- -- the cc LayerMultiplex -- @field [parent=#cc] LayerMultiplex#LayerMultiplex LayerMultiplex preloaded module -------------------------------------------------------- -- the cc TransitionEaseScene -- @field [parent=#cc] TransitionEaseScene#TransitionEaseScene TransitionEaseScene preloaded module -------------------------------------------------------- -- the cc TransitionScene -- @field [parent=#cc] TransitionScene#TransitionScene TransitionScene preloaded module -------------------------------------------------------- -- the cc TransitionSceneOriented -- @field [parent=#cc] TransitionSceneOriented#TransitionSceneOriented TransitionSceneOriented preloaded module -------------------------------------------------------- -- the cc TransitionRotoZoom -- @field [parent=#cc] TransitionRotoZoom#TransitionRotoZoom TransitionRotoZoom preloaded module -------------------------------------------------------- -- the cc TransitionJumpZoom -- @field [parent=#cc] TransitionJumpZoom#TransitionJumpZoom TransitionJumpZoom preloaded module -------------------------------------------------------- -- the cc TransitionMoveInL -- @field [parent=#cc] TransitionMoveInL#TransitionMoveInL TransitionMoveInL preloaded module -------------------------------------------------------- -- the cc TransitionMoveInR -- @field [parent=#cc] TransitionMoveInR#TransitionMoveInR TransitionMoveInR preloaded module -------------------------------------------------------- -- the cc TransitionMoveInT -- @field [parent=#cc] TransitionMoveInT#TransitionMoveInT TransitionMoveInT preloaded module -------------------------------------------------------- -- the cc TransitionMoveInB -- @field [parent=#cc] TransitionMoveInB#TransitionMoveInB TransitionMoveInB preloaded module -------------------------------------------------------- -- the cc TransitionSlideInL -- @field [parent=#cc] TransitionSlideInL#TransitionSlideInL TransitionSlideInL preloaded module -------------------------------------------------------- -- the cc TransitionSlideInR -- @field [parent=#cc] TransitionSlideInR#TransitionSlideInR TransitionSlideInR preloaded module -------------------------------------------------------- -- the cc TransitionSlideInB -- @field [parent=#cc] TransitionSlideInB#TransitionSlideInB TransitionSlideInB preloaded module -------------------------------------------------------- -- the cc TransitionSlideInT -- @field [parent=#cc] TransitionSlideInT#TransitionSlideInT TransitionSlideInT preloaded module -------------------------------------------------------- -- the cc TransitionShrinkGrow -- @field [parent=#cc] TransitionShrinkGrow#TransitionShrinkGrow TransitionShrinkGrow preloaded module -------------------------------------------------------- -- the cc TransitionFlipX -- @field [parent=#cc] TransitionFlipX#TransitionFlipX TransitionFlipX preloaded module -------------------------------------------------------- -- the cc TransitionFlipY -- @field [parent=#cc] TransitionFlipY#TransitionFlipY TransitionFlipY preloaded module -------------------------------------------------------- -- the cc TransitionFlipAngular -- @field [parent=#cc] TransitionFlipAngular#TransitionFlipAngular TransitionFlipAngular preloaded module -------------------------------------------------------- -- the cc TransitionZoomFlipX -- @field [parent=#cc] TransitionZoomFlipX#TransitionZoomFlipX TransitionZoomFlipX preloaded module -------------------------------------------------------- -- the cc TransitionZoomFlipY -- @field [parent=#cc] TransitionZoomFlipY#TransitionZoomFlipY TransitionZoomFlipY preloaded module -------------------------------------------------------- -- the cc TransitionZoomFlipAngular -- @field [parent=#cc] TransitionZoomFlipAngular#TransitionZoomFlipAngular TransitionZoomFlipAngular preloaded module -------------------------------------------------------- -- the cc TransitionFade -- @field [parent=#cc] TransitionFade#TransitionFade TransitionFade preloaded module -------------------------------------------------------- -- the cc TransitionCrossFade -- @field [parent=#cc] TransitionCrossFade#TransitionCrossFade TransitionCrossFade preloaded module -------------------------------------------------------- -- the cc TransitionTurnOffTiles -- @field [parent=#cc] TransitionTurnOffTiles#TransitionTurnOffTiles TransitionTurnOffTiles preloaded module -------------------------------------------------------- -- the cc TransitionSplitCols -- @field [parent=#cc] TransitionSplitCols#TransitionSplitCols TransitionSplitCols preloaded module -------------------------------------------------------- -- the cc TransitionSplitRows -- @field [parent=#cc] TransitionSplitRows#TransitionSplitRows TransitionSplitRows preloaded module -------------------------------------------------------- -- the cc TransitionFadeTR -- @field [parent=#cc] TransitionFadeTR#TransitionFadeTR TransitionFadeTR preloaded module -------------------------------------------------------- -- the cc TransitionFadeBL -- @field [parent=#cc] TransitionFadeBL#TransitionFadeBL TransitionFadeBL preloaded module -------------------------------------------------------- -- the cc TransitionFadeUp -- @field [parent=#cc] TransitionFadeUp#TransitionFadeUp TransitionFadeUp preloaded module -------------------------------------------------------- -- the cc TransitionFadeDown -- @field [parent=#cc] TransitionFadeDown#TransitionFadeDown TransitionFadeDown preloaded module -------------------------------------------------------- -- the cc TransitionPageTurn -- @field [parent=#cc] TransitionPageTurn#TransitionPageTurn TransitionPageTurn preloaded module -------------------------------------------------------- -- the cc TransitionProgress -- @field [parent=#cc] TransitionProgress#TransitionProgress TransitionProgress preloaded module -------------------------------------------------------- -- the cc TransitionProgressRadialCCW -- @field [parent=#cc] TransitionProgressRadialCCW#TransitionProgressRadialCCW TransitionProgressRadialCCW preloaded module -------------------------------------------------------- -- the cc TransitionProgressRadialCW -- @field [parent=#cc] TransitionProgressRadialCW#TransitionProgressRadialCW TransitionProgressRadialCW preloaded module -------------------------------------------------------- -- the cc TransitionProgressHorizontal -- @field [parent=#cc] TransitionProgressHorizontal#TransitionProgressHorizontal TransitionProgressHorizontal preloaded module -------------------------------------------------------- -- the cc TransitionProgressVertical -- @field [parent=#cc] TransitionProgressVertical#TransitionProgressVertical TransitionProgressVertical preloaded module -------------------------------------------------------- -- the cc TransitionProgressInOut -- @field [parent=#cc] TransitionProgressInOut#TransitionProgressInOut TransitionProgressInOut preloaded module -------------------------------------------------------- -- the cc TransitionProgressOutIn -- @field [parent=#cc] TransitionProgressOutIn#TransitionProgressOutIn TransitionProgressOutIn preloaded module -------------------------------------------------------- -- the cc MenuItem -- @field [parent=#cc] MenuItem#MenuItem MenuItem preloaded module -------------------------------------------------------- -- the cc MenuItemLabel -- @field [parent=#cc] MenuItemLabel#MenuItemLabel MenuItemLabel preloaded module -------------------------------------------------------- -- the cc MenuItemAtlasFont -- @field [parent=#cc] MenuItemAtlasFont#MenuItemAtlasFont MenuItemAtlasFont preloaded module -------------------------------------------------------- -- the cc MenuItemFont -- @field [parent=#cc] MenuItemFont#MenuItemFont MenuItemFont preloaded module -------------------------------------------------------- -- the cc MenuItemSprite -- @field [parent=#cc] MenuItemSprite#MenuItemSprite MenuItemSprite preloaded module -------------------------------------------------------- -- the cc MenuItemImage -- @field [parent=#cc] MenuItemImage#MenuItemImage MenuItemImage preloaded module -------------------------------------------------------- -- the cc MenuItemToggle -- @field [parent=#cc] MenuItemToggle#MenuItemToggle MenuItemToggle preloaded module -------------------------------------------------------- -- the cc Menu -- @field [parent=#cc] Menu#Menu Menu preloaded module -------------------------------------------------------- -- the cc ClippingNode -- @field [parent=#cc] ClippingNode#ClippingNode ClippingNode preloaded module -------------------------------------------------------- -- the cc ClippingRectangleNode -- @field [parent=#cc] ClippingRectangleNode#ClippingRectangleNode ClippingRectangleNode preloaded module -------------------------------------------------------- -- the cc MotionStreak -- @field [parent=#cc] MotionStreak#MotionStreak MotionStreak preloaded module -------------------------------------------------------- -- the cc ProgressTimer -- @field [parent=#cc] ProgressTimer#ProgressTimer ProgressTimer preloaded module -------------------------------------------------------- -- the cc Sprite -- @field [parent=#cc] Sprite#Sprite Sprite preloaded module -------------------------------------------------------- -- the cc Image -- @field [parent=#cc] Image#Image Image preloaded module -------------------------------------------------------- -- the cc RenderTexture -- @field [parent=#cc] RenderTexture#RenderTexture RenderTexture preloaded module -------------------------------------------------------- -- the cc NodeGrid -- @field [parent=#cc] NodeGrid#NodeGrid NodeGrid preloaded module -------------------------------------------------------- -- the cc ParticleBatchNode -- @field [parent=#cc] ParticleBatchNode#ParticleBatchNode ParticleBatchNode preloaded module -------------------------------------------------------- -- the cc ParticleSystem -- @field [parent=#cc] ParticleSystem#ParticleSystem ParticleSystem preloaded module -------------------------------------------------------- -- the cc ParticleSystemQuad -- @field [parent=#cc] ParticleSystemQuad#ParticleSystemQuad ParticleSystemQuad preloaded module -------------------------------------------------------- -- the cc ParticleFire -- @field [parent=#cc] ParticleFire#ParticleFire ParticleFire preloaded module -------------------------------------------------------- -- the cc ParticleFireworks -- @field [parent=#cc] ParticleFireworks#ParticleFireworks ParticleFireworks preloaded module -------------------------------------------------------- -- the cc ParticleSun -- @field [parent=#cc] ParticleSun#ParticleSun ParticleSun preloaded module -------------------------------------------------------- -- the cc ParticleGalaxy -- @field [parent=#cc] ParticleGalaxy#ParticleGalaxy ParticleGalaxy preloaded module -------------------------------------------------------- -- the cc ParticleFlower -- @field [parent=#cc] ParticleFlower#ParticleFlower ParticleFlower preloaded module -------------------------------------------------------- -- the cc ParticleMeteor -- @field [parent=#cc] ParticleMeteor#ParticleMeteor ParticleMeteor preloaded module -------------------------------------------------------- -- the cc ParticleSpiral -- @field [parent=#cc] ParticleSpiral#ParticleSpiral ParticleSpiral preloaded module -------------------------------------------------------- -- the cc ParticleExplosion -- @field [parent=#cc] ParticleExplosion#ParticleExplosion ParticleExplosion preloaded module -------------------------------------------------------- -- the cc ParticleSmoke -- @field [parent=#cc] ParticleSmoke#ParticleSmoke ParticleSmoke preloaded module -------------------------------------------------------- -- the cc ParticleSnow -- @field [parent=#cc] ParticleSnow#ParticleSnow ParticleSnow preloaded module -------------------------------------------------------- -- the cc ParticleRain -- @field [parent=#cc] ParticleRain#ParticleRain ParticleRain preloaded module -------------------------------------------------------- -- the cc GridBase -- @field [parent=#cc] GridBase#GridBase GridBase preloaded module -------------------------------------------------------- -- the cc Grid3D -- @field [parent=#cc] Grid3D#Grid3D Grid3D preloaded module -------------------------------------------------------- -- the cc TiledGrid3D -- @field [parent=#cc] TiledGrid3D#TiledGrid3D TiledGrid3D preloaded module -------------------------------------------------------- -- the cc Camera -- @field [parent=#cc] Camera#Camera Camera preloaded module -------------------------------------------------------- -- the cc BaseLight -- @field [parent=#cc] BaseLight#BaseLight BaseLight preloaded module -------------------------------------------------------- -- the cc DirectionLight -- @field [parent=#cc] DirectionLight#DirectionLight DirectionLight preloaded module -------------------------------------------------------- -- the cc PointLight -- @field [parent=#cc] PointLight#PointLight PointLight preloaded module -------------------------------------------------------- -- the cc SpotLight -- @field [parent=#cc] SpotLight#SpotLight SpotLight preloaded module -------------------------------------------------------- -- the cc AmbientLight -- @field [parent=#cc] AmbientLight#AmbientLight AmbientLight preloaded module -------------------------------------------------------- -- the cc GLProgram -- @field [parent=#cc] GLProgram#GLProgram GLProgram preloaded module -------------------------------------------------------- -- the cc GLProgramCache -- @field [parent=#cc] GLProgramCache#GLProgramCache GLProgramCache preloaded module -------------------------------------------------------- -- the cc TextureCache -- @field [parent=#cc] TextureCache#TextureCache TextureCache preloaded module -------------------------------------------------------- -- the cc Device -- @field [parent=#cc] Device#Device Device preloaded module -------------------------------------------------------- -- the cc Application -- @field [parent=#cc] Application#Application Application preloaded module -------------------------------------------------------- -- the cc GLViewImpl -- @field [parent=#cc] GLViewImpl#GLViewImpl GLViewImpl preloaded module -------------------------------------------------------- -- the cc AnimationCache -- @field [parent=#cc] AnimationCache#AnimationCache AnimationCache preloaded module -------------------------------------------------------- -- the cc SpriteFrameCache -- @field [parent=#cc] SpriteFrameCache#SpriteFrameCache SpriteFrameCache preloaded module -------------------------------------------------------- -- the cc ParallaxNode -- @field [parent=#cc] ParallaxNode#ParallaxNode ParallaxNode preloaded module -------------------------------------------------------- -- the cc TMXObjectGroup -- @field [parent=#cc] TMXObjectGroup#TMXObjectGroup TMXObjectGroup preloaded module -------------------------------------------------------- -- the cc TMXLayerInfo -- @field [parent=#cc] TMXLayerInfo#TMXLayerInfo TMXLayerInfo preloaded module -------------------------------------------------------- -- the cc TMXTilesetInfo -- @field [parent=#cc] TMXTilesetInfo#TMXTilesetInfo TMXTilesetInfo preloaded module -------------------------------------------------------- -- the cc TMXMapInfo -- @field [parent=#cc] TMXMapInfo#TMXMapInfo TMXMapInfo preloaded module -------------------------------------------------------- -- the cc TMXLayer -- @field [parent=#cc] TMXLayer#TMXLayer TMXLayer preloaded module -------------------------------------------------------- -- the cc TMXTiledMap -- @field [parent=#cc] TMXTiledMap#TMXTiledMap TMXTiledMap preloaded module -------------------------------------------------------- -- the cc TileMapAtlas -- @field [parent=#cc] TileMapAtlas#TileMapAtlas TileMapAtlas preloaded module -------------------------------------------------------- -- the cc Component -- @field [parent=#cc] Component#Component Component preloaded module -------------------------------------------------------- -- the cc AsyncTaskPool -- @field [parent=#cc] AsyncTaskPool#AsyncTaskPool AsyncTaskPool preloaded module return nil
apache-2.0
weiDDD/WSSParticleSystem
cocos2d/external/lua/luajit/src/src/jit/dump.lua
1
20208
---------------------------------------------------------------------------- -- LuaJIT compiler dump module. -- -- Copyright (C) 2005-2014 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -- -- This module can be used to debug the JIT compiler itself. It dumps the -- code representations and structures used in various compiler stages. -- -- Example usage: -- -- luajit -jdump -e "local x=0; for i=1,1e6 do x=x+i end; print(x)" -- luajit -jdump=im -e "for i=1,1000 do for j=1,1000 do end end" | less -R -- luajit -jdump=is myapp.lua | less -R -- luajit -jdump=-b myapp.lua -- luajit -jdump=+aH,myapp.html myapp.lua -- luajit -jdump=ixT,myapp.dump myapp.lua -- -- The first argument specifies the dump mode. The second argument gives -- the output file name. Default output is to stdout, unless the environment -- variable LUAJIT_DUMPFILE is set. The file is overwritten every time the -- module is started. -- -- Different features can be turned on or off with the dump mode. If the -- mode starts with a '+', the following features are added to the default -- set of features; a '-' removes them. Otherwise the features are replaced. -- -- The following dump features are available (* marks the default): -- -- * t Print a line for each started, ended or aborted trace (see also -jv). -- * b Dump the traced bytecode. -- * i Dump the IR (intermediate representation). -- r Augment the IR with register/stack slots. -- s Dump the snapshot map. -- * m Dump the generated machine code. -- x Print each taken trace exit. -- X Print each taken trace exit and the contents of all registers. -- a Print the IR of aborted traces, too. -- -- The output format can be set with the following characters: -- -- T Plain text output. -- A ANSI-colored text output -- H Colorized HTML + CSS output. -- -- The default output format is plain text. It's set to ANSI-colored text -- if the COLORTERM variable is set. Note: this is independent of any output -- redirection, which is actually considered a feature. -- -- You probably want to use less -R to enjoy viewing ANSI-colored text from -- a pipe or a file. Add this to your ~/.bashrc: export LESS="-R" -- ------------------------------------------------------------------------------ -- Cache some library functions and objects. local jit = require("jit") assert(jit.version_num == 20003, "LuaJIT core/library version mismatch") local jutil = require("jit.util") local vmdef = require("jit.vmdef") local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc local traceinfo, traceir, tracek = jutil.traceinfo, jutil.traceir, jutil.tracek local tracemc, tracesnap = jutil.tracemc, jutil.tracesnap local traceexitstub, ircalladdr = jutil.traceexitstub, jutil.ircalladdr local bit = require("bit") local band, shl, shr = bit.band, bit.lshift, bit.rshift local sub, gsub, format = string.sub, string.gsub, string.format local byte, char, rep = string.byte, string.char, string.rep local type, tostring = type, tostring local stdout, stderr = io.stdout, io.stderr -- Load other modules on-demand. local bcline, disass -- Active flag, output file handle and dump mode. local active, out, dumpmode ------------------------------------------------------------------------------ local symtabmt = { __index = false } local symtab = {} local nexitsym = 0 -- Fill nested symbol table with per-trace exit stub addresses. local function fillsymtab_tr(tr, nexit) local t = {} symtabmt.__index = t if jit.arch == "mips" or jit.arch == "mipsel" then t[traceexitstub(tr, 0)] = "exit" return end for i=0,nexit-1 do local addr = traceexitstub(tr, i) t[addr] = tostring(i) end local addr = traceexitstub(tr, nexit) if addr then t[addr] = "stack_check" end end -- Fill symbol table with trace exit stub addresses. local function fillsymtab(tr, nexit) local t = symtab if nexitsym == 0 then local ircall = vmdef.ircall for i=0,#ircall do local addr = ircalladdr(i) if addr ~= 0 then t[addr] = ircall[i] end end end if nexitsym == 1000000 then -- Per-trace exit stubs. fillsymtab_tr(tr, nexit) elseif nexit > nexitsym then -- Shared exit stubs. for i=nexitsym,nexit-1 do local addr = traceexitstub(i) if addr == nil then -- Fall back to per-trace exit stubs. fillsymtab_tr(tr, nexit) setmetatable(symtab, symtabmt) nexit = 1000000 break end t[addr] = tostring(i) end nexitsym = nexit end return t end local function dumpwrite(s) out:write(s) end -- Disassemble machine code. local function dump_mcode(tr) local info = traceinfo(tr) if not info then return end local mcode, addr, loop = tracemc(tr) if not mcode then return end if not disass then disass = require("jit.dis_"..jit.arch) end out:write("---- TRACE ", tr, " mcode ", #mcode, "\n") local ctx = disass.create(mcode, addr, dumpwrite) ctx.hexdump = 0 ctx.symtab = fillsymtab(tr, info.nexit) if loop ~= 0 then symtab[addr+loop] = "LOOP" ctx:disass(0, loop) out:write("->LOOP:\n") ctx:disass(loop, #mcode-loop) symtab[addr+loop] = nil else ctx:disass(0, #mcode) end end ------------------------------------------------------------------------------ local irtype_text = { [0] = "nil", "fal", "tru", "lud", "str", "p32", "thr", "pro", "fun", "p64", "cdt", "tab", "udt", "flt", "num", "i8 ", "u8 ", "i16", "u16", "int", "u32", "i64", "u64", "sfp", } local colortype_ansi = { [0] = "%s", "%s", "%s", "\027[36m%s\027[m", "\027[32m%s\027[m", "%s", "\027[1m%s\027[m", "%s", "\027[1m%s\027[m", "%s", "\027[33m%s\027[m", "\027[31m%s\027[m", "\027[36m%s\027[m", "\027[34m%s\027[m", "\027[34m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", "\027[35m%s\027[m", } local function colorize_text(s, t) return s end local function colorize_ansi(s, t) return format(colortype_ansi[t], s) end local irtype_ansi = setmetatable({}, { __index = function(tab, t) local s = colorize_ansi(irtype_text[t], t); tab[t] = s; return s; end }) local html_escape = { ["<"] = "&lt;", [">"] = "&gt;", ["&"] = "&amp;", } local function colorize_html(s, t) s = gsub(s, "[<>&]", html_escape) return format('<span class="irt_%s">%s</span>', irtype_text[t], s) end local irtype_html = setmetatable({}, { __index = function(tab, t) local s = colorize_html(irtype_text[t], t); tab[t] = s; return s; end }) local header_html = [[ <style type="text/css"> background { background: #ffffff; color: #000000; } pre.ljdump { font-size: 10pt; background: #f0f4ff; color: #000000; border: 1px solid #bfcfff; padding: 0.5em; margin-left: 2em; margin-right: 2em; } span.irt_str { color: #00a000; } span.irt_thr, span.irt_fun { color: #404040; font-weight: bold; } span.irt_tab { color: #c00000; } span.irt_udt, span.irt_lud { color: #00c0c0; } span.irt_num { color: #4040c0; } span.irt_int, span.irt_i8, span.irt_u8, span.irt_i16, span.irt_u16 { color: #b040b0; } </style> ]] local colorize, irtype -- Lookup tables to convert some literals into names. local litname = { ["SLOAD "] = setmetatable({}, { __index = function(t, mode) local s = "" if band(mode, 1) ~= 0 then s = s.."P" end if band(mode, 2) ~= 0 then s = s.."F" end if band(mode, 4) ~= 0 then s = s.."T" end if band(mode, 8) ~= 0 then s = s.."C" end if band(mode, 16) ~= 0 then s = s.."R" end if band(mode, 32) ~= 0 then s = s.."I" end t[mode] = s return s end}), ["XLOAD "] = { [0] = "", "R", "V", "RV", "U", "RU", "VU", "RVU", }, ["CONV "] = setmetatable({}, { __index = function(t, mode) local s = irtype[band(mode, 31)] s = irtype[band(shr(mode, 5), 31)].."."..s if band(mode, 0x400) ~= 0 then s = s.." trunc" elseif band(mode, 0x800) ~= 0 then s = s.." sext" end local c = shr(mode, 14) if c == 2 then s = s.." index" elseif c == 3 then s = s.." check" end t[mode] = s return s end}), ["FLOAD "] = vmdef.irfield, ["FREF "] = vmdef.irfield, ["FPMATH"] = vmdef.irfpm, } local function ctlsub(c) if c == "\n" then return "\\n" elseif c == "\r" then return "\\r" elseif c == "\t" then return "\\t" else return format("\\%03d", byte(c)) end end local function fmtfunc(func, pc) local fi = funcinfo(func, pc) if fi.loc then return fi.loc elseif fi.ffid then return vmdef.ffnames[fi.ffid] elseif fi.addr then return format("C:%x", fi.addr) else return "(?)" end end local function formatk(tr, idx) local k, t, slot = tracek(tr, idx) local tn = type(k) local s if tn == "number" then if k == 2^52+2^51 then s = "bias" else s = format("%+.14g", k) end elseif tn == "string" then s = format(#k > 20 and '"%.20s"~' or '"%s"', gsub(k, "%c", ctlsub)) elseif tn == "function" then s = fmtfunc(k) elseif tn == "table" then s = format("{%p}", k) elseif tn == "userdata" then if t == 12 then s = format("userdata:%p", k) else s = format("[%p]", k) if s == "[0x00000000]" then s = "NULL" end end elseif t == 21 then -- int64_t s = sub(tostring(k), 1, -3) if sub(s, 1, 1) ~= "-" then s = "+"..s end else s = tostring(k) -- For primitives. end s = colorize(format("%-4s", s), t) if slot then s = format("%s @%d", s, slot) end return s end local function printsnap(tr, snap) local n = 2 for s=0,snap[1]-1 do local sn = snap[n] if shr(sn, 24) == s then n = n + 1 local ref = band(sn, 0xffff) - 0x8000 -- REF_BIAS if ref < 0 then out:write(formatk(tr, ref)) elseif band(sn, 0x80000) ~= 0 then -- SNAP_SOFTFPNUM out:write(colorize(format("%04d/%04d", ref, ref+1), 14)) else local m, ot, op1, op2 = traceir(tr, ref) out:write(colorize(format("%04d", ref), band(ot, 31))) end out:write(band(sn, 0x10000) == 0 and " " or "|") -- SNAP_FRAME else out:write("---- ") end end out:write("]\n") end -- Dump snapshots (not interleaved with IR). local function dump_snap(tr) out:write("---- TRACE ", tr, " snapshots\n") for i=0,1000000000 do local snap = tracesnap(tr, i) if not snap then break end out:write(format("#%-3d %04d [ ", i, snap[0])) printsnap(tr, snap) end end -- Return a register name or stack slot for a rid/sp location. local function ridsp_name(ridsp, ins) if not disass then disass = require("jit.dis_"..jit.arch) end local rid, slot = band(ridsp, 0xff), shr(ridsp, 8) if rid == 253 or rid == 254 then return (slot == 0 or slot == 255) and " {sink" or format(" {%04d", ins-slot) end if ridsp > 255 then return format("[%x]", slot*4) end if rid < 128 then return disass.regname(rid) end return "" end -- Dump CALL* function ref and return optional ctype. local function dumpcallfunc(tr, ins) local ctype if ins > 0 then local m, ot, op1, op2 = traceir(tr, ins) if band(ot, 31) == 0 then -- nil type means CARG(func, ctype). ins = op1 ctype = formatk(tr, op2) end end if ins < 0 then out:write(format("[0x%x](", tonumber((tracek(tr, ins))))) else out:write(format("%04d (", ins)) end return ctype end -- Recursively gather CALL* args and dump them. local function dumpcallargs(tr, ins) if ins < 0 then out:write(formatk(tr, ins)) else local m, ot, op1, op2 = traceir(tr, ins) local oidx = 6*shr(ot, 8) local op = sub(vmdef.irnames, oidx+1, oidx+6) if op == "CARG " then dumpcallargs(tr, op1) if op2 < 0 then out:write(" ", formatk(tr, op2)) else out:write(" ", format("%04d", op2)) end else out:write(format("%04d", ins)) end end end -- Dump IR and interleaved snapshots. local function dump_ir(tr, dumpsnap, dumpreg) local info = traceinfo(tr) if not info then return end local nins = info.nins out:write("---- TRACE ", tr, " IR\n") local irnames = vmdef.irnames local snapref = 65536 local snap, snapno if dumpsnap then snap = tracesnap(tr, 0) snapref = snap[0] snapno = 0 end for ins=1,nins do if ins >= snapref then if dumpreg then out:write(format(".... SNAP #%-3d [ ", snapno)) else out:write(format(".... SNAP #%-3d [ ", snapno)) end printsnap(tr, snap) snapno = snapno + 1 snap = tracesnap(tr, snapno) snapref = snap and snap[0] or 65536 end local m, ot, op1, op2, ridsp = traceir(tr, ins) local oidx, t = 6*shr(ot, 8), band(ot, 31) local op = sub(irnames, oidx+1, oidx+6) if op == "LOOP " then if dumpreg then out:write(format("%04d ------------ LOOP ------------\n", ins)) else out:write(format("%04d ------ LOOP ------------\n", ins)) end elseif op ~= "NOP " and op ~= "CARG " and (dumpreg or op ~= "RENAME") then local rid = band(ridsp, 255) if dumpreg then out:write(format("%04d %-6s", ins, ridsp_name(ridsp, ins))) else out:write(format("%04d ", ins)) end out:write(format("%s%s %s %s ", (rid == 254 or rid == 253) and "}" or (band(ot, 128) == 0 and " " or ">"), band(ot, 64) == 0 and " " or "+", irtype[t], op)) local m1, m2 = band(m, 3), band(m, 3*4) if sub(op, 1, 4) == "CALL" then local ctype if m2 == 1*4 then -- op2 == IRMlit out:write(format("%-10s (", vmdef.ircall[op2])) else ctype = dumpcallfunc(tr, op2) end if op1 ~= -1 then dumpcallargs(tr, op1) end out:write(")") if ctype then out:write(" ctype ", ctype) end elseif op == "CNEW " and op2 == -1 then out:write(formatk(tr, op1)) elseif m1 ~= 3 then -- op1 != IRMnone if op1 < 0 then out:write(formatk(tr, op1)) else out:write(format(m1 == 0 and "%04d" or "#%-3d", op1)) end if m2 ~= 3*4 then -- op2 != IRMnone if m2 == 1*4 then -- op2 == IRMlit local litn = litname[op] if litn and litn[op2] then out:write(" ", litn[op2]) elseif op == "UREFO " or op == "UREFC " then out:write(format(" #%-3d", shr(op2, 8))) else out:write(format(" #%-3d", op2)) end elseif op2 < 0 then out:write(" ", formatk(tr, op2)) else out:write(format(" %04d", op2)) end end end out:write("\n") end end if snap then if dumpreg then out:write(format(".... SNAP #%-3d [ ", snapno)) else out:write(format(".... SNAP #%-3d [ ", snapno)) end printsnap(tr, snap) end end ------------------------------------------------------------------------------ local recprefix = "" local recdepth = 0 -- Format trace error message. local function fmterr(err, info) if type(err) == "number" then if type(info) == "function" then info = fmtfunc(info) end err = format(vmdef.traceerr[err], info) end return err end -- Dump trace states. local function dump_trace(what, tr, func, pc, otr, oex) if what == "stop" or (what == "abort" and dumpmode.a) then if dumpmode.i then dump_ir(tr, dumpmode.s, dumpmode.r and what == "stop") elseif dumpmode.s then dump_snap(tr) end if dumpmode.m then dump_mcode(tr) end end if what == "start" then if dumpmode.H then out:write('<pre class="ljdump">\n') end out:write("---- TRACE ", tr, " ", what) if otr then out:write(" ", otr, "/", oex) end out:write(" ", fmtfunc(func, pc), "\n") elseif what == "stop" or what == "abort" then out:write("---- TRACE ", tr, " ", what) if what == "abort" then out:write(" ", fmtfunc(func, pc), " -- ", fmterr(otr, oex), "\n") else local info = traceinfo(tr) local link, ltype = info.link, info.linktype if link == tr or link == 0 then out:write(" -> ", ltype, "\n") elseif ltype == "root" then out:write(" -> ", link, "\n") else out:write(" -> ", link, " ", ltype, "\n") end end if dumpmode.H then out:write("</pre>\n\n") else out:write("\n") end else out:write("---- TRACE ", what, "\n\n") end out:flush() end -- Dump recorded bytecode. local function dump_record(tr, func, pc, depth, callee) if depth ~= recdepth then recdepth = depth recprefix = rep(" .", depth) end local line if pc >= 0 then line = bcline(func, pc, recprefix) if dumpmode.H then line = gsub(line, "[<>&]", html_escape) end else line = "0000 "..recprefix.." FUNCC \n" callee = func end if pc <= 0 then out:write(sub(line, 1, -2), " ; ", fmtfunc(func), "\n") else out:write(line) end if pc >= 0 and band(funcbc(func, pc), 0xff) < 16 then -- ORDER BC out:write(bcline(func, pc+1, recprefix)) -- Write JMP for cond. end end ------------------------------------------------------------------------------ -- Dump taken trace exits. local function dump_texit(tr, ex, ngpr, nfpr, ...) out:write("---- TRACE ", tr, " exit ", ex, "\n") if dumpmode.X then local regs = {...} if jit.arch == "x64" then for i=1,ngpr do out:write(format(" %016x", regs[i])) if i % 4 == 0 then out:write("\n") end end else for i=1,ngpr do out:write(format(" %08x", regs[i])) if i % 8 == 0 then out:write("\n") end end end if jit.arch == "mips" or jit.arch == "mipsel" then for i=1,nfpr,2 do out:write(format(" %+17.14g", regs[ngpr+i])) if i % 8 == 7 then out:write("\n") end end else for i=1,nfpr do out:write(format(" %+17.14g", regs[ngpr+i])) if i % 4 == 0 then out:write("\n") end end end end end ------------------------------------------------------------------------------ -- Detach dump handlers. local function dumpoff() if active then active = false jit.attach(dump_texit) jit.attach(dump_record) jit.attach(dump_trace) if out and out ~= stdout and out ~= stderr then out:close() end out = nil end end -- Open the output file and attach dump handlers. local function dumpon(opt, outfile) if active then dumpoff() end local colormode = os.getenv("COLORTERM") and "A" or "T" if opt then opt = gsub(opt, "[TAH]", function(mode) colormode = mode; return ""; end) end local m = { t=true, b=true, i=true, m=true, } if opt and opt ~= "" then local o = sub(opt, 1, 1) if o ~= "+" and o ~= "-" then m = {} end for i=1,#opt do m[sub(opt, i, i)] = (o ~= "-") end end dumpmode = m if m.t or m.b or m.i or m.s or m.m then jit.attach(dump_trace, "trace") end if m.b then jit.attach(dump_record, "record") if not bcline then bcline = require("jit.bc").line end end if m.x or m.X then jit.attach(dump_texit, "texit") end if not outfile then outfile = os.getenv("LUAJIT_DUMPFILE") end if outfile then out = outfile == "-" and stdout or assert(io.open(outfile, "w")) else out = stdout end m[colormode] = true if colormode == "A" then colorize = colorize_ansi irtype = irtype_ansi elseif colormode == "H" then colorize = colorize_html irtype = irtype_html out:write(header_html) else colorize = colorize_text irtype = irtype_text end active = true end -- Public module functions. module(...) on = dumpon off = dumpoff start = dumpon -- For -j command line option.
apache-2.0
Modified-MW-DF/modified-MDF
MWDF Project/Dwarf Fortress/hack/scripts/masterwork/gui/detailed-unit.lua
2
21949
local gui = require 'gui' local dialog = require 'gui.dialogs' local widgets =require 'gui.widgets' local guiScript = require 'gui.script' local utils = require 'utils' local split = utils.split_string checkclass = true function center(str, length) local string1 = str local string2 = string.format("%"..tostring(math.floor((length-#string1)/2)).."s"..string1,"") local string3 = string.format(string2.."%"..tostring(math.ceil((length-#string1)/2)).."s","") return string3 end function tchelper(first, rest) return first:upper()..rest:lower() end function Set (list) local set = {} for _, l in ipairs(list) do set[l] = true end return set end function getTargetFromScreens() local my_trg if dfhack.gui.getSelectedUnit(true) then my_trg=dfhack.gui.getSelectedUnit(true) else qerror("No valid target found") end return my_trg end local guiFunctions = dfhack.script_environment('functions/gui') UnitViewUi = defclass(UnitViewUi, gui.FramedScreen) UnitViewUi.ATTRS={ frame_style = gui.BOUNDARY_FRAME, frame_title = "Detailed unit viewer", } function UnitViewUi:init(args) test_length = 40 self.target = args.target self.test_length = test_length local persistTable = require 'persist-table' if safe_index(persistTable,'GlobalTable','roses','ClassTable') then self.classSystem = true end -- Positioning ---- Main Frame Layout --[[ X Y Z Name | | | A Caste | Description | Skills | Civilization | | | -----------------------|----------------|----------------| B Membership/Worship | Appearance | | -----------------------|----------------|----------------| C | Attribute Desc | | ---------------------------------------------------------- Bottom UI: Attributes Health Syndromes Thoughts Classes Spells Traits ]] ---- AX = {anchor = {}, width = test_length, height = 6} AY = {anchor = {}, width = test_length, height = 6} AZ = {anchor = {}, width = test_length, height = 20} BX = {anchor = {}, width = test_length, height = 10} BY = {anchor = {}, width = test_length, height = 10} BZ = {anchor = {}, width = test_length, height = 0} CX = {anchor = {}, width = test_length, height = 10} CY = {anchor = {}, width = test_length, height = 10} CZ = {anchor = {}, width = test_length, height = 10} ---- X_width = math.max(AX.width,BX.width,CX.width) Y_width = math.max(AY.width,BY.width,CY.width) Z_width = math.max(AZ.width,BZ.width,CZ.width) ---- AX.anchor.top = 0 AY.anchor.top = 0 AZ.anchor.top = 0 AX.anchor.left = 0 AY.anchor.left = X_width + 4 AZ.anchor.left = X_width + Y_width + 8 ---- BX.anchor.top = AX.height + 1 BY.anchor.top = AY.height + 1 BZ.anchor.top = AZ.height + 1 BX.anchor.left = 0 BY.anchor.left = X_width + 4 BZ.anchor.left = X_width + Y_width + 8 ---- CX.anchor.top = AX.height + BX.height + 2 CY.anchor.top = AY.height + BY.height + 2 CZ.anchor.top = AZ.height + BZ.height + 2 CX.anchor.left = 0 CY.anchor.left = X_width + 4 CZ.anchor.left = X_width + Y_width + 8 -- Create frames self:addviews{ widgets.Panel{view_id = 'main', frame = { l = 0, r = 0 }, frame_inset = 1, subviews = { widgets.List{ view_id = 'AX', frame = { l = AX.anchor.left, t = AX.anchor.top, w = X_width, h = AX.height}, }, widgets.List{ view_id = 'AY', frame = { l = AY.anchor.left, t = AY.anchor.top, w = Y_width, h = AY.height}, }, widgets.List{ view_id = 'AZ', frame = { l = AZ.anchor.left, t = AZ.anchor.top, w = Z_width, h = AZ.height}, }, widgets.List{ view_id = 'BX', frame = { l = BX.anchor.left, t = BX.anchor.top, w = X_width, h = BX.height}, }, widgets.List{ view_id = 'CX', frame = { l = CX.anchor.left, t = CX.anchor.top, w = X_width, h = CX.height}, }, widgets.List{ view_id = 'BZ', frame = { l = BZ.anchor.left, t = BZ.anchor.top, w = Z_width, h = BZ.height}, }, widgets.List{ view_id = 'CZ', frame = { l = CZ.anchor.left, t = CZ.anchor.top, w = CZ.width, h = CZ.height}, }, widgets.List{ view_id = 'CY', frame = { l = CY.anchor.left, t = CY.anchor.top, w = Y_width, h = CY.height}, }, widgets.List{ view_id = 'BY', frame = { l = BY.anchor.left, t = BY.anchor.top, w = Y_width, h = BY.height}, }}}} self:addviews{ widgets.Panel{ view_id = 'bottomView', frame = { b = 0, h = 1}, subviews = { widgets.Label{ view_id = 'bottom_ui', frame = { l = 0, t = 0} text = 'filled by updateBottom()' }}}} self:addviews{ widgets.Panel{ view_id = 'attributeView', frame = { l = 0, r = 0 }, frame_inset = 1, subviews = { widgets.List{ view_id = 'attributeViewDetailed', frame = { l = 0, t = 0}, }}}} self:addviews{ widgets.Panel{ view_id = 'thoughtsView', frame = { l = 0, r = 0 }, frame_inset = 1, subviews = { widgets.List{ view_id = 'thoughtsViewDetailed', frame = { l = 0, t = 0}, }, widgets.List{ view_id = 'thoughtsViewDetailed2', frame = { l = 45, t = 0}, }}}} self:addviews{ widgets.Panel{ view_id = 'syndromeView', frame = { l = 0, r = 0 }, frame_inset = 1, subviews = { widgets.List{ view_id = 'syndromeViewDetailed', frame = { l = 0, t = 0}, }}}} self:addviews{ widgets.Panel{ view_id = 'classView2', frame = { l = 51, r = 0}, frame_inset = 1, subviews = { widgets.List{ view_id = 'classViewDetailedDetails1', frame = { l = 0, t = 0}, }, widgets.List{ view_id = 'classViewDetailedDetails2', frame = { l = 40, t = 2}, } } }, widgets.Panel{ view_id = 'classView', frame = { l = 0, r = 0 }, frame_inset = 1, subviews = { widgets.List{ view_id = 'classViewDetailedTop', frame = { l = 0, t = 0}, }, widgets.FilteredList{ view_id = 'classViewDetailedClasses', on_select = self:callback('checkClass'), on_submit = self:callback('changeClass'), text_pen=dfhack.pen.parse{fg=COLOR_DARKGRAY,bg=0}, cursor_pen=dfhack.pen.parse{fg=COLOR_YELLOW,bg=0}, frame = { l = 0, t = 3}, } } } } self:addviews{ widgets.Panel{ view_id = 'featView2', frame = { l = 51, r = 0}, frame_inset = 1, subviews = { widgets.List{ view_id = 'featViewDetailedDetails1', frame = { l = 0, t = 0}, }, widgets.List{ view_id = 'featViewDetailedDetails2', frame = { l = 40, t = 2}, } } }, widgets.Panel{ view_id = 'featView', frame = { l = 0, r = 0 }, frame_inset = 1, subviews = { widgets.List{ view_id = 'featViewDetailedTop', frame = { l = 0, t = 0}, }, widgets.FilteredList{ view_id = 'featViewDetailedFeats', on_select = self:callback('checkFeat'), on_submit = self:callback('changeFeat'), text_pen=dfhack.pen.parse{fg=COLOR_DARKGRAY,bg=0}, cursor_pen=dfhack.pen.parse{fg=COLOR_YELLOW,bg=0}, frame = { l = 0, t = 3}, } } } } self:addviews{ widgets.Panel{ view_id = 'spellView2', frame = { l = 51, r = 0}, frame_inset = 1, subviews = { widgets.List{ view_id = 'spellViewDetailedDetails1', frame = { l = 0, t = 0}, }, widgets.List{ view_id = 'spellViewDetailedDetails2', frame = { l = 40, t = 2}, } } }, widgets.Panel{ view_id = 'spellView', frame = { l = 0, r = 0 }, frame_inset = 1, subviews = { widgets.List{ view_id = 'spellViewDetailedTop', frame = { l = 0, t = 0}, }, widgets.FilteredList{ view_id = 'spellViewDetailedSpells', on_select = self:callback('checkSpell'), on_submit = self:callback('changeSpell'), text_pen=dfhack.pen.parse{fg=COLOR_DARKGRAY,bg=0}, cursor_pen=dfhack.pen.parse{fg=COLOR_YELLOW,bg=0}, frame = { l = 0, t = 3}, } } } } self.subviews.attributeView.visible = false self.subviews.classView.visible = false self.subviews.classView2.visible = false self.subviews.spellView.visible = false self.subviews.spellView2.visible = false self.subviews.featView.visible = false self.subviews.featView2.visible = false self.subviews.syndromeView.visible = false self.subviews.thoughtsView.visible = false self.subviews.main.visible = true self.subviews.bottomView.visible = true self:fillMain() self:updateBottom() self:detailsAttributes() self:detailsSyndromes() self:detailsThoughts() self:classList('Available') self:spellList('Available') self:featList('Available') end function UnitViewUi:updateBottom() if self.classSystem then text = { { key = 'CUSTOM_SHIFT_A', text = ': Attributes ', on_activate = self:callback('attributeView') }, { key = 'CUSTOM_SHIFT_H', text = ': Health ', on_activate = self:callback('healthView') }, { key = 'CUSTOM_SHIFT_S', text = ': Syndromes ', on_activate = self:callback('syndromeView') }, { key = 'CUSTOM_SHIFT_T', text = ': Thoughts and Preferences ', on_activate = self:callback('thoughtsView') }, { text = NEWLINE }, { key = 'CUSTOM_SHIFT_C', text = ': Classes ', on_activate = self:callback('classView') }, { key = 'CUSTOM_SHIFT_F', text = ': Feats ', on_activate = self:callback('featView') }, { key = 'CUSTOM_SHIFT_P', text = ': Spells ', on_activate = self:callback('spellView') }, } else text = { { key = 'CUSTOM_SHIFT_A', text = ': Attributes ', on_activate = self:callback('attributeView') }, { key = 'CUSTOM_SHIFT_H', text = ': Health ', on_activate = self:callback('healthView') }, { key = 'CUSTOM_SHIFT_S', text = ': Syndromes ', on_activate = self:callback('syndromeView') }, { key = 'CUSTOM_SHIFT_T', text = ': Thoughts and Preferences ', on_activate = self:callback('thoughtsView') }, } end self.subviews.bottom_ui:setText(text) end function UnitViewUi:attributeView() self.subviews.bottom_ui:setText({ { text = 'ESC: Back'} }) self.subviews.attributeView.visible = true self.subviews.main.visible = false end function UnitViewUi:classView() self.subviews.bottom_ui:setText({ { key = 'CUSTOM_SHIFT_A', text = ': Show All Classes ', on_activate = function () self:classList('All') end }, { key = 'CUSTOM_SHIFT_C', text = ': Show Civilization Classes ', on_activate = function () self:classList('Civ') end }, { key = 'CUSTOM_SHIFT_K', text = ': Show Known Classes ', on_activate = function () self:classList('Learned') end }, { key = 'CUSTOM_SHIFT_V', text = ': Show Available Classes ', on_activate = function () self:classList('Available') end }, { text = 'ESC: Back'} }) self.subviews.classView.visible = true self.subviews.classView2.visible = true self.subviews.main.visible = false end function UnitViewUi:featView() self.subviews.bottom_ui:setText({ { key = 'CUSTOM_SHIFT_A', text = ': Show All Feats ', on_activate = function () self:featList('All') end }, { key = 'CUSTOM_SHIFT_K', text = ': Show Known Feats ', on_activate = function () self:featList('Learned') end }, { key = 'CUSTOM_SHIFT_V', text = ': Show Available Feats ', on_activate = function () self:featList('Available') end }, { text = 'ESC: Back'} }) self.subviews.featView.visible = true self.subviews.featView2.visible = true self.subviews.main.visible = false end function UnitViewUi:healthView() return end function UnitViewUi:spellView() self.subviews.bottom_ui:setText({ { key = 'CUSTOM_SHIFT_A', text = ': Show All Spells ', on_activate = function () self:spellList('All') end }, { key = 'CUSTOM_SHIFT_C', text = ': Show Class Spells ', on_activate = function () self:spellList('Class') end }, { key = 'CUSTOM_SHIFT_K', text = ': Show Known Spells ', on_activate = function () self:spellList('Learned') end }, { key = 'CUSTOM_SHIFT_T', text = ': Show Active Spells ', on_activate = function () self:spellList('Active') end }, { key = 'CUSTOM_SHIFT_V', text = ': Show Available Spells ', on_activate = function () self:spellList('Available') end }, { text = 'ESC: Back'} }) self.subviews.spellView.visible = true self.subviews.spellView2.visible = true self.subviews.main.visible = false end function UnitViewUi:syndromeView() self.subviews.bottom_ui:setText({ { text = 'ESC: Back'} }) self.subviews.syndromeView.visible = true self.subviews.main.visible = false end function UnitViewUi:thoughtsView() self.subviews.bottom_ui:setText({ { text = 'ESC: Back'} }) self.subviews.thoughtsView.visible = true self.subviews.main.visible = false end function UnitViewUi:fillMain() unit = self.target width = self.test_length base = guiFunctions.getBaseOutput(unit,width) info = guiFunctions.getInfo(unit,width) self.info = info description = guiFunctions.getDescriptionOutput(info,width) health = guiFunctions.getHealthOutput(info,width) worship = guiFunctions.getWorshipOutput(info,width) appearance = guiFunctions.getAppearanceOutput(info,width) skills = guiFunctions.getSkillsOutput(unit,width) attributes = guiFunctions.getAttributesOutput(info,width) if self.classSystem then class = guiFunctions.getClassOutput(unit,width) end --AX self.subviews.AX:setChoices(base) --AY self.subviews.AY:setChoices(description) --AZ if self.classSystem then self.subviews.AZ:setChoices(class) end --BX self.subviews.BX:setChoices(worship) --BY self.subviews.BY:setChoices(appearance) --BZ self.subviews.BZ:setChoices(skills) --CX self.subviews.CX:setChoices(health) --CY self.subviews.CY:setChoices(attributes) --CZ -- self.subviews.CZ:setChoices() end function UnitViewUi:detailsAttributes() unit = self.target insert = guiFunctions.getAttributesDetails(unit) self.subviews.attributeViewDetailed:setChoices(insert) end function UnitViewUi:classList(filter) unit = self.target classList = guiFunctions.getClassList(unit,filter) in2 = {} table.insert(in2,{text = {{text=center('Classes',40),width=30,pen=COLOR_LIGHTCYAN}}}) table.insert(in2,{text = { {text='Class',width=21,pen=COLOR_LIGHTMAGENTA}, {text='Level',width=7,rjustify=true,pen=COLOR_LIGHTMAGENTA}, {text='Experience',width=12,rjustify=true,pen=COLOR_LIGHTMAGENTA}, }}) self.subviews.classViewDetailedClasses:setChoices(classList) self.subviews.classViewDetailedTop:setChoices(in2) end function UnitViewUi:checkClass(index,choice) if not choice then return end unit = self.target input, input2, check = guiFunctions.getClassDetails(unit,choice) self.subviews.classViewDetailedDetails1:setChoices(input) self.subviews.classViewDetailedDetails2:setChoices(input2) end function UnitViewUi:changeClass(index,choice) unit = self.target local name = choice.text[1].text local persistTable = require 'persist-table' local classTable = persistTable.GlobalTable.roses.ClassTable for _,x in pairs(classTable._children) do if classTable[x].Name == name then class = x break end end if dfhack.script_environment('functions/class').checkRequirementsClass(unit,class) then dfhack.script_environment('functions/class').changeClass(unit,class) else return end end function UnitViewUi:spellList(filter) unit = self.target spellList = guiFunctions.getSpellList(unit,filter) in2 = {} table.insert(in2,{text = {{text=center('Spells',40),width=30,pen=COLOR_LIGHTCYAN}}}) table.insert(in2,{text = { {text='Spell',width=20,pen=COLOR_LIGHTMAGENTA}, {text='Sphere',width=10,rjustify=true,pen=COLOR_LIGHTMAGENTA}, {text='School',width=10,rjustify=true,pen=COLOR_LIGHTMAGENTA}, }}) self.subviews.classViewDetailedSpells:setChoices(spellList) self.subviews.classViewDetailedTop:setChoices(in2) end function UnitViewUi:checkSpell(index,choice) if not choice then return end unit = self.target input, input2, check = guiFunctions.getSpellDetails(unit,choice) self.subviews.spellViewDetailedDetails1:setChoices(input) self.subviews.spellViewDetailedDetails2:setChoices(input2) end function UnitViewUi:changeSpell(index,choice) unit = self.target local name = choice.text[1].text local persistTable = require 'persist-table' local spellTable = persistTable.GlobalTable.roses.SpellTable for _,x in pairs(spellTable._children) do if spellTable[x].Name == name then spell = x break end end if dfhack.script_environment('functions/class').checkRequirementsSpell(unit,spell) then dfhack.script_environment('functions/class').changeSpell(unit,spell,'add') else return end end function UnitViewUi:featList(filter) unit = self.target featList = guiFunctions.getClassList(unit,filter) in2 = {} table.insert(in2,{text = {{text=center('Feats',40),width=40,pen=COLOR_LIGHTCYAN}}}) table.insert(in2,{text = { {text='Feat',width=40,pen=COLOR_LIGHTMAGENTA} }}) self.subviews.classViewDetailedClasses:setChoices(featList) self.subviews.classViewDetailedTop:setChoices(in2) end function UnitViewUi:checkFeat(index,choice) if not choice then return end unit = self.target input, input2, check = guiFunctions.getFeatDetails(unit,choice) self.subviews.featViewDetailedDetails1:setChoices(input) self.subviews.featViewDetailedDetails2:setChoices(input2) end function UnitViewUi:changeFeat(index,choice) unit = self.target local name = choice.text[1].text local persistTable = require 'persist-table' local featTable = persistTable.GlobalTable.roses.FeatTable for _,x in pairs(featTable._children) do if featTable[x].Name == name then feat = x break end end if dfhack.script_environment('functions/class').checkRequirementsFeat(unit,feat) then dfhack.script_environment('functions/class').addFeat(unit,feat) else return end end function UnitViewUi:detailsSyndromes() unit = self.target insert = guiFunctions.getSyndromesDetails(unit) self.subviews.syndromeViewDetailed:setChoices(insert) end function UnitViewUi:detailsThoughts() info = self.info insert1, insert2 = guiFunctions.getThoughtsDetails(info) self.subviews.thoughtsViewDetailed:setChoices(insert1) self.subviews.thoughtsViewDetailed2:setChoices(insert2) end function UnitViewUi:onInput(keys) if keys.LEAVESCREEN then if self.subviews.syndromeView.visible then self:updateBottom() self.subviews.syndromeView.visible = false self.subviews.main.visible = true elseif self.subviews.attributeView.visible then self:updateBottom() self.subviews.attributeView.visible = false self.subviews.main.visible = true elseif self.subviews.classView.visible then self:updateBottom() self.subviews.classView.visible = false self.subviews.classView2.visible = false self.subviews.main.visible = true elseif self.subviews.featView.visible then self:updateBottom() self.subviews.featView.visible = false self.subviews.featView2.visible = false self.subviews.main.visible = true elseif self.subviews.spellView.visible then self:updateBottom() self.subviews.spellView.visible = false self.subviews.spellView2.visible = false self.subviews.main.visible = true elseif self.subviews.thoughtsView.visible then self:updateBottom() self.subviews.thoughtsView.visible = false self.subviews.main.visible = true else self:dismiss() end else UnitViewUi.super.onInput(self, keys) end end function show_editor(trg) local screen = UnitViewUi{target=trg} screen:show() end show_editor(getTargetFromScreens())
mit
weiDDD/WSSParticleSystem
cocos2d/cocos/scripting/lua-bindings/auto/api/ControlPotentiometer.lua
1
6670
-------------------------------- -- @module ControlPotentiometer -- @extend Control -- @parent_module cc -------------------------------- -- -- @function [parent=#ControlPotentiometer] setPreviousLocation -- @param self -- @param #vec2_table var -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] setValue -- @param self -- @param #float value -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] getProgressTimer -- @param self -- @return ProgressTimer#ProgressTimer ret (return value: cc.ProgressTimer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] getMaximumValue -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Returns the angle in degree between line1 and line2. -- @function [parent=#ControlPotentiometer] angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint -- @param self -- @param #vec2_table beginLineA -- @param #vec2_table endLineA -- @param #vec2_table beginLineB -- @param #vec2_table endLineB -- @return float#float ret (return value: float) -------------------------------- -- Factorize the event dispath into these methods. -- @function [parent=#ControlPotentiometer] potentiometerBegan -- @param self -- @param #vec2_table location -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] setMaximumValue -- @param self -- @param #float maximumValue -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] getMinimumValue -- @param self -- @return float#float ret (return value: float) -------------------------------- -- -- @function [parent=#ControlPotentiometer] setThumbSprite -- @param self -- @param #cc.Sprite var -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] getValue -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Returns the distance between the point1 and point2. -- @function [parent=#ControlPotentiometer] distanceBetweenPointAndPoint -- @param self -- @param #vec2_table point1 -- @param #vec2_table point2 -- @return float#float ret (return value: float) -------------------------------- -- -- @function [parent=#ControlPotentiometer] potentiometerEnded -- @param self -- @param #vec2_table location -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] getPreviousLocation -- @param self -- @return vec2_table#vec2_table ret (return value: vec2_table) -------------------------------- -- -- @function [parent=#ControlPotentiometer] setProgressTimer -- @param self -- @param #cc.ProgressTimer var -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] setMinimumValue -- @param self -- @param #float minimumValue -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] getThumbSprite -- @param self -- @return Sprite#Sprite ret (return value: cc.Sprite) -------------------------------- -- Initializes a potentiometer with a track sprite and a progress bar.<br> -- param trackSprite Sprite, that is used as a background.<br> -- param progressTimer ProgressTimer, that is used as a progress bar. -- @function [parent=#ControlPotentiometer] initWithTrackSprite_ProgressTimer_ThumbSprite -- @param self -- @param #cc.Sprite trackSprite -- @param #cc.ProgressTimer progressTimer -- @param #cc.Sprite thumbSprite -- @return bool#bool ret (return value: bool) -------------------------------- -- -- @function [parent=#ControlPotentiometer] potentiometerMoved -- @param self -- @param #vec2_table location -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- Creates potentiometer with a track filename and a progress filename. -- @function [parent=#ControlPotentiometer] create -- @param self -- @param #char backgroundFile -- @param #char progressFile -- @param #char thumbFile -- @return ControlPotentiometer#ControlPotentiometer ret (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] isTouchInside -- @param self -- @param #cc.Touch touch -- @return bool#bool ret (return value: bool) -------------------------------- -- -- @function [parent=#ControlPotentiometer] setEnabled -- @param self -- @param #bool enabled -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] onTouchMoved -- @param self -- @param #cc.Touch pTouch -- @param #cc.Event pEvent -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] onTouchEnded -- @param self -- @param #cc.Touch pTouch -- @param #cc.Event pEvent -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) -------------------------------- -- -- @function [parent=#ControlPotentiometer] onTouchBegan -- @param self -- @param #cc.Touch pTouch -- @param #cc.Event pEvent -- @return bool#bool ret (return value: bool) -------------------------------- -- js ctor -- @function [parent=#ControlPotentiometer] ControlPotentiometer -- @param self -- @return ControlPotentiometer#ControlPotentiometer self (return value: cc.ControlPotentiometer) return nil
apache-2.0
vgire/nn
Dropout.lua
21
1406
local Dropout, Parent = torch.class('nn.Dropout', 'nn.Module') function Dropout:__init(p,v1,inplace) Parent.__init(self) self.p = p or 0.5 self.train = true self.inplace = inplace -- version 2 scales output during training instead of evaluation self.v2 = not v1 if self.p >= 1 or self.p < 0 then error('<Dropout> illegal percentage, must be 0 <= p < 1') end self.noise = torch.Tensor() end function Dropout:updateOutput(input) if self.inplace then self.output = input else self.output:resizeAs(input):copy(input) end if self.train then self.noise:resizeAs(input) self.noise:bernoulli(1-self.p) if self.v2 then self.noise:div(1-self.p) end self.output:cmul(self.noise) elseif not self.v2 then self.output:mul(1-self.p) end return self.output end function Dropout:updateGradInput(input, gradOutput) if self.train then if self.inplace then self.gradInput = gradOutput else self.gradInput:resizeAs(gradOutput):copy(gradOutput) end self.gradInput:cmul(self.noise) -- simply mask the gradients with the noise vector else error('backprop only defined while training') end return self.gradInput end function Dropout:setp(p) self.p = p end function Dropout:__tostring__() return string.format('%s(%f)', torch.type(self), self.p) end
bsd-3-clause
praveenjha527/Algorithm-Implementations
Burrows_Wheeler_Transform/Lua/Yonaba/bwt_test.lua
26
1111
-- Tests for bwt.lua local bwt = require 'bwt' local total, pass = 0, 0 local function dec(str, len) return #str < len and str .. (('.'):rep(len-#str)) or str:sub(1,len) end local function run(message, f) total = total + 1 local ok, err = pcall(f) if ok then pass = pass + 1 end local status = ok and 'PASSED' or 'FAILED' print(('%02d. %68s: %s'):format(total, dec(message,68), status)) end run('Encoding string tests', function() assert(bwt.encode('Banana') == 'annBaa') assert(bwt.encode('burrows-wheeler'),'srhelwereruwb-o') assert(bwt.encode('random rotation'), 'mrtntoaodirn oa') assert(bwt.encode(' '), ' ') end) run('Decoding string tests', function() assert(bwt.decode(bwt.encode('Banana')) == 'Banana') assert(bwt.decode(bwt.encode(' ')) == ' ') assert(bwt.decode(bwt.encode('burrows-wheeler')) == 'burrows-wheeler') assert(bwt.decode(bwt.encode('random rotation')) == 'random rotation') end) print(('-'):rep(80)) print(('Total : %02d: Pass: %02d - Failed : %02d - Success: %.2f %%') :format(total, pass, total-pass, (pass*100/total)))
mit
TheAnswer/FirstTest
bin/scripts/creatures/objects/rori/creatures/mutantBarkMiteHatchling.lua
1
4723
--Copyright (C) 2008 <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. mutantBarkMiteHatchling = Creature:new { objectName = "mutantBarkMiteHatchling", -- Lua Object Name creatureType = "ANIMAL", gender = "", speciesName = "mutant_bark_mite_hatchling", stfName = "mob/creature_names", objectCRC = 1684910254, socialGroup = "Bark Mite", level = 10, combatFlags = ATTACKABLE_FLAG + ENEMY_FLAG + AGGRESSIVE_FLAG, healthMax = 1900, healthMin = 1500, strength = 0, constitution = 0, actionMax = 1900, actionMin = 1500, quickness = 0, stamina = 0, mindMax = 1900, mindMin = 1500, focus = 0, willpower = 0, height = 1, -- Size of creature armor = 0, -- 0 = None; 1 = Light; 2 = Medium; 3 = Heavy kinetic = 0, energy = 0, electricity = 0, stun = -1, blast = 0, heat = 0, cold = 0, acid = 0, lightsaber = 0, accuracy = 0, healer = 0, pack = 1, herd = 1, stalker = 0, killer = 1, ferocity = 0, aggressive = 1, invincible = 0, meleeDefense = 1, rangedDefense = 1, attackCreatureOnSight = "", -- Enter socialGroups weapon = "object/weapon/creature/shared_creature_default_weapon.iff", -- File path to weapon -> object\xxx\xxx\xx weaponName = "Creature Defualt", -- Name ex. 'a Vibrolance' weaponTemp = "creature_default_weapon", -- Weapon Template ex. 'lance_vibrolance' weaponClass = "UnarmedMeleeWeapon", -- Weapon Class ex. 'PolearmMeleeWeapon' weaponEquipped = 0, weaponMinDamage = 80, weaponMaxDamage = 90, weaponAttackSpeed = 2, weaponDamageType = "KINETIC", -- ELECTRICITY, KINETIC, etc weaponArmorPiercing = "NONE", -- LIGHT, NONE, MEDIUM, HEAVY alternateWeapon = "", -- File path to weapon -> object\xxx\xxx\xx alternateWeaponName = "", -- Name ex. 'a Vibrolance' alternateWeaponTemp = "", -- Weapon Template ex. 'lance_vibrolance' alternateWeaponClass = "", -- Weapon Class ex. 'PolearmMeleeWeapon' alternateWeaponEquipped = 0, alternateWeaponMinDamage = 0, alternateWeaponMaxDamage = 0, alternateWeaponAttackSpeed = 0, alternateWeaponDamageType = "", -- ELECTRICITY, KINETIC, etc alternateWeaponArmorPiercing = "", -- LIGHT, NONE, MEDIUM, HEAVY internalNPCDamageModifier = 0.3, -- Damage Modifier to other NPC's lootGroup = "0", -- Group it belongs to for loot tame = 0, -- Likely hood to be tamed datapadItemCRC = 0, mountCRC = 0, mountSpeed = 0, mountAcceleration = 0, milk = 0, boneType = "", boneMax = 20, hideType = "hide_bristley_rori", hideMax = 8, meatType = "meat_insect_rori", meatMax = 10, --skills = { " Blind attack", "", "" } skills = { "barkMiteAttack1" }, respawnTimer = 60, behaviorScript = "", -- Link to the behavior script for this object } Creatures:addCreature(mutantBarkMiteHatchling, 1684910254) -- Add to Global Table
lgpl-3.0