content
stringlengths
5
1.05M
local function init() if not DarkRP then MsgC(Color(255,0,0), "DarkRP Classic Advert tried to run, but DarkRP wasn't declared!\n") return end DarkRP.removeChatCommand("advert") DarkRP.declareChatCommand({ command = "advert", description = "Displays an advertisement to everyone in chat.", delay = 1.5 }) if SERVER then DarkRP.defineChatCommand("advert",function(ply,args) if args == "" then DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "")) return "" end local DoSay = function(text) if text == "" then DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", "")) return end for k,v in pairs(player.GetAll()) do local col = team.GetColor(ply:Team()) DarkRP.talkToPerson(v, col, "[Advert] " .. ply:Nick(), Color(255, 255, 0, 255), text, ply) end end hook.Call("playerAdverted", nil, ply, args) return args, DoSay end, 1.5) else DarkRP.addChatReceiver("/advert", "advertise", function(ply) return true end) end end if SERVER then if #player.GetAll() > 0 then init() else hook.Add("PlayerInitialSpawn", "dfca-load", init) end else hook.Add("InitPostEntity", "dfca-load", init) end
--============ --Snowballs --============ -- Snowballs were destroying nodes if the snowballs landed just right. -- Quite a bit of trial-and-error learning here and it boiled down to a -- small handful of code lines making the difference. ~ LazyJ local creative_mode = minetest.setting_getbool("creative_mode") local snowball_velocity, entity_attack_delay local function update_snowball_vel(v) snowball_velocity = v local walkspeed = tonumber(minetest.setting_get("movement_speed_walk")) or 4 entity_attack_delay = (walkspeed+1)/v end update_snowball_vel(snow.snowball_velocity) local snowball_gravity = snow.snowball_gravity snow.register_on_configuring(function(name, v) if name == "snowball_velocity" then update_snowball_vel(v) elseif name == "snowball_gravity" then snowball_gravity = v end end) local function get_gravity() local grav = tonumber(minetest.setting_get("movement_gravity")) or 9.81 return grav*snowball_gravity end local someone_throwing, just_acitvated --Shoot snowball local function snow_shoot_snowball(item, player) local addp = {y = 1.625} -- + (math.random()-0.5)/5} local dir = player:get_look_dir() local dif = 2*math.sqrt(dir.z*dir.z+dir.x*dir.x) addp.x = dir.z/dif -- + (math.random()-0.5)/5 addp.z = -dir.x/dif -- + (math.random()-0.5)/5 local pos = vector.add(player:getpos(), addp) local obj = minetest.add_entity(pos, "snow:snowball_entity") obj:setvelocity(vector.multiply(dir, snowball_velocity)) obj:setacceleration({x=dir.x*-3, y=-get_gravity(), z=dir.z*-3}) obj:get_luaentity().thrower = player:get_player_name() if creative_mode then if not someone_throwing then someone_throwing = true just_acitvated = true end return end item:take_item() return item end if creative_mode then local function update_step() local active for _,player in pairs(minetest.get_connected_players()) do if player:get_player_control().LMB then local item = player:get_wielded_item() local itemname = item:get_name() if itemname == "default:snow" then snow_shoot_snowball(nil, player) active = true break end end end -- disable the function if noone currently throws them if not active then someone_throwing = false end end -- do automatic throwing using minetest.after local function do_step() local timer -- only if one holds left click if someone_throwing and not just_acitvated then update_step() timer = 0.006 else timer = 0.5 just_acitvated = false end minetest.after(timer, do_step) end minetest.after(3, do_step) end --The snowball Entity local snow_snowball_ENTITY = { physical = false, timer = 0, collisionbox = {-5/16,-5/16,-5/16, 5/16,5/16,5/16}, } function snow_snowball_ENTITY.on_activate(self) self.object:set_properties({textures = {"default_snowball.png^[transform"..math.random(0,7)}}) self.object:setacceleration({x=0, y=-get_gravity(), z=0}) self.lastpos = self.object:getpos() minetest.after(0.1, function(obj) if not obj then return end local vel = obj:getvelocity() if vel and vel.y ~= 0 then return end minetest.after(0, function(obj) if not obj then return end local vel = obj:getvelocity() if not vel or vel.y == 0 then obj:remove() end end, obj) end, self.object) end --Snowball_entity.on_step()--> called when snowball is moving. function snow_snowball_ENTITY.on_step(self, dtime) self.timer = self.timer+dtime if self.timer > 600 then -- 10 minutes are too long for a snowball to fly somewhere self.object:remove() return end if self.physical then local fell = self.object:getvelocity().y == 0 if not fell then return end local pos = vector.round(self.object:getpos()) if minetest.get_node(pos).name == "air" then pos.y = pos.y-1 if minetest.get_node(pos).name == "air" then return end end snow.place(pos) self.object:remove() return end local pos = vector.round(self.object:getpos()) if vector.equals(pos, self.lastpos) then return end if minetest.get_node(pos).name ~= "air" then self.object:setacceleration({x=0, y=-get_gravity(), z=0}) --self.object:setvelocity({x=0, y=0, z=0}) pos = self.lastpos self.object:setpos(pos) minetest.sound_play("default_snow_footstep", {pos=pos, gain=vector.length(self.object:getvelocity())/30}) self.object:set_properties({physical = true}) self.physical = true return end self.lastpos = vector.new(pos) if self.timer < entity_attack_delay then return end for _,v in pairs(minetest.get_objects_inside_radius(pos, 1.73)) do if v ~= self.object then local entity_name = v:get_entity_name() if entity_name ~= "snow:snowball_entity" and entity_name ~= "__builtin:item" and entity_name ~= "gauges:hp_bar" then local vvel = v:getvelocity() or v:get_player_velocity() local veldif = self.object:getvelocity() if vvel then veldif = vector.subtract(veldif, vvel) end local gain = vector.length(veldif)/20 v:punch( (self.thrower and minetest.get_player_by_name(self.thrower)) or self.object, 1, {full_punch_interval=1, damage_groups = {fleshy=math.ceil(gain)}} ) minetest.sound_play("default_snow_footstep", {pos=pos, gain=gain}) spawn_falling_node(pos, {name = "default:snow"}) self.object:remove() return end end end end minetest.register_entity("snow:snowball_entity", snow_snowball_ENTITY) -- Snowball and Default Snowball Merged -- They both look the same, they do basically the same thing (except one is a leftclick throw -- and the other is a rightclick drop),... Why not combine snow:snowball with default:snow and -- benefit from both? ~ LazyJ, 2014_04_08 --[[ Save this for reference and occasionally compare to the default code for any updates. minetest.register_node(":default:snow", { description = "Snow", tiles = {"default_snow.png"}, inventory_image = "default_snowball.png", wield_image = "default_snowball.png", is_ground_content = true, paramtype = "light", buildable_to = true, leveled = 7, drawtype = "nodebox", freezemelt = "default:water_flowing", node_box = { type = "leveled", fixed = { {-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5}, }, }, groups = {crumbly=3,falling_node=1, melts=1, float=1}, sounds = default.node_sound_dirt_defaults({ footstep = {name="default_snow_footstep", gain=0.25}, dug = {name="default_snow_footstep", gain=0.75}, }), on_construct = function(pos) if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "default:dirt_with_grass" or minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "default:dirt" then minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z}, {name="default:dirt_with_snow"}) end -- Now, let's turn the snow pile into a snowblock. ~ LazyJ if minetest.get_node({x=pos.x, y=pos.y-2, z=pos.z}).name == "default:snow" and -- Minus 2 because at the end of this, the layer that triggers the change to a snowblock is the second layer more than a full block, starting into a second block (-2) ~ LazyJ, 2014_04_11 minetest.get_node({x=pos.x, y=pos.y, z=pos.z}).name == "default:snow" then minetest.set_node({x=pos.x, y=pos.y-2, z=pos.z}, {name="default:snowblock"}) end end, on_use = snow_shoot_snowball -- This line is from the 'Snow' mod, the reset is default Minetest. }) --]] minetest.override_item("default:snow", { drop = { max_items = 2, items = { {items = {'snow:moss'}, rarity = 20,}, {items = {'default:snow'},} } }, leveled = 7, node_box = { type = "leveled", fixed = { {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5}, }, }, groups = {cracky=3, crumbly=3, choppy=3, oddly_breakable_by_hand=3, falling_node=1, melts=2, float=1}, sunlight_propagates = true, --Disable placement prediction for snow. node_placement_prediction = "", on_construct = function(pos) pos.y = pos.y-1 local node = minetest.get_node(pos) if node.name == "default:dirt_with_grass" or node.name == "default:dirt" then node.name = "default:dirt_with_snow" minetest.set_node(pos, node) end end, --Handle node drops due to node level. on_dig = function(pos, node, digger) local level = minetest.get_node_level(pos) minetest.node_dig(pos, node, digger) if minetest.get_node(pos).name ~= node.name then local inv = digger:get_inventory() if not inv then return end local left = inv:add_item("main", "default:snow "..tostring(level/7-1)) if not left:is_empty() then minetest.add_item({ x = pos.x + math.random()/2-0.25, y = pos.y + math.random()/2-0.25, z = pos.z + math.random()/2-0.25, }, left) end end end, --Manage snow levels. on_place = function(itemstack, placer, pointed_thing) local under = pointed_thing.under local oldnode_under = minetest.get_node_or_nil(under) local above = pointed_thing.above if not oldnode_under or not above then return end local olddef_under = ItemStack({name=oldnode_under.name}):get_definition() olddef_under = olddef_under or minetest.nodedef_default local place_to -- If node under is buildable_to, place into it instead (eg. snow) if olddef_under.buildable_to then place_to = under else -- Place above pointed node place_to = above end local level = minetest.get_node_level(place_to) if level == 63 then minetest.set_node(place_to, {name="default:snowblock"}) else minetest.set_node_level(place_to, level+7) end if minetest.get_node(place_to).name ~= "default:snow" then local itemstack, placed = minetest.item_place_node(itemstack, placer, pointed_thing) return itemstack, placed end itemstack:take_item() return itemstack end, on_use = snow_shoot_snowball }) --[[ A note about default torches, melting, and "buildable_to = true" in default snow. On servers where buckets are disabled, snow and ice stuff is used to set water for crops and water stuff like fountains, pools, ponds, ect.. It is a common practice to set a default torch on the snow placed where the players want water to be. If you place a default torch *on* default snow to melt it, instead of melting the snow is *replaced* by the torch. Using "buildable_to = false" would fix this but then the snow would no longer pile-up in layers; the snow would stack like thin shelves in a vertical column. I tinkered with the default torch's code (see below) to check for snow at the position and one node above (layered snow logs as the next y position above) but default snow's "buildable_to = true" always happened first. An interesting exercise to better learn how Minetest works, but otherwise not worth it. If you set a regular torch near snow, the snow will melt and disappear leaving you with nearly the same end result anyway. I say "nearly the same" because if you set a default torch on layered snow, the torch will replace the snow and be lit on the ground. If you were able to set a default torch *on* layered snow, the snow would melt and the torch would become a dropped item. ~ LazyJ --]] -- Some of the ideas I tried. ~ LazyJ --[[ local can_place_torch_on_top = function(pos) if minetest.get_node({x=pos.x, y=pos.y, z=pos.z}).name == "default:snow" or minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" then minetest.override_item("default:snow", {buildable_to = false,}) end end --]] --[[ minetest.override_item("default:torch", { --on_construct = function(pos) on_place = function(itemstack, placer, pointed_thing) --if minetest.get_node({x=pos.x, y=pos.y, z=pos.z}).name == "default:snow" -- Even though layered snow doesn't look like it's in the next position above (y+1) -- it registers in that position. Check the terminal's output to see the coord change. --or minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == "default:snow" if pointed_thing.name == "default:snow" then minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name="default:torch"}) end end }) --]]
--- @class GITexture --- An object representing game texture, like a .vtf file. Do not confuse with IMaterial. Returned by IMaterial:GetTexture local GITexture = {} --- Invokes the generator of the texture. Reloads file based textures from disk and clears render target textures. function GITexture:Download() end --- Returns the color of the specified pixel, only works for textures created from PNG files. --- 🦟 **BUG**: [The returned color will not have the color metatable.](https://github.com/Facepunch/garrysmod-issues/issues/2407) --- @param x number @The X coordinate. --- @param y number @The Y coordinate. --- @return table @The color of the pixel as a Color. function GITexture:GetColor(x, y) end --- Returns the true unmodified height of the texture. --- @return number @height function GITexture:GetMappingHeight() end --- Returns the true unmodified width of the texture. --- @return number @width function GITexture:GetMappingWidth() end --- Returns the name of the texture, in most cases the path. --- @return string @name function GITexture:GetName() end --- Returns the modified height of the texture, this value may be affected by mipmapping and other factors. --- @return number @height function GITexture:Height() end --- Returns whenever the texture is valid. (i.e. was loaded successfully or not) --- ℹ **NOTE**: The "error" texture is a valid texture, and therefore this function will return false when used on it. Use ITexture:IsErrorTexture, instead. --- @return boolean @Whether the texture was loaded successfully or not. function GITexture:IsError() end --- Returns whenever the texture is the error texture (pink and black checkerboard pattern). --- @return boolean @Whether the texture is the error texture or not. function GITexture:IsErrorTexture() end --- Returns the modified width of the texture, this value may be affected by mipmapping and other factors. --- @return number @width function GITexture:Width() end
---@class Collector:Object _class("Collector", Object) function Collector:Constructor(groups, groupEvents) ---@type Group self._groups = groups self._groupEvents = groupEvents self.collectedEntities = {} if #groups ~= #groupEvents then error("groups.Length != groupEvents.Length") end end function Collector:Destructor() self._groups = nil self._groupEvents = nil self.collectedEntities = nil end function Collector:Activate() --两个长度一致 for i = 1, #self._groups do local group = self._groups[i] local groupEvent = self._groupEvents[i] local addEntityFunc = self.addEntity if groupEvent == "Added" then group.Ev_OnEntityAdded:RemoveEvent(self, addEntityFunc) group.Ev_OnEntityAdded:AddEvent(self, addEntityFunc) elseif groupEvent == "Removed" then group.Ev_OnEntityRemoved:RemoveEvent(self, addEntityFunc) group.Ev_OnEntityRemoved:AddEvent(self, addEntityFunc) elseif groupEvent == "AddedOrRemoved" then group.Ev_OnEntityAdded:RemoveEvent(self, addEntityFunc) group.Ev_OnEntityAdded:AddEvent(self, addEntityFunc) group.Ev_OnEntityRemoved:RemoveEvent(self, addEntityFunc) group.Ev_OnEntityRemoved:AddEvent(self, addEntityFunc) else error("invalid groupEvent") end end end function Collector:Deactivate() local groups = self._groups for i = 1, #groups do local group = groups[i] local addEntityFunc = self.addEntity group.Ev_OnEntityAdded:RemoveEvent(self, addEntityFunc) group.Ev_OnEntityRemoved:RemoveEvent(self, addEntityFunc) end self:ClearCollectedEntities() end function Collector:ClearCollectedEntities() for _,v in ipairs(self.collectedEntities) do v:Release(self) end self.collectedEntities={} end function Collector:insertCollectedEntities(entity) local e_index = entity:GetCreationIndex() for i,v in ipairs(self.collectedEntities) do if(v:GetCreationIndex() == e_index) then return false end --保持按 entity index 有序 if(v:GetCreationIndex() > e_index) then table.insert(self.collectedEntities, i, entity) return true end end table.insert(self.collectedEntities, entity) return true; end function Collector:addEntity(group, entity, index, component) self:insertCollectedEntities(entity) if entity.Retain then entity:Retain(self) end end function Collector:ToString() end
include("shared.lua") local dynCross = CreateConVar("fw_dynamic_crosshair", 1, FCVAR_ARCHIVE, "Enable/Disable dynamic crosshair") local crosshairPos = { pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0 } function SWEP:DoDrawCrosshair(x, y) if self.Scoped then return end if not IsValid(self.Owner) then return end local vel = 0 local recoil = 0 local spread = 0 if dynCross:GetBool() then vel = math.abs(self.Owner:GetVelocity():Dot(self.Owner:GetForward())) / 10 recoil = math.Clamp(self:GetCurrentRecoil(), 0, self.Primary.MaxRecoil / 2) * 1000 / 2 spread = self.Primary.BaseSpread * 100 if self.Owner:KeyDown(IN_DUCK) then recoil = recoil / 2 end end surface.SetDrawColor(Color(0, 255, 0)) surface.DrawRect(crosshairPos.pos1, y - 1, 10, 2) surface.DrawRect(crosshairPos.pos2, y - 1, 10, 2) surface.DrawRect(x - 1, crosshairPos.pos3, 2, 10) surface.DrawRect(x - 1, crosshairPos.pos4, 2, 10) crosshairPos.pos1 = Lerp(0.1, crosshairPos.pos1, x + vel + recoil + spread) crosshairPos.pos2 = Lerp(0.1, crosshairPos.pos2, x - 10 - vel - recoil - spread) crosshairPos.pos3 = Lerp(0.1, crosshairPos.pos3, y + vel + recoil + spread) crosshairPos.pos4 = Lerp(0.1, crosshairPos.pos4, y - 10 - vel - recoil - spread) end function SWEP:DrawHUD() if self:GetScoped() then surface.SetTexture(surface.GetTextureID("sprites/scope")) surface.SetDrawColor(Color(0, 0, 0)) surface.DrawTexturedRect(ScrW() / 2 - ( ScrH() - 128 ) / 2, 64, ScrH() - 128, ScrH() - 128) surface.SetDrawColor(Color(0, 0, 0)) surface.DrawRect(0, 0, ScrW() / 2 - (ScrH() - 128) / 2, ScrH()) surface.DrawRect(ScrW() / 2 + (ScrH() - 128) / 2, 0, ScrW() / 2 - (ScrH() - 128) / 2, ScrH()) surface.DrawRect(0, 0, ScrW(), 64) surface.DrawRect(0, ScrH() - 64, ScrW(), 64) surface.DrawLine(ScrW() / 2, 0, ScrW() / 2, ScrH()) surface.DrawLine(0, ScrH() / 2, ScrW(), ScrH() / 2) end self:DoDrawCrosshair(ScrW() / 2, ScrH() / 2) end function SWEP:HUDShouldDraw(name) if name == "CHudCrosshair" then return false end end function SWEP:AdjustMouseSensitivity() if self:GetScoped() then return 0.22 -- Assuming players FOV is 90, 20/90 = 0.222222.... so our new sensitivty is that. end end
local M = setmetatable({}, { __index = MenuGameState }) M.__index = M local journal = require "src.components.journal" function M.new(gamestate) local self = setmetatable(MenuGameState.new(gamestate, 'Game Over'), M) self.bg = self.gamestate.images.ui.end_bg if not gamestate.hasFlag('defeated-cultists') then self:addButton('Continue', ContinueGameEvent.new()) end self:addButton('Quit', QuitGameEvent.new()) self.journal = journal.new(gamestate) self:addUiElement(self.journal) return self end return M
local MainModule = require(script.MainModule) MainModule(script.Settings, script.Packages)
----------------------------------- -- Weapon Break -- Great Axe weapon skill -- Skill level: 175 -- Lowers enemy's attack. Duration of effect varies with TP. -- Lowers attack by as much as 25% if unresisted. -- Strong against: Manticores, Orcs, Rabbits, Raptors, Sheep. -- Immune: Crabs, Crawlers, Funguars, Quadavs, Pugils, Sahagin, Scorpion. -- Will stack with Sneak Attack. -- Aligned with the Thunder Gorget. -- Aligned with the Thunder Belt. -- Element: Water -- Modifiers: STR:60% VIT:60% -- 100%TP 200%TP 300%TP -- 1.00 1.00 1.00 ----------------------------------- require("scripts/globals/status") require("scripts/globals/settings") require("scripts/globals/weaponskills") ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {} params.numHits = 1 params.ftp100 = 1 params.ftp200 = 1 params.ftp300 = 1 params.str_wsc = 0.32 params.dex_wsc = 0.0 params.vit_wsc = 0.32 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0 params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0 params.canCrit = false params.acc100 = 0.0 params.acc200= 0.0 params.acc300= 0.0 params.atk100 = 1; params.atk200 = 1; params.atk300 = 1 if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.str_wsc = 0.6 params.vit_wsc = 0.6 end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar) if (damage > 0 and target:hasStatusEffect(tpz.effect.ATTACK_DOWN) == false) then local duration = (120 + (tp/1000 * 60)) * applyResistanceAddEffect(player, target, tpz.magic.ele.WATER, 0) target:addStatusEffect(tpz.effect.ATTACK_DOWN, 25, 0, duration) end return tpHits, extraHits, criticalHit, damage end
--[[ More Blocks: configuration handling Copyright (c) 2011-2015 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] moreblocks.config = {} local function getbool_default(setting, default) local value = minetest.setting_getbool(setting) if value == nil then value = default end return value end local function setting(settingtype, name, default) if settingtype == "bool" then moreblocks.config[name] = getbool_default("moreblocks." .. name, default) else moreblocks.config[name] = minetest.setting_get("moreblocks." .. name) or default end end -- Show stairs/slabs/panels/microblocks in creative inventory (true or false): setting("bool", "stairsplus_in_creative_inventory", false)
require 'src/Dependencies' function love.load() -- initialize our nearest-neighbor filter love.graphics.setDefaultFilter('nearest', 'nearest') -- seed the RNG math.randomseed(os.time()) -- app window title love.window.setTitle('Some Game') gStateMachine = StateMachine { ['title'] = function() return TitleScreenState() end, ['countdown'] = function() return CountdownState() end, ['play'] = function() return PlayState() end, ['score'] = function() return ScoreState() end --['play'] = function() return PlayState() end } gStateMachine:change('title') gSounds['music']:setLooping(true) gSounds['music']:setVolume(0.5) gSounds['music']:play() -- initialize our virtual resolution push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, { vsync = true, fullscreen = false, resizable = true }) love.keyboard.keysPressed = {} -- initialize mouse input table --love.mouse.buttonsPressed = {} end function love.resize(w, h) push:resize(w, h) end function love.keypressed(key) -- add to our table of keys pressed this frame love.keyboard.keysPressed[key] = true if key == 'escape' then love.event.quit() elseif key == 'p' then --love.graphics.draw(pause, 300, 100) if scrolling == true then scrolling = false elseif scrolling == false then scrolling = true end end end function love.update(dt) gStateMachine:update(dt) love.keyboard.keysPressed = {} end function love.draw() push:start() gStateMachine:render() --love.graphics.draw(gTextures['flags'], gFrames['flags'][1], 0,0) push:finish() end --[[ LÖVE2D callback fired each time a mouse button is pressed; gives us the X and Y of the mouse, as well as the button in question. function love.keyboard.wasPressed(key) return love.keyboard.keysPressed[key] end --local medal1 = love.graphics.newImage('medal1.png') function love.update(dt) love.keyboard.keysPressed = {} end function love.draw() push:start() push:finish() end ]]
class("MergeTaskOneStepAwardCommand", pm.SimpleCommand).execute = function (slot0, slot1) if #slot1:getBody().resultList > 0 then slot4 = {} slot5 = {} for slot9, slot10 in ipairs(slot3) do if slot10.isWeekTask then table.insert(slot5, slot10.id) else table.insert(slot4, slot10) end end slot6 = {} function slot7(slot0) for slot4, slot5 in ipairs(slot0) do table.insert(slot0, slot5) end end seriesAsync({ function (slot0) if #slot0 <= 0 then slot0() return end slot1:sendNotification(GAME.SUBMIT_TASK_ONESTEP, { dontSendMsg = true, resultList = slot0, callback = function (slot0) slot0(slot0) slot0() end }) end, function (slot0) if #slot0 <= 0 then slot0() return end slot1:sendNotification(GAME.BATCH_SUBMIT_WEEK_TASK, { dontSendMsg = true, ids = slot0, callback = function (slot0) slot0(slot0) slot0() end }) end }, function () _.map.sendNotification(slot1, GAME.MERGE_TASK_ONE_STEP_AWARD_DONE, { awards = slot1, taskIds = _.map(_.map, function (slot0) return slot0.id end) }) end) end end return class("MergeTaskOneStepAwardCommand", pm.SimpleCommand)
----------------------------------- -- Area: Port Bastok -- NPC: Kaede -- Start Quest: Ayame and Kaede -- Involved in Quests: Riding on the Clouds -- !pos 48 -6 67 236 ----------------------------------- require("scripts/globals/settings"); require("scripts/globals/keyitems"); require("scripts/globals/quests"); local ID = require("scripts/zones/Port_Bastok/IDs"); ----------------------------------- function onTrade(player,npc,trade) if (player:getQuestStatus(JEUNO,tpz.quest.id.jeuno.RIDING_ON_THE_CLOUDS) == QUEST_ACCEPTED and player:getCharVar("ridingOnTheClouds_2") == 4) then if (trade:hasItemQty(1127,1) and trade:getItemCount() == 1) then -- Trade Kindred seal player:setCharVar("ridingOnTheClouds_2",0); player:tradeComplete(); player:addKeyItem(tpz.ki.SMILING_STONE); player:messageSpecial(ID.text.KEYITEM_OBTAINED,tpz.ki.SMILING_STONE); end end end; function onTrigger(player,npc) local ayameKaede = player:getQuestStatus(BASTOK,tpz.quest.id.bastok.AYAME_AND_KAEDE); local WildcatBastok = player:getCharVar("WildcatBastok"); if (player:getQuestStatus(BASTOK,tpz.quest.id.bastok.LURE_OF_THE_WILDCAT) == QUEST_ACCEPTED and player:getMaskBit(WildcatBastok,0) == false) then player:startEvent(352); elseif (ayameKaede == QUEST_AVAILABLE and player:getMainLvl() >= 30) then player:startEvent(240); elseif (ayameKaede == QUEST_ACCEPTED) then player:startEvent(26); elseif (ayameKaede == QUEST_COMPLETED) then player:startEvent(248); else player:startEvent(26); end end; function onEventUpdate(player,csid,option) end; function onEventFinish(player,csid,option) if (csid == 240) then if (player:getQuestStatus(BASTOK,tpz.quest.id.bastok.AYAME_AND_KAEDE) == QUEST_AVAILABLE) then player:addQuest(BASTOK,tpz.quest.id.bastok.AYAME_AND_KAEDE); end elseif (csid == 352) then player:setMaskBit(player:getCharVar("WildcatBastok"),"WildcatBastok",0,true); end end;
local env,table=env,table local json,math,graph,cfg=env.json,env.math,env.class(env.scripter),env.set local template,cr --[[ Please refer to "http://dygraphs.com/options.html" for the graph options that used in .chart files. More examples can be found in folder "oracle\chart" The content of .chart file must follow the lua table syntax. for example: {a=..,b={...}} and it contains at least one attribute "_sql" which returns <date>+<name>+<value(s)> fields Settings: set ChartSeries <number>: Define the max series to be shown in the chart. If the data contains many series, only show the top <number> deviations Common options from dygraphs(available values are all true/false): ylabel,title,height,rollPeriod,drawPoints,logscale,fillGraph,stackedGraph, stepPlot,strokePattern,plotter Other options: _attrs="<sql_statement>" : Select statement to proceduce the attributes, field name matches the attribute name, and must return only one row, the output fields can also can be used as a variable inside "_sql" option i.e.:In below case, the chart title is defined as 'THIS IS TITLE', and &title, &group by variables can be used. _attrs="select 'THIS IS TITLE' title, 'event_name' group_by from dual" _sql ="<sql_statement>" : The select statement to produce the graph data The "_pivot" attribute impacts the SQL output: _pivot=false: X-label = 1st field values, mainly be a time value Asis Name = 2nd+ field names Asis Value = 2nd+ field values(number) 2nd+ fields: field name as the curve name and value as the Y-Asis Example: date(x-label) latch1 latch2 -------------------------------- 2015-1-1 99 98 2015-1-1 97 96 _pivot=true: X-label = 1st field values, mainly be a time value Axis Name = 2nd field value(string) Axis Value = 3rd+ values(number), if colums(N)>3, then create N-2 charts Example: date(x-label) name Y1 Y2 ----------------------------- 2015-1-1 latch1 99 24 2015-1-1 latch2 98 23 ||(split into) \/ date(Y1) latch1 latch2 date(Y2) latch1 latch2 ------------------------- + ------------------------ 2015-1-1 99 98 2015-1-1 24 23 _pivot="mixed": X-label = 1st field values, mainly be a time value Axis Name = <2nd field value(string)> + <3rd+ field name> Axis Value = 3rd+ values Example: date(x-label) name Y1 Y2 ---------------------------- 2015-1-1 latch1 99 24 2015-1-1 latch2 98 23 ||(convert into) \/ date(x-label) latch1[Y1] latch1[Y2] latch2[Y1] latch2[Y2] ---------------------------------------------------------- 2015-1-1 99 24 98 23 Refer to "racping.chart" for more example Special column names: Special column names will not be shown in the report RNK_: If the output contains the "RNK_" field, then only proceduce the top 30 RNK_ data. Refer to "ash.chart" for example RND_: If the output contains both "RNK_" and "RND_", then will not produce the top 30 RNK_ data | : To be developed none-alphanumeric: If the column name is all none-alphanumeric chars or is "", then will not include into the chart report. for example, '*','&%' _pivot=true|false|"mixed": indicate if pivot the >2nd numberic fields, refer to above _ylabels={"<label1>",...}: Customize the ylabel for each chart, if not define then use the names from "_sql" _range="<Time range>" : Used in sub-title, if not specified then auto-caculate the range _sorter=<number> : Choose the top <ChartSeries> based on the nth field of the summary, default as deviation%(12) _series=<number> : Max series to be shown in the chart, default as 20 deviation=true|false : False for org value, and true to display the data based on deviation%(value*100/average) ]]-- function graph:ctor() self.command='graph' self.ext_name='chart' self.ext_command={"graph","gr"} end function graph:run_sql(sql,args,cmd,file) if type(sql)=="table" and not sql._sql then for i=1,#sql do self:run_sql(sql[i],args[i],cmd[i],file[i]) end return end local context,err if sql._sql then sql._sql=env.var.update_text(sql._sql or sql,1,args) context=sql else sql=env.var.update_text(sql._sql or sql,1,args) context,err=table.totable(sql) end if not template then template=env.load_data(env.join_path(env.WORK_DIR,"lib","dygraphs.html"),false) env.checkerr(type(template)=="string",'Cannot load file "dygraphs.html" in folder "lib"!') cr=[[<textarea id="divNoshow@GRAPH_INDEX" style="white-space: nowrap;width:100%;height:300px;display:none">@GRAPH_DATA</textarea> <script type="text/javascript"> write_options(@GRAPH_INDEX); var g@GRAPH_INDEX=new Dygraph( document.getElementById("divShow@GRAPH_INDEX"), function() {return document.getElementById("divNoshow@GRAPH_INDEX").value;}, @GRAPH_ATTRIBUTES ); g@GRAPH_INDEX.ready(function() {sync_options(@GRAPH_INDEX);}); </script> <hr/><br/><br/>]] --template=template:gsub('@GRAPH_FIELDS',cr) end local charts,rs,rows={} env.checkerr(type(context)=="table" and type(context._sql)=="string","Invalid definition, should be a table with '_sql' property!") local default_attrs={ legend='always', rollPeriod=cfg.get("GRAPH_ROLLER"), showRoller=false, height=cfg.get("GRAPH_HEIGHT"), barchart=cfg.get("GRAPH_BARCHART"), smoothed=cfg.get("GRAPH_SMOOTH"), drawPoints=cfg.get("GRAPH_DRAWPOINTS"), deviation=cfg.get("GRAPH_DEVIATION"), logscale=cfg.get("GRAPH_LOGSCALE"), fillGraph=cfg.get("GRAPH_FILLGRAPH"), stackedGraph=cfg.get("GRAPH_STACKEDGRAPH"), stepPlot=cfg.get("GRAPH_STEPPLOT"), strokePattern=cfg.get("GRAPH_STROKEPATTERN"), avoidMinZero=true, includeZero=true, labelsKMB=true, showRangeSelector=cfg.get("GRAPH_RANGER"), axisLabelFontSize=12, animatedZooms=true, legendFormatter="?legendFormatter?", labelsDiv="?document.getElementById('divLabel@INDEX')?", highlightSeriesOpts= { strokeWidth= 2, strokeBorderWidth=2, highlightCircleSize=2, }, axes={x={pixelsPerLabel=50}} } if context._attrs then rs=self.db:exec(context._attrs,args) rows=self.db.resultset:rows(rs,1) local title=rows[1] local value=rows[2] env.checkerr(value,context._error or 'No data found for the given criteria!') for k,v in ipairs(title) do if not v:find('[a-z]') then v=v:lower() end args[v]=value[k] --deal with table if value[k] and value[k]:sub(1,1)=='{' then value[k]=json.decode(value[k]) end default_attrs[v]=value[k] end end if default_attrs.title then print("Running Report ==> "..default_attrs.title..'...') end local sql,pivot=context._sql,context._pivot local command_type=self.db.get_command_type(sql) if not command_type or not env._CMDS[command_type:upper()] then local found,csv=os.exists(sql,"csv") env.checkerr(found,"Cannot find file "..sql) cfg.set("CSVSEP",env.ask("Please define the field separator",'^[^"]$',',')) rows=loader:fetchCSV(csv,-1) else --Only proceduce top 30 curves to improve the performance in case of there is 'RNK_' field if sql:match('%WRNK_%W') and not sql:find('%WRND_%W') then sql='SELECT * FROM (SELECT /*+NO_NOMERGE(A)*/ A.*,dense_rank() over(order by RNK_ desc) RND_ FROM (\n'..sql..'\n) A) WHERE RND_<=30 ORDER BY 1,2' end rs=self.db:exec(sql,args) rows=self.db.resultset:rows(rs,-1) end local title,csv,xlabels,values,collist,temp=string.char(0x1),{},{},table.new(10,255),{},{} local function getnum(val) if not val then return 0 end if type(val)=="number" then return val end local middle=val:match("^.-;(.-);.-$") if middle then default_attrs.customBars=true return getnum(middle) end return tonumber(val:match('[eE%.%-%d]+')) or 0 end local function is_visible(title) return not (title=="RNK_" or title=="RND_" or title=="HIDDEN_" or title:match('^%W*$')) and true or false end --grid.print(rows) local counter,range_begin,range_end,x_name=-1 local head,cols=table.remove(rows,1) local maxaxis=tonumber(default_attrs._series) or cfg.get('Graph_Series') table.sort(rows,function(a,b) return a[1]<b[1] end) --print(table.dump(rows)) if pivot==nil then for i=2,6 do local row=rows[i] if not row then break end local cell=row[2] if cell and cell~="" then if type(cell)=="number" then pivot=false elseif type(cell)~="string" or not cell:match('^[ %d;,%-%+eE]+$') then pivot=true break elseif pivot==nil then pivot=false end end end end if pivot=="mixed" then local data={} for k,v in ipairs(rows) do for i=3,#v do if is_visible(head[i]) then data[#data+1]={v[1],v[2].."["..head[i]..']',v[i]} end end end table.insert(data,1,{head[1],head[2],"Value"}) pivot,rows,head=true,data,data[1] else table.insert(rows,1,head) end local start_value=pivot and 3 or 2 head,cols={},0 x_name=rows[1][1] while true do counter=counter+1 local row=rows[counter+1] if not row then break end if counter==0 then for i=1,#row do local cell=is_visible(row[i]) head[#head+1],head[row[i]],cols=row[i],cell,cols+(cell and 1 or 0) end end for i=#head,1,-1 do if not head[head[i]] then table.remove(row,i) end end for i=1,cols do if row[i]==nil or row[i]=='' then row[i]='' elseif (counter==0 or i<start_value) then row[i]=tostring(row[i]):gsub(",",".") elseif counter>0 and i>=start_value and type(row[i])~="number" and not tostring(row[i]):match('^%d') and not tostring(row[i]):match("^.-;(.-);.-$") then env.raise("Invalid number at row #%d field #%d '%s', row information: [%s]",counter,i,row[i],table.concat(row,',')) end end if counter>0 and row[1]~="" then local x=row[1] if not range_begin then if tonumber(x) then range_begin,range_end=9E9,0 else range_begin,range_end='ZZZZ','0' end end if type(range_begin)=="number" then x=tonumber(x) end range_begin,range_end=range_begin>x and x or range_begin, range_end<x and x or range_end end --For pivot, col1=label, col2=Pivot,col3=y-value --collist: {label={1:nth-axis,2:count,3:1st-min,4:1st-max,5+:sum(value)-of-each-chart},...} if pivot then local x,label,y=row[1],row[2]:trim(),{table.unpack(row,3)} if #xlabels==0 then charts,xlabels[1],values[title]=y,title,table.new(#rows+10,5) values[title][1]=x env.checkerr(#charts>0,'Pivot mode should have at least 3 columns!') print('Fetching data into HTML file...') else if not collist[label] then values[title][#values[title]+1],temp[#temp+1]=label,0 collist[label]={#values[title],0,data={}} end local col=collist[label] if not values[x] then values[x]={x,table.unpack(temp)} xlabels[#xlabels+1]=x end values[x][col[1]]=y local val=getnum(y[1]) if counter>0 then col[2],col.data[#col.data+1]=col[2]+1,val col[3],col[4]=math.min(val,col[3] or val),math.max(val,col[4] or val) end for i=1,#y do col[4+i]=(col[4+i] or 0)+getnum(y[i]) end end else local c=math.min(#row,maxaxis+1) row={table.unpack(row,1,c)} if not values[title] then values[title]=row end csv[#csv+1]=table.concat(row,',') for i=2,c do if counter==0 then row[i]=row[i]:trim() collist[row[i]]={i,0,data={}} --row[i]='"'..row[i]:gsub('"','""')..'"' --quote title fields else local col,val=collist[values[title][i]],getnum(row[i]) if counter>0 then col[2],col[5],col.data[#col.data+1]=col[2]+1,(col[5] or 0)+val,val col[3],col[4]=math.min(val,col[3] or val),math.max(val,col[4] or val) end end end end end env.checkerr(counter>2,"No data found for the given criteria!") print(string.format("%d rows processed.",counter)) --Print summary report local labels={table.unpack(values[title],2)} table.sort(labels,function(a,b) if collist[a][2]==collist[b][2] then return a<b end return collist[a][2]>collist[b][2] end) for k,v in pairs(context) do default_attrs[k]=v end local content,ylabels,default_ylabel = template,default_attrs._ylabels or {},default_attrs.ylabel local output=env.grid.new() output:add{"Item","Total "..(ylabels[1] or default_attrs.ylabel or ""),'|',"Rows","Appear",'%',"Min","Average","Max","Std Deviation","Deviation(%)"} for k,v in pairs(collist) do if v[5] and v[5]>0 then local avg,stddev=v[5]/v[2],0; for _,o in ipairs(v.data) do stddev=stddev+(o-avg)^2/v[2] end v.data,stddev=nil,stddev^0.5 output:add{ k,math.round(v[5],2),'|', v[2],math.round(v[2]*100/counter,2),'|', math.round(v[3],5),math.round(avg,3),math.round(v[4],5), math.round(stddev,3),math.round(100*stddev/avg,3)} else output:add{k,0,'|',0,0,'|',0,0,0,0,0} end end output:add_calc_ratio(2) output:sort(tonumber(default_attrs._sorter) or #output.data[1],true) output:print(true) local data,axises,temp=output.data,{},{} table.remove(data,1) for i=#data,math.max(1,#data-maxaxis+1),-1 do axises[#axises+1],temp[#temp+1]=data[i][1],"" end --Generate graph data self.dataindex,self.data=0,{} if pivot then --Sort the columns by sum(value) for idx=1,#charts do local csv,avgs={},{} for rownum,xlabel in ipairs(xlabels) do local row={values[xlabel][1],table.unpack(temp)} for i=1,#axises do local col=collist[axises[i]] local cell=values[xlabel][col[1]] avgs[i],avgs[axises[i]]=axises[i],col[4+idx]/col[2] row[i+1]=type(cell)=="table" and cell[idx] or cell or 0 --if rownum==1 then row[i+1]='"'..row[i+1]:gsub('"','""')..'"' end --The titles end csv[rownum]=table.concat(row,',') end self.dataindex=self.dataindex+1 self.data[self.dataindex]={table.concat(csv,'\n'),avgs} end else local avgs={} for k,v in pairs(collist) do avgs[#avgs+1],avgs[k]=k,v[5]/v[2] end self.dataindex=self.dataindex+1 self.data[self.dataindex]={table.concat(csv,'\n'),avgs} end local replaces={ ['@GRAPH_TITLE']=default_attrs.title or "", ['@LEGEND_WIDTH']=cfg.get("GRAPH_LEGENDWIDTH")..'px' } local title title,default_attrs.title=default_attrs.title or "",nil x_name=x_name..': '..range_begin..' -- '..range_end for k,v in pairs(default_attrs) do if k:sub(1,1)=='_' then default_attrs[k]=nil end end default_attrs.xlabel=x_name for i=1,self.dataindex do replaces['@GRAPH_INDEX']=i default_attrs.ylabel=ylabels[i] or default_ylabel or charts[i] if default_attrs.ylabel and default_attrs.ylabel:lower():find('byte') then default_attrs.labelsKMB=nil default_attrs.labelsKMG2=true end default_attrs._avgs=self.data[i][2] default_attrs.title=title if default_attrs.ylabel then if title=="" then default_attrs.title="Unit: "..default_attrs.ylabel elseif self.dataindex>1 then default_attrs.title=title.."<div class='dygraph-title-l2'>Unit: "..default_attrs.ylabel..'</div>' end end local attr=json.encode(default_attrs):gsub("@INDEX",i):gsub('"%?([^"]+)%?"','%1') local graph_unit=cr:replace('@GRAPH_ATTRIBUTES',attr,true) for k,v in pairs(replaces) do graph_unit=graph_unit:replace(k,v,true) if i==1 then content=content:replace(k,v,true) end end graph_unit=graph_unit:replace('@GRAPH_DATA','\n'..self.data[i][1]..'\n',true) self:draw_gnuplot(self.data[i][1],default_attrs) content=content..graph_unit end content=content.."</body></html>" local file=env.write_cache(cmd.."_"..os.date('%Y%m%d%H%M%S')..".html",content) print("Result written to "..file) if env.IS_WINDOWS then os.shell(file) elseif PLATFORM=="mac" then os.shell('open','"'..file..'"') else os.shell("xdg-open",'"'..file..'" 2>/dev/null') end end function graph:draw_gnuplot(data,options) end function graph:run_stmt(...) local args={...} env.checkhelp(args[1]) local sql=args[#args] table.remove(args,#args) local fmt={} for index,option in ipairs(args) do if option:sub(1,1)=='-' then option=option:sub(2):lower() if option~='y' and option~='n' and option~='m' then env.checkhelp(nil) end fmt._pivot=option=='y' and true or option=='m' and 'mixed' if option=='n' then fmt._pivot=false end else fmt.title=option end end fmt._sql=sql return self:run_sql(fmt,{},'last_chart') end function graph:__onload() local help=[[ Generate graph chart regarding to the input SQL. Usage: @@NAME [-n|-p|-m] [Graph Title] {<Select Statement>|<CSV file>} Options: -y: the output fields are "<date> <label> <values...>" -n: the output fields are "date <label-1-value> ... <label-n-value>" -m: mix mode, the output fields are "<date> <label> <sub-label values...>" If not specify the option, will auto determine the layout based on the outputs. For the query or CSV file, the output should follow one of the following rules: 1. Column#1 (X-Label) :date/date-in-string/int Column#2 (Axis-Name):string Column#3+(Y-Value) :number, the column name would be the unit description,more columns would generate more charts except specifying the -m option 2. Column#1 (X-label) :date/date-in-string/int Column#2+(Y-Value) :number, the column name would be the axis-name,more columns would generate more charts except specifying the -m option Use 'set graph_xxx <value>' to specify the initial chart settings, type 'set graph' for more information Examples: @@NAME select sysdate+dbms_random.value*365 d,dbms_Random.value*1e6 x,dbms_Random.value*1e6 y from dual connect by rownum<=100; @@NAME select sysdate+dbms_random.value*365 time, decode(mod(rownum,2),1,'X','Y') typ, dbms_Random.value*1e6 value1, dbms_Random.value*1e6 value2 from dual connect by rownum<=200; ]] env.set_command(self,self.ext_command, help,self.run_stmt,'__SMART_PARSE__',4) cfg.init("Graph_Series",12,nil,"graph","Number of top series to be show in graph chart",'1-30') cfg.init("Graph_logscale",false,nil,"graph","Enable/disable the default graph log-scale option",'true/false') cfg.init("Graph_smooth",false,nil,"graph","Enable/disable the default graph smooth option",'true/false') cfg.init("Graph_deviation",false,nil,"graph","Enable/disable the default graph deviation option",'true/false') cfg.init("Graph_ranger",false,nil,"graph","Enable/disable the default graph range-selector option",'true/false') cfg.init("Graph_fillgraph",false,nil,"graph","Enable/disable the default graph fill-graph option",'true/false') cfg.init("Graph_stackedgraph",false,nil,"graph","Enable/disable the default graph stacked-graph option",'true/false') cfg.init("Graph_stepplot",false,nil,"graph","Enable/disable the default graph step-plot option",'true/false') cfg.init("Graph_BarChart",false,nil,"graph","Enable/disable the default graph bar-chart option",'true/false') cfg.init("Graph_strokepattern",false,nil,"graph","Enable/disable the default graph stroke-pattern option",'true/false') cfg.init("Graph_drawpoints",false,nil,"graph","Enable/disable the default graph draw-points option",'true/false/indeterminate') cfg.init("Graph_roller",1,nil,"graph","Set the default graph roll period",'1-20') cfg.init("Graph_height",400,nil,"graph","Set the default graph height(in px)",'50-1000') cfg.init("Graph_legendWidth",220,nil,"graph","Set the default graph legend width(in px)",'50-400') end return graph
--- === plugins.finalcutpro.tangent.workspaces === --- --- Final Cut Pro Workspace Actions for Tangent local require = require --local log = require("hs.logger").new("tangentVideo") local fcp = require("cp.apple.finalcutpro") local i18n = require("cp.i18n") local tools = require "cp.tools" local playErrorSound = tools.playErrorSound local plugin = { id = "finalcutpro.tangent.workspaces", group = "finalcutpro", dependencies = { ["finalcutpro.tangent.common"] = "common", ["finalcutpro.tangent.group"] = "fcpGroup", } } function plugin.init(deps) -------------------------------------------------------------------------------- -- Setup: -------------------------------------------------------------------------------- local id = 0x0F830000 local common = deps.common local fcpGroup = deps.fcpGroup local menuParameter = common.menuParameter local functionParameter = common.functionParameter -------------------------------------------------------------------------------- -- Workspaces: -------------------------------------------------------------------------------- local workspacesGroup = fcpGroup:group(i18n("workspaces")) id = menuParameter(workspacesGroup, id, "default", {"Window", "Workspaces", "Default"}) id = menuParameter(workspacesGroup, id, "organize", {"Window", "Workspaces", "Organize"}) id = menuParameter(workspacesGroup, id, "colorAndEffects", {"Window", "Workspaces", "Color & Effects"}) id = menuParameter(workspacesGroup, id, "dualDisplays", {"Window", "Workspaces", "Dual Displays"}) for i=1, 5 do id = functionParameter(workspacesGroup, id, i18n("customWorkspace") .. " " .. tostring(i), function() local customWorkspaces = fcp:customWorkspaces() if #customWorkspaces >= i then fcp:doSelectMenu({"Window", "Workspaces", i}):Now() else playErrorSound() end end) end end return plugin
local Gender = require("classes/Gender.lua") local Attachment = require("classes/Attachment.lua") local JB = {} JB.__index = JB function JB:new() local class = {} db:exec[=[ CREATE TABLE cameras(id, x, y, z, w, rx, ry, rz, rw, camSwitch, freeForm); INSERT INTO cameras VALUES(0, 0, -2, 0, 0, 0, 0, 0, 0, false, false); INSERT INTO cameras VALUES(1, 0.5, -2, 0, 0, 0, 0, 0, 0, false, false); INSERT INTO cameras VALUES(2, -0.5, -2, 0, 0, 0, 0, 0, 0, false, false); INSERT INTO cameras VALUES(3, 0, 4, 0, 0, 50, 0, 4000, 0, true, false); INSERT INTO cameras VALUES(4, 0, 4, 0, 0, 50, 0, 4000, 0, true, true); ]=] db:exec[=[ CREATE TABLE settings(id, name, value); INSERT INTO settings VALUES(0, "isTppEnabled", false); INSERT INTO settings VALUES(1, "weaponOverride", true); INSERT INTO settings VALUES(2, "animatedFace", false); INSERT INTO settings VALUES(3, "allowCameraBobbing", false); ]=] db:exec("INSERT INTO settings SELECT 4, 'camActive', 1 WHERE NOT EXISTS(SELECT 1 FROM settings WHERE id = 4);") db:exec("INSERT INTO settings SELECT 5, 'ModelMod', false WHERE NOT EXISTS(SELECT 1 FROM settings WHERE id = 5);") for index, value in db:rows("SELECT value FROM settings WHERE name = 'weaponOverride'") do if(index[1] == 0) then class.weaponOverride = false else class.weaponOverride = true end end for index, value in db:rows("SELECT value FROM settings WHERE name = 'isTppEnabled'") do if(index[1] == 0) then class.isTppEnabled = false else class.isTppEnabled = true end end for index, value in db:rows("SELECT value FROM settings WHERE name = 'animatedFace'") do if(index[1] == 0) then class.animatedFace = false else class.animatedFace = true end end for index, value in db:rows("SELECT value FROM settings WHERE name = 'allowCameraBobbing'") do if(index[1] == 0) then class.allowCameraBobbing = false else class.allowCameraBobbing = true end end for index, value in db:rows("SELECT value FROM settings WHERE name = 'camActive'") do class.camActive = tonumber(index[1]) end for index, value in db:rows("SELECT value FROM settings WHERE name = 'ModelMod'") do if(index[1] == 0) then class.ModelMod = false else class.ModelMod = true end end ----------VARIABLES------------- class.camViews = {} class.inCar = false class.timeStamp = 0.0 class.switchBackToTpp = false class.carCheckOnce = false class.waitForCar = false class.waitTimer = 0.0 class.timerCheckClothes = 0.0 class.carActivated = false class.photoModeBeenActive = false class.headTimer = 1.0 class.inScene = false class.zoomIn = false class.zoomOut = false ----------VARIABLES------------- setmetatable( class, JB ) return class end function JB:SetEnableTPPValue(value) self.isTppEnabled = value db:exec("UPDATE settings SET value = " .. tostring(self.isTppEnabled) .. " WHERE name = 'isTppEnabled'") end function JB:CheckForRestoration(delta) local PlayerSystem = Game.GetPlayerSystem() local PlayerPuppet = PlayerSystem:GetLocalPlayerMainGameObject() local fppCam = PlayerPuppet:FindComponentByName(CName.new("camera")) local script = Game.GetScriptableSystemsContainer():Get(CName.new('TakeOverControlSystem')):GetGameInstance() local photoMode = script.GetPhotoModeSystem() if(self.zoomIn) then self:Zoom(0.20) end if(self.zoomOut) then self:Zoom(-0.20) end local str = "player_photomode_head" if self.animatedFace then str = "character_customization_head" end self.headTimer = self.headTimer - delta if self.headTimer <= 0 then if self.isTppEnabled and not self.inCar then if not (tostring(Attachment:GetNameOfObject('AttachmentSlots.TppHead')) == str) then Gender:AddHead(self.animatedFace) end else if not self.inCar then if not (tostring(Attachment:GetNameOfObject('AttachmentSlots.TppHead')) == "player_fpp_head") then Gender:AddFppHead() end end end --if self.inCar then --if not (tostring(Attachment:GetNameOfObject('AttachmentSlots.TppHead')) == "player_tpp_head") then --Gender:AddTppHead() --print("adding TPP head") --end --end self.headTimer = 0.1 end if self.isTppEnabled then if photoMode:IsPhotoModeActive() and not self.inScene then self.photoModeBeenActive = true self:DeactivateTPP() end end if not self.isTppEnabled and self.photoModeBeenActive and not photoMode:IsPhotoModeActive() then if self.photoModeBeenActive then self.photoModeBeenActive = false self:ActivateTPP() end end if(self.weaponOverride) then if(self.isTppEnabled) then if(Attachment:HasWeaponActive()) then self.switchBackToTpp = true self:DeactivateTPP() end end if self.switchBackToTpp and not Attachment:HasWeaponActive() then self:ActivateTPP() self.switchBackToTpp = false end end self.inScene = Game.GetWorkspotSystem():IsActorInWorkspot(PlayerPuppet) if self.isTppEnabled and not self.inCar and self.inScene or self.camViews[self.camActive].freeform then fppCam.yawMaxLeft = 3600 fppCam.yawMaxRight = -3600 fppCam.pitchMax = 100 fppCam.pitchMin = -100 end if(self.inCar and self.isTppEnabled and not self.carCheckOnce) then --Gender:AddFppHead() self.carCheckOnce = true end if(not self.inCar and self.carCheckOnce) then self.carCheckOnce = false self.waitForCar = true self.waitTimer = 0.0 end if(self.timerCheckClothes > 10.0) then if not self.inCar then if self.allowCameraBobbing then PlayerPuppet:DisableCameraBobbing(false) else PlayerPuppet:DisableCameraBobbing(true) end end if not self.photoModeBeenActive and self.isTppEnabled then Attachment:TurnArrayToPerspective({"AttachmentSlots.Chest", "AttachmentSlots.Torso", "AttachmentSlots.Head", "AttachmentSlots.Outfit", "AttachmentSlots.Eyes"}, "TPP") end self.timerCheckClothes = 0.0 end if(fppCam:GetLocalPosition().x == 0.0 and fppCam:GetLocalPosition().y == 0.0 and fppCam:GetLocalPosition().z == 0.0) then self:SetEnableTPPValue(false) end if self.inScene and not self.inCar and photoMode:IsPhotoModeActive() then if not (tostring(Attachment:GetNameOfObject('AttachmentSlots.TppHead')) == str) then Gender:AddHead(self.animatedFace) end end end function JB:CarTimer(deltaTime) if(self.waitTimer > 0.4) then self.tppHeadActivated = false self:SetEnableTPPValue(true) self:UpdateCamera() end if(self.waitTimer > 1.0) then Attachment:TurnArrayToPerspective({"AttachmentSlots.Chest", "AttachmentSlots.Torso", "AttachmentSlots.Head", "AttachmentSlots.Outfit", "AttachmentSlots.Eyes"}, "TPP") self.waitTimer = 0.0 self.waitForCar = false end if(self.waitForCar) then self.carCheckOnce = false self.waitTimer = self.waitTimer + deltaTime end end function JB:ResetZoom() self.camViews[self.camActive].pos.y = self.camViews[self.camActive].defaultZoomLevel self:UpdateCamera() end function JB:MoveHorizontal(i) self.camViews[self.camActive].pos.x = self.camViews[self.camActive].pos.x + i self:UpdateCamera() db:exec("UPDATE cameras SET x = '" .. self.camViews[self.camActive].pos.x .. "' WHERE id = " .. self.camActive - 1) end function JB:MoveVertical(i) self.camViews[self.camActive].pos.z = self.camViews[self.camActive].pos.z + i self:UpdateCamera() db:exec("UPDATE cameras SET z = '" .. self.camViews[self.camActive].pos.z .. "' WHERE id = " .. self.camActive - 1) end function JB:Zoom(i) self.camViews[self.camActive].pos.y = self.camViews[self.camActive].pos.y + i self:UpdateCamera() db:exec("UPDATE cameras SET y = '" .. self.camViews[self.camActive].pos.y .. "' WHERE id = " .. self.camActive - 1) end function JB:MoveRotX(i) self.camViews[self.camActive].rot.i = self.camViews[self.camActive].rot.i + i self:UpdateCamera() db:exec("UPDATE cameras SET rx = '" .. self.camViews[self.camActive].rot.i .. "' WHERE id = " .. self.camActive - 1) end function JB:MoveRotY(i) self.camViews[self.camActive].rot.j = self.camViews[self.camActive].rot.j + i self:UpdateCamera() db:exec("UPDATE cameras SET ry = '" .. self.camViews[self.camActive].rot.j .. "' WHERE id = " .. self.camActive - 1) end function JB:MoveRotZ(i) self.camViews[self.camActive].rot.k = self.camViews[self.camActive].rot.k + i self:UpdateCamera() db:exec("UPDATE cameras SET rz = '" .. self.camViews[self.camActive].rot.k .. "' WHERE id = " .. self.camActive - 1) end function JB:RestoreFPPView() if not self.isTppEnabled then local PlayerSystem = Game.GetPlayerSystem() local PlayerPuppet = PlayerSystem:GetLocalPlayerMainGameObject() local fppCam = PlayerPuppet:GetFPPCameraComponent() fppCam:SetLocalPosition(Vector4.new(0.0, 0.0, 0.0, 1.0)) fppCam:SetLocalOrientation(Quaternion.new(0.0, 0.0, 0.0, 1.0)) end end function JB:UpdateCamera() if self.isTppEnabled then local PlayerSystem = Game.GetPlayerSystem() local PlayerPuppet = PlayerSystem:GetLocalPlayerMainGameObject() local fppCam = PlayerPuppet:GetFPPCameraComponent() fppCam:SetLocalPosition(self.camViews[self.camActive].pos) fppCam:SetLocalOrientation(self.camViews[self.camActive].rot) end end function JB:ActivateTPP() Attachment:TurnArrayToPerspective({"AttachmentSlots.Chest", "AttachmentSlots.Torso", "AttachmentSlots.Head", "AttachmentSlots.Outfit", "AttachmentSlots.Eyes"}, "TPP") self:SetEnableTPPValue(true) self:UpdateCamera() Gender:AddHead(self.animatedFace) end function JB:DeactivateTPP () if self.isTppEnabled then local ts = Game.GetTransactionSystem() local player = Game.GetPlayer() ts:RemoveItemFromSlot(player, TweakDBID.new('AttachmentSlots.TppHead'), true, true, true) end self:SetEnableTPPValue(false) self:RestoreFPPView() end function JB:NextCam() self:SwitchCamTo(self.camActive + 1) end function JB:SwitchCamTo(cam) local ps = Game.GetPlayerSystem() local puppet = ps:GetLocalPlayerMainGameObject() local ic = puppet:GetInspectionComponent() if self.camViews[cam] ~= nil then self.camActive = cam db:exec("UPDATE settings SET value = " .. self.camActive .. " WHERE name = 'camActive'") if self.camViews[cam].freeform then ic:SetIsPlayerInspecting(true) else ic:SetIsPlayerInspecting(false) end self:UpdateCamera() else self.camActive = 1 db:exec("UPDATE settings SET value = " .. self.camActive .. " WHERE name = 'camActive'") ic:SetIsPlayerInspecting(false) self:UpdateCamera() end end return JB:new()
-- This file is subject to copyright - contact [email protected] for more information. -- INSTALL: CINEMA -- weapon_vape_hallucinogenic.lua -- Defines a vape which makes hallucinogenic effects on the user's screen -- Vape SWEP by Swamp Onions - http://steamcommunity.com/id/swamponions/ if CLIENT then include('weapon_vape/cl_init.lua') else include('weapon_vape/init.lua') end SWEP.PrintName = "Hallucinogenic Vape" SWEP.Instructions = "LMB: Rip Fat Clouds\n (Hold and release)\nRMB & Reload: Play Sounds\n\nThis juice contains hallucinogens (don't worry, they're healthy and all-natural)" SWEP.VapeAccentColor = Vector(0.1, 0.5, 0.4) SWEP.VapeTankColor = Vector(0.4, 0.25, 0.1) SWEP.VapeID = 5 if CLIENT then local matt = CreateMaterial("screenrefracter", "Refract", { ["$refracttint"] = "[1 1 1]" }) local hallucinate1 = CreateMaterial("hallucinate5", "UnlitGeneric", { ["$basetexture"] = "stone/stonewall004a_normal", }) -- ["$refracttint"] = "[1 1 1]" -- ["$alpha"] = "255", local warpworld = Material("hallucinogenic_warpworld.png") local function worldwarp() return 1 --math.sin(SysTime()*0.05) end function DrawSelfRefract(str) if not HALLUCINOGENICVAPERT or HALLUCINOGENICVAPERT:Width() < ScrW() or HALLUCINOGENICVAPERT:Height() < ScrH() then local w, h = math.power2(ScrW()), math.power2(ScrH()) HALLUCINOGENICVAPERT = GetRenderTargetEx("HALLUCINOGENICVAPERT" .. tostring(w) .. "x" .. tostring(h), w, h, RT_SIZE_NO_CHANGE, MATERIAL_RT_DEPTH_NONE, 1, 0, IMAGE_FORMAT_RGB888) end render.CopyRenderTargetToTexture(render.GetScreenEffectTexture()) render.CopyRenderTargetToTexture(HALLUCINOGENICVAPERT) local realscrw, realscrh = ScrW(), ScrH() render.PushRenderTarget(HALLUCINOGENICVAPERT) render.BlurRenderTarget(HALLUCINOGENICVAPERT, 6 * (1 + math.sin(SysTime() * 0.7)), 6 * (1 + math.sin(SysTime() * 0.6)), 2) -- render.Clear(128,128,128,0) -- need to add or subtract, not draw over. or just do in another pass -- surface.SetMaterial(warpworld) -- surface.SetDrawColor(255 * 0.5 * (1-worldwarp()),128,128,128) -- surface.DrawTexturedRect(0,0,realscrw,realscrh) render.PopRenderTarget() matt:SetTexture("$basetexture", render.GetScreenEffectTexture()) matt:SetTexture("$normalmap", HALLUCINOGENICVAPERT) -- local inverter = math.sin(SysTime()*0.3) -- if inverter > 0 then inverter = inverter^0.2 else inverter=-((-inverter)^0.2) end -- print(inverter) matt:SetFloat("$refractamount", str) render.SetMaterial(matt) render.DrawScreenQuad() -- surface.SetMaterial(hallucinate1) -- surface.SetDrawColor(255,255,255,255) -- surface.DrawTexturedRect(0,0,ScrW(),ScrH()) end hook.Add("RenderScreenspaceEffects", "HallucinogenicVape", function() if (vapeHallucinogen or 0) > 0 then if vapeHallucinogen > 100 then vapeHallucinogen = 100 end local alpha = vapeHallucinogen / 100 local eyeang = LocalPlayer():EyeAngles() local drift = math.min(LocalPlayer():GetVelocity():Length() / 150, 1) * alpha eyeang.p = eyeang.p + FrameTime() * math.sin(SysTime() * 0.6) * drift eyeang.y = eyeang.y + FrameTime() * math.sin(SysTime() * 0.5) * drift * 2 LocalPlayer():SetEyeAngles(eyeang) local coloralpha = alpha ^ 0.33 local distortalpha = math.min(1, ((alpha * 1.1) ^ 3)) DrawMotionBlur(0.05, alpha, 0) DrawSelfRefract(distortalpha * 0.04) local tab = {} tab["$pp_colour_colour"] = 1 + (coloralpha * 0.25) tab["$pp_colour_contrast"] = 1 + (coloralpha * 0.8) tab["$pp_colour_brightness"] = -0.1 * coloralpha DrawColorModify(tab) end end) timer.Create("HallucinogenicVapeCounter", 1, 0, function() if (vapeHallucinogen or 0) > 0 then vapeHallucinogen = vapeHallucinogen - 1 end end) end
return { require("state_ingame") }
local log = HadesLive.Log local json = HadesLive.Lib.json local Connection = HadesLive.Connection local interval = HadesLive.Config.PollInterval local cb_arrs = {} local monitorConnection = function () while true do wait(interval) if Connection.Status == 'closed' then Connection.Open() elseif Connection.Status == 'open' then local payload = Connection.Receive() if payload then local cb_arr = cb_arrs[payload.target] if cb_arr then for i, cb in ipairs(cb_arr) do cb(payload) end end end end end end thread(monitorConnection) HadesLive.send = function (config) if Connection.Status ~= 'open' then log('WARNING - Failed to send message, connection not open.') return end Connection.Send(json.encode(config)) end HadesLive.on = function (target, callback) local cb_arr = cb_arrs[target] or {} table.insert(cb_arr, callback) cb_arrs[target] = cb_arr return function () for i, cb in ipairs(cb_arr) do if cb == callback then table.remove(cb_arr, i) return end end end end
function template (__config) return function (segments) for k, v in ipairs(segments) do assert( type(v)=='table', 'segment "'..k..'" isn\'t a table, perhaps you forgot to define its body') end __config.__template__ = true __config.file = debug.getinfo(2, "S").source segments.__config__ = __config return segments end end function segment (__config) __config.type = __config[1] or __config.type __config[1] = nil assert(__config.type, 'segment must define its type') if __config.type == 'parse' then assert(__config.entry, 'parse segment must define its entry rule') end return function (rules) rules.__config__ = __config return rules end end
return Def.ActorFrame{ LoadActor(THEME:GetPathS("","_swoosh"))..{ StartTransitioningCommand=function(s) s:play() end }; LoadActor(ddrgame.."moveon")..{ InitCommand=function(s) s:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y-10) end, OnCommand=function(s) s:diffuse( Color.White ):accelerate(0.166):diffuse( color("0.5,0.5,0.5,1") ) :zoomy(0.72):sleep(0):diffusealpha(0) end }; LoadActor(ddrgame.."2moveon")..{ InitCommand=function(s) s:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y-10) end, OnCommand=function(s) s:diffusealpha(0):sleep(0.166) :diffusealpha(1):zoomy(0.72):linear(0.133):diffusealpha(0):zoomy(0) end }; };
function onCreate() makeLuaSprite('vignette', 'vignette-black', -500, -300); addLuaSprite('vignette', true); scaleObject('vignette', 1.0, 1.0); makeLuaSprite('stage', 'tabi-stage-destroyed', -500, -300); addLuaSprite('stage', false); makeAnimatedLuaSprite('fire', 'tabi-stage-destroyed-fire', 800, -200); addAnimationByPrefix('fire', 'first', 'Fire', 30, true); objectPlayAnimation('fire', 'first'); addLuaSprite('fire', false); scaleObject('fire', 0.5, 2); makeAnimatedLuaSprite('fire1', 'tabi-stage-destroyed-fire', 350, -230); addAnimationByPrefix('fire1', 'first', 'Fire', 30, true); objectPlayAnimation('fire1', 'first'); addLuaSprite('fire1', false); scaleObject('fire1', 0.5, 2); makeLuaSprite('destroyed-boards', 'tabi-stage-destroyed-boards', -500, -310); addLuaSprite('destroyed-boards', false); makeAnimatedLuaSprite('fire2', 'tabi-stage-destroyed-fire', 1100, -300); addAnimationByPrefix('fire2', 'first', 'Fire', 30, true); objectPlayAnimation('fire2', 'first'); addLuaSprite('fire2', false); scaleObject('fire2', 2, 2); makeAnimatedLuaSprite('fire3', 'tabi-stage-destroyed-fire', -600, -300); addAnimationByPrefix('fire3', 'first', 'Fire', 30, true); objectPlayAnimation('fire3','first'); addLuaSprite('fire3', false); scaleObject('fire3', 2, 2); makeAnimatedLuaSprite('fire4', 'tabi-stage-destroyed-fire', 600, 200); addAnimationByPrefix('fire4', 'first', 'Fire', 30, true); objectPlayAnimation('fire4', 'first'); addLuaSprite('fire4', false); scaleObject('fire4', 1, 1); makeLuaSprite('destroyed-furniture', 'tabi-stage-destroyed-furniture', -500, -310); addLuaSprite('destroyed-furniture', false); makeLuaSprite('destroyed-boombox', 'tabi-stage-destroyed-boombox', 250, 385); scaleObject('destroyed-boombox', 1.2, 1.2); addLuaSprite('destroyed-boombox', false); end
local L = Grid2Options.L Grid2Options:RegisterStatusOptions("range", "target", function(self, status, options, optionParams) local rangeList = {} local ranges, curRange = status.GetRanges() for range in pairs(ranges) do rangeList[range] = tonumber(range) and L["%d yards"]:format(tonumber(range)) or L['Heal Range'] end options.default = { type = "range", order = 55, name = L["Out of range alpha"], desc = L["Alpha value when units are way out of range."], min = 0, max = 1, step = 0.01, get = function () return status.dbx.default end, set = function (_, v) status.dbx.default = v status:UpdateDB() Grid2Frame:UpdateIndicators() end, } options.update = { type = "range", order = 56, name = L["Update rate"], desc = L["Rate at which the status gets updated"], min = 0, max = 5, step = 0.05, bigStep = 0.1, get = function () return status.dbx.elapsed end, set = function (_, v) status.dbx.elapsed = v; status:UpdateDB() end, } options.range = { type = "select", order = 57, name = L["Range"], desc = L["Range in yards beyond which the status will be lost."], get = function () return tonumber(status.dbx.range) or "heal" end, set = function (_, v) status.dbx.range = v; status:UpdateDB() end, values = rangeList, } options.separation = { type = "header", order = 20, name = "", } self:MakeStatusColorOptions(status, options, { width = "full", color1 = L["Out of range"] } ) end )
-- Copyright 2016 The Arken Platform Authors. -- All rights reserved. -- Use of this source code is governed by a BSD-style -- license that can be found in the LICENSE file. -- Object -- primitives ajustes for main objects local Object = Object or {} ------------------------------------------------------------------------------ -- METAMETHOD __index ------------------------------------------------------------------------------ Object.__index = Object ------------------------------------------------------------------------------ -- METAMETHOD __newindex ------------------------------------------------------------------------------ Object.__newindex = function(t, k, v) rawset(t, k, v) if k == 'inherit' and v ~= nil then v(t) end end ------------------------------------------------------------------------------ -- CONSTRUTOR ------------------------------------------------------------------------------ function Object:initialize() -- print('initialize Object') end ------------------------------------------------------------------------------ -- GENERIC CONTRACT ------------------------------------------------------------------------------ function Object:prepare(params) end function Object:validate(params) end function Object:before(params) end function Object:after(params) end function Object:execute(method, params) self:prepare(params) self:validate(params) self:before(params) local result = self[method](self, params) self:after(params) return result end ------------------------------------------------------------------------------ -- SPECIFIC CONTRACT ------------------------------------------------------------------------------ --[[ function Object:contract(name) local contract = require('contract') contract.create(self, name) end ]] ------------------------------------------------------------------------------ -- TRY ------------------------------------------------------------------------------ function Object:try(column, params) local result = nil; if type(self[column]) == 'function' then result = self[column](self, params) else result = self[column] end if result == nil then result = Object.new() end return result end ------------------------------------------------------------------------------ -- NEW ------------------------------------------------------------------------------ function Object.new(record) local obj = record or {} setmetatable(obj, Object) obj:initialize() return obj end ------------------------------------------------------------------------------ -- IS BLANK ------------------------------------------------------------------------------ --[[ function Object:isBlank(column) if self[column] == nil or self[column] == '' then return true else return false end end ]] ------------------------------------------------------------------------------ -- METHODS ------------------------------------------------------------------------------ function Object:methods() local methods = {} for k, v in pairs(self.class) do if type(v) == 'function' then table.insert(methods, k) end end table.sort(methods) return methods end function Object:__tostring() return "" end function Object:call(method, ...) return self[method](self, ...) end function Object:pcall(method, ...) return pcall(self[method], self, ...) end return Object
local str = "Hello world!" print(str:lower())
-- Set the internal TeX parameters to exactly match the values when -- Plain TeX is loaded. -- -- Refer to plain.tex: http://ctan.imsc.res.in/macros/plain/base/plain.tex tex.pretolerance=100 tex.tolerance=200 tex.hbadness=1000 tex.vbadness=1000 tex.linepenalty=10 tex.hyphenpenalty=50 tex.exhyphenpenalty=50 tex.binoppenalty=700 tex.relpenalty=500 tex.clubpenalty=150 tex.widowpenalty=150 tex.displaywidowpenalty=50 tex.brokenpenalty=100 tex.predisplaypenalty=10000 tex.doublehyphendemerits=10000 tex.finalhyphendemerits=5000 tex.adjdemerits=10000 tex.tracinglostchars=1 tex.uchyph=1 tex.defaultskewchar=-1 tex.newlinechar=-1 tex.delimiterfactor=901 tex.showboxbreadth=5 tex.showboxdepth=3 tex.errorcontextlines=5 tex.hfuzz=tex.sp("0.1pt") tex.vfuzz=tex.sp("0.1pt") tex.overfullrule=tex.sp("5pt") tex.hsize=tex.sp("6.5in") tex.vsize=tex.sp("8.9in") tex.maxdepth=tex.sp("4pt") tex.splitmaxdepth=tex.sp("16383.99999pt") tex.boxmaxdepth=tex.sp("16383.99999pt") tex.delimitershortfall=tex.sp("5pt") tex.nulldelimiterspace=tex.sp("1.2pt") tex.scriptspace=tex.sp("0.5pt") tex.parindent=tex.sp("20pt") tex.setglue('parskip', 0, 65536, 0, 0, 0) tex.setglue('abovedisplayskip', 786432, 196608, 589824, 0, 0) tex.setglue('abovedisplayshortskip', 0, 196608, 0, 0, 0) tex.setglue('belowdisplayskip', 786432, 196608, 589824, 0, 0) tex.setglue('belowdisplayshortskip', 458752, 196608, 262144, 0, 0) tex.setglue('topskip', 655360, 0, 0, 0, 0) tex.setglue('splittopskip', 655360, 0, 0, 0, 0) tex.setglue('parfillskip', 0, 65536, 0, 2, 0) tex.setglue('baselineskip', 786432, 0, 0, 0, 0) tex.setglue('lineskip', 65536, 0, 0, 0, 0)
AddCSLuaFile() SWEP.HoldType = "slam" if CLIENT then SWEP.PrintName = "defuser_name" SWEP.Slot = 7 SWEP.ViewModelFOV = 10 SWEP.EquipMenuData = { type = "item_weapon", desc = "defuser_desc" }; SWEP.Icon = "vgui/ttt/icon_defuser" end SWEP.Base = "weapon_tttbase" SWEP.ViewModel = "models/weapons/v_crowbar.mdl" SWEP.WorldModel = "models/weapons/w_defuser.mdl" SWEP.DrawCrosshair = false SWEP.Primary.ClipSize = -1 SWEP.Primary.DefaultClip = -1 SWEP.Primary.Automatic = true SWEP.Primary.Delay = 1 SWEP.Primary.Ammo = "none" SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = true SWEP.Secondary.Ammo = "none" SWEP.Secondary.Delay = 2 SWEP.Kind = WEAPON_EQUIP2 SWEP.CanBuy = {ROLE_DETECTIVE} -- only detectives can buy SWEP.WeaponID = AMMO_DEFUSER --SWEP.AllowDrop = false local defuse = Sound("c4.disarmfinish") function SWEP:PrimaryAttack() self:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) local spos = self.Owner:GetShootPos() local sdest = spos + (self.Owner:GetAimVector() * 80) local tr = util.TraceLine({start=spos, endpos=sdest, filter=self.Owner, mask=MASK_SHOT}) if IsValid(tr.Entity) and tr.Entity.Defusable then local bomb = tr.Entity if bomb.Defusable==true or bomb:Defusable() then if SERVER and bomb.Disarm then bomb:Disarm(self.Owner) sound.Play(defuse, bomb:GetPos()) end self:SetNextPrimaryFire( CurTime() + (self.Primary.Delay * 2) ) end end end function SWEP:SecondaryAttack() self:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) self:SetNextSecondaryFire( CurTime() + 0.1 ) end if CLIENT then function SWEP:Initialize() self:AddHUDHelp("defuser_help", nil, true) return self.BaseClass.Initialize(self) end function SWEP:DrawWorldModel() if not IsValid(self.Owner) then self:DrawModel() end end end function SWEP:Reload() return false end function SWEP:Deploy() if SERVER and IsValid(self.Owner) then self.Owner:DrawViewModel(false) end return true end function SWEP:OnDrop() end
local core = require "sys.core" local testaux = require "testaux" local msg = require "saux.msg" local np = require "sys.netpacket" local server local accept = {} local client = {} local recv = {} return function() server = msg.createserver { addr = "127.0.0.1:8002", accept = function(fd, addr) accept[#accept + 1] = fd --print("accept", addr) end, close = function(fd, errno) --print("close", fd, errno) end, data = function(fd, d, sz) local p, sz = np.pack(d, sz) local m = core.packmulti(p, sz, #accept) for _, fd in pairs(accept) do local ok = server:multicast(fd, m, sz) testaux.assertneq(fd, nil, "multicast test send") testaux.asserteq(ok, true, "multicast test send") end np.drop(p) np.drop(d) end } local ok = server:start() testaux.asserteq(not not ok, true, "multicast test start") local inst for i = 1, 10 do inst = msg.createclient { addr = "127.0.0.1:8002", data = function(fd, d, sz) local m = core.tostring(d, sz) np.drop(d); testaux.asserteq(m, "testmulticast", "muticast validate data") recv[i] = true end, close = function(fd, errno) end } local ok = inst:connect() testaux.asserteq(ok > 0, true, "multicast connect success") client[i] = inst end inst:send("testmulticast") core.sleep(1000) for k, _ in pairs(client) do testaux.asserteq(recv[k], true, "multicast recv count validate") end server:stop() end
-- state-machines-st ------------------------------------------------------- -- copyright (c) 2021 jason delaat -- mit license: https://github.com/jasondelaat/pico8-tools/blob/release/license ---------------------------------------------------------------------------- -- simple state machine manager with setup and teardown functions. -- token count: 111 ------------------------------------------------------------------------ state_machine = {} function state_machine:new() return { _current_state=nil, add_state=state_machine.add_state, set_state=state_machine.set_state, get_state=state_machine.get_state, update=state_machine.update } end function state_machine:add_state(name, transition, setup, teardown) self[name] = {transition=transition, setup=setup, teardown=teardown} end function state_machine:set_state(name) if self._current_state == nil then self[name].setup() end self._current_state = name end function state_machine:get_state() return self[self._current_state] end function state_machine:update() local state = self:get_state() local new_state = state.transition() if new_state != self._current_state then state.teardown() self:set_state(new_state) self:get_state().setup() end end -- end state-machines-st ---------------------------------------------------
local unicode = require("unicode") local buffer = require("doubleBuffering") local bigLetters = {} local pixelHeight = 5 local lettersInterval = 2 local unknownSymbol = "*" local spaceWidth = 2 local letters = { ["0"] = { { 1, 1, 1 }, { 1, 0, 1 }, { 1, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, }, ["1"] = { { 0, 1, 0 }, { 1, 1, 0 }, { 0, 1, 0 }, { 0, 1, 0 }, { 1, 1, 1 }, }, ["2"] = { { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 }, { 1, 0, 0 }, { 1, 1, 1 }, }, ["3"] = { { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 }, }, ["4"] = { { 1, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, }, ["5"] = { { 1, 1, 1 }, { 1, 0, 0 }, { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 }, }, ["6"] = { { 1, 1, 1 }, { 1, 0, 0 }, { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, }, ["7"] = { { 1, 1, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, }, ["8"] = { { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, }, ["9"] = { { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 }, }, ["a"] = { { 0, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 1, 1, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, }, ["b"] = { { 1, 1, 1, 0}, { 1, 0, 0, 1}, { 1, 1, 1, 0}, { 1, 0, 0, 1}, { 1, 1, 1, 1}, }, ["c"] = { { 0, 1, 1, 1 }, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 0, 1, 1, 1 }, }, ["d"] = { { 1, 1, 1, 1, 0 }, { 0, 1, 0, 0, 1 }, { 0, 1, 0, 0, 1 }, { 0, 1, 0, 0, 1 }, { 1, 1, 1, 1, 0 }, }, ["e"] = { { 1, 1, 1, 1 }, { 1, 0, 0, 0 }, { 1, 1, 1, 0 }, { 1, 0, 0, 0 }, { 1, 1, 1, 1 }, }, ["f"] = { { 1, 1, 1, 1 }, { 1, 0, 0, 0 }, { 1, 1, 1, 0 }, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, }, ["g"] = { { 0, 1, 1, 1}, { 1, 0, 0, 0}, { 1, 0, 1, 1}, { 1, 0, 0, 1}, { 0, 1, 1, 1}, }, ["h"] = { { 1, 0, 0, 1}, { 1, 0, 0, 1}, { 1, 1, 1, 1}, { 1, 0, 0, 1}, { 1, 0, 0, 1}, }, ["i"] = { { 1, 1, 1}, { 0, 1, 0}, { 0, 1, 0}, { 0, 1, 0}, { 1, 1, 1}, }, ["j"] = { { 0, 0, 1}, { 0, 0, 1}, { 0, 0, 1}, { 1, 0, 1}, { 0, 1, 0}, }, ["k"] = { { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 1, 0, 0}, { 1, 0, 1, 0}, { 1, 0, 0, 1}, }, ["l"] = { { 1, 0, 0}, { 1, 0, 0}, { 1, 0, 0}, { 1, 0, 0}, { 1, 1, 1}, }, ["m"] = { { 1, 0, 0, 0, 1 }, { 1, 1, 0, 1, 1 }, { 1, 0, 1, 0, 1 }, { 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, }, ["n"] = { { 1, 0, 0, 0, 1 }, { 1, 1, 0, 0, 1 }, { 1, 0, 1, 0, 1 }, { 1, 0, 0, 1, 1 }, { 1, 0, 0, 0, 1 }, }, ["o"] = { { 0, 1, 1, 0}, { 1, 0, 0, 1}, { 1, 0, 0, 1}, { 1, 0, 0, 1}, { 0, 1, 1, 0}, }, ["p"] = { { 1, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 1, 1, 0 }, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, }, ["q"] = { { 0, 1, 1, 0}, { 1, 0, 0, 1}, { 1, 0, 0, 1}, { 1, 0, 1, 1}, { 0, 1, 1, 0}, }, ["r"] = { { 1, 1, 1, 0}, { 1, 0, 0, 1}, { 1, 1, 1, 0}, { 1, 0, 0, 1}, { 1, 0, 0, 1}, }, ["s"] = { { 0, 1, 1, 1}, { 1, 0, 0, 0}, { 0, 1, 1, 0}, { 0, 0, 0, 1}, { 1, 1, 1, 0}, }, ["t"] = { { 1, 1, 1, 1, 1 }, { 0, 0, 1, 0, 0 }, { 0, 0, 1, 0, 0 }, { 0, 0, 1, 0, 0 }, { 0, 0, 1, 0, 0 }, }, ["u"] = { { 1, 0, 0, 1}, { 1, 0, 0, 1}, { 1, 0, 0, 1}, { 1, 0, 0, 1}, { 0, 1, 1, 0}, }, ["v"] = { { 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0 }, { 0, 0, 1, 0, 0 }, }, ["w"] = { { 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, { 1, 0, 1, 0, 1 }, { 1, 0, 1, 0, 1 }, { 0, 1, 0, 1, 0 }, }, ["x"] = { { 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0 }, { 0, 0, 1, 0, 0 }, { 0, 1, 0, 1, 0 }, { 1, 0, 0, 0, 1 }, }, ["y"] = { { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 0, 1, 1, 1 }, { 0, 0, 0, 1 }, { 1, 1, 1, 0 }, }, ["z"] = { { 1, 1, 1, 1, 1 }, { 0, 0, 0, 1, 0 }, { 0, 0, 1, 0, 0 }, { 0, 1, 0, 0, 0 }, { 1, 1, 1, 1, 1 }, }, ["а"] = { { 0, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 1, 1, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, }, ["б"] = { { 1, 1, 1, 1 }, { 1, 0, 0, 0 }, { 1, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 1, 1, 0 }, }, ["в"] = { { 1, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 1, 1, 0 }, }, ["г"] = { { 1, 1, 1 }, { 1, 0, 0 }, { 1, 0, 0 }, { 1, 0, 0 }, { 1, 0, 0 }, }, ["д"] = { { 0, 0, 1, 1, 0 }, { 0, 1, 0, 1, 0 }, { 0, 1, 0, 1, 0 }, { 0, 1, 0, 1, 0 }, { 1, 1, 1, 1, 1 }, }, ["е"] = { { 1, 1, 1, 1 }, { 1, 0, 0, 0 }, { 1, 1, 1, 0 }, { 1, 0, 0, 0 }, { 1, 1, 1, 1 }, }, ["ё"] = { { 1, 0, 1, 0 }, { 0, 0, 0, 0 }, { 1, 1, 1, 1 }, { 1, 0, 0, 0 }, { 1, 1, 1, 0 }, { 1, 0, 0, 0 }, { 1, 1, 1, 1 }, }, ["ж"] = { { 1, 0, 1, 0, 1 }, { 0, 1, 1, 1, 0 }, { 0, 0, 1, 0, 0 }, { 0, 1, 1, 1, 0 }, { 1, 0, 1, 0, 1 }, }, ["з"] = { { 0, 1, 1, 1, 0 }, { 0, 0, 0, 0, 1 }, { 0, 0, 1, 1, 0 }, { 0, 0, 0, 0, 1 }, { 0, 1, 1, 1, 0 }, }, ["и"] = { { 1, 0, 0, 0, 1 }, { 1, 0, 0, 1, 1 }, { 1, 0, 1, 0, 1 }, { 1, 1, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, }, ["й"] = { { 0, 1, 1, 1, 0 }, { 0, 0, 0, 0, 0 }, { 1, 0, 0, 0, 1 }, { 1, 0, 0, 1, 1 }, { 1, 0, 1, 0, 1 }, { 1, 1, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, }, ["к"] = { { 1, 0, 0, 1, 0 }, { 1, 0, 1, 0, 0 }, { 1, 1, 0, 0, 0 }, { 1, 0, 1, 0, 0 }, { 1, 0, 0, 1, 0 }, }, ["л"] = { { 0, 0, 1, 1 }, { 0, 1, 0, 1 }, { 0, 1, 0, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, }, ["м"] = { { 1, 0, 0, 0, 1 }, { 1, 1, 0, 1, 1 }, { 1, 0, 1, 0, 1 }, { 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, }, ["н"] = { { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 1, 1, 1, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, }, ["о"] = { { 0, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 0, 1, 1, 0 }, }, ["п"] = { { 1, 1, 1, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, }, ["р"] = { { 1, 1, 1, 0}, { 1, 0, 0, 1}, { 1, 1, 1, 0}, { 1, 0, 0, 0}, { 1, 0, 0, 0}, }, ["с"] = { { 0, 1, 1, 1 }, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 0, 1, 1, 1 }, }, ["т"] = { { 1, 1, 1, 1, 1 }, { 0, 0, 1, 0, 0 }, { 0, 0, 1, 0, 0 }, { 0, 0, 1, 0, 0 }, { 0, 0, 1, 0, 0 }, }, ["у"] = { { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 0, 1, 1, 1 }, { 0, 0, 0, 1 }, { 1, 1, 1, 0 }, }, ["ф"] = { { 0, 1, 1, 1, 0 }, { 1, 0, 1, 0, 1 }, { 0, 1, 1, 1, 0 }, { 0, 0, 1, 0, 0 }, { 0, 0, 1, 0, 0 }, }, ["х"] = { { 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 0 }, { 0, 0, 1, 0, 0 }, { 0, 1, 0, 1, 0 }, { 1, 0, 0, 0, 1 }, }, ["ц"] = { { 1, 0, 0, 1, 0 }, { 1, 0, 0, 1, 0 }, { 1, 0, 0, 1, 0 }, { 1, 0, 0, 1, 0 }, { 0, 1, 1, 1, 1 }, }, ["ч"] = { { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, { 0, 1, 1, 1 }, { 0, 0, 0, 1 }, { 0, 0, 0, 1 }, }, ["ш"] = { { 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1 }, { 1, 0, 1, 0, 1 }, { 1, 0, 1, 0, 1 }, { 1, 1, 1, 1, 1 }, }, ["щ"] = { { 1, 0, 0, 0, 1, 0 }, { 1, 0, 0, 0, 1, 0 }, { 1, 0, 1, 0, 1, 0 }, { 1, 0, 1, 0, 1, 0 }, { 1, 1, 1, 1, 1, 1 }, }, ["ъ"] = { { 1, 1, 0, 0, 0 }, { 0, 1, 0, 0, 0 }, { 0, 1, 1, 1, 0 }, { 0, 1, 0, 0, 1 }, { 0, 1, 1, 1, 0 }, }, ["ы"] = { { 1, 0, 0, 0, 0, 1 }, { 1, 0, 0, 0, 0, 1 }, { 1, 1, 1, 0, 0, 1 }, { 1, 0, 0, 1, 0, 1 }, { 1, 1, 1, 0, 0, 1 }, }, ["ь"] = { { 1, 0, 0, 0 }, { 1, 0, 0, 0 }, { 1, 1, 1, 0 }, { 1, 0, 0, 1 }, { 1, 1, 1, 0 }, }, ["э"] = { { 1, 1, 1, 0 }, { 0, 0, 0, 1 }, { 0, 1, 1, 1 }, { 0, 0, 0, 1 }, { 1, 1, 1, 0 }, }, ["ю"] = { { 1, 0, 0, 1, 1, 0 }, { 1, 0, 1, 0, 0, 1 }, { 1, 1, 1, 0, 0, 1 }, { 1, 0, 1, 0, 0, 1 }, { 1, 0, 0, 1, 1, 0 }, }, ["я"] = { { 0, 1, 1, 1 }, { 1, 0, 0, 1 }, { 0, 1, 1, 1 }, { 1, 0, 0, 1 }, { 1, 0, 0, 1 }, }, ["-"] = { { 0, 0, 0 }, { 0, 0, 0 }, { 1, 1, 1 }, { 0, 0, 0 }, { 0, 0, 0 }, }, ["_"] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 1, 1, 1 }, }, ["+"] = { { 0, 0, 0 }, { 0, 1, 0 }, { 1, 1, 1 }, { 0, 1, 0 }, { 0, 0, 0 }, }, ["*"] = { { 0, 0, 0 }, { 1, 0, 1 }, { 0, 1, 0 }, { 1, 0, 1 }, { 0, 0, 0 }, }, ["…"] = { { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 }, { 1, 0, 1, 0, 1 }, }, } function bigLetters.draw(x, y, color, symbol, drawWithSymbol) if symbol == " " then return spaceWidth elseif not letters[symbol] then symbol = unknownSymbol end for j = 1, #letters[symbol] do for i = 1, #letters[symbol][j] do if letters[symbol][j][i] == 1 then if not drawWithSymbol then buffer.square(x + i * 2 - 2, y + (pixelHeight - #letters[symbol]) + j - 1, 2, 1, color, 0xFFFFFF, " ") else buffer.text(x + i * 2 - 2, y + (pixelHeight - #letters[symbol]) + j - 1, color, "*") end end end end return #letters[symbol][1] end function bigLetters.drawText(x, y, color, stroka, drawWithSymbol) checkArg(4, stroka, "string") for i = 1, unicode.len(stroka) do x = x + bigLetters.draw(x, y, color, unicode.sub(stroka, i, i), drawWithSymbol) * 2 + lettersInterval end return x end function bigLetters.getTextSize(text) local width, height = 0, 0 local symbol, symbolWidth, symbolHeight for i = 1, unicode.len(text) do symbol = unicode.sub(text, i, i) if symbol == " " then symbolWidth = spaceWidth symbolHeight = 5 elseif not letters[symbol] then symbolHeight = #letters[unknownSymbol] symbolWidth = #letters[unknownSymbol][1] else symbolHeight = #letters[symbol] symbolWidth = #letters[symbol][1] end width = width + symbolWidth * 2 + lettersInterval height = math.max(height, symbolHeight) end return (width - lettersInterval), height end return bigLetters
object_mobile_wod_reanimated_witch_02 = object_mobile_shared_wod_reanimated_witch_02:new { } ObjectTemplates:addTemplate(object_mobile_wod_reanimated_witch_02, "object/mobile/wod_reanimated_witch_02.iff")
local main = require("ido.main") local event = require("ido.event") local advice = require("ido.advice") local cursor = require("ido.cursor") local result = require("ido.result") -- @module accept Accepting functions for Ido local accept = {} -- Accept the selected item -- @return true function accept.selected() advice.wrap{ name = "stop_event_loop", action = function () event.stop() end } if #main.sandbox.variables.results == 0 then advice.wrap{name = "no_results"} else advice.wrap{name = "accept"} end return true end -- Accept the suggestion -- @return true function accept.suggestion() local variables = main.sandbox.variables if #variables.suggestion == 0 then advice.wrap{name = "no_suggestion"} elseif #variables.results == 1 then advice.wrap{ name = "single_result", action = function () accept.selected() end } else advice.wrap{ name = "append_to_query", action = function () cursor.line_end() variables.before = variables.before..variables.suggestion end } advice.wrap{ name = "fetch_results", action = function () result.fetch() end } if #variables.results == 1 then advice.wrap{ name = "single_result_after_fetching", action = function () accept.selected() end } end end advice.wrap{ name = "clear_suggestion", action = function () variables.suggestion = "" end } return true end return accept
local upload = require "resty.upload" local decode = require "cjson.safe".decode local tonumber = tonumber local tmpname = os.tmpname local concat = table.concat local type = type local find = string.find local open = io.open local sub = string.sub local sep = sub(package.config, 1, 1) or "/" local ngx = ngx local req = ngx.req local var = ngx.var local body = req.read_body local file = ngx.req.get_body_file local data = req.get_body_data local pargs = req.get_post_args local uargs = req.get_uri_args local defaults = { tmp_dir = var.reqargs_tmp_dir, timeout = tonumber(var.reqargs_timeout) or 1000, chunk_size = tonumber(var.reqargs_chunk_size) or 4096, max_get_args = tonumber(var.reqargs_max_get_args) or 100, max_post_args = tonumber(var.reqargs_max_post_args) or 100, max_line_size = tonumber(var.reqargs_max_line_size), max_file_size = tonumber(var.reqargs_max_file_size), max_file_uploads = tonumber(var.reqargs_max_file_uploads) } local function read(f) local f, e = open(f, "rb") if not f then return nil, e end local c = f:read "*a" f:close() return c end local function basename(s) local p = 1 local i = find(s, sep, 1, true) while i do p = i + 1 i = find(s, sep, p, true) end if p > 1 then s = sub(s, p) end return s end local function kv(r, s) if s == "formdata" then return end local e = find(s, "=", 1, true) if e then r[sub(s, 2, e - 1)] = sub(s, e + 2, #s - 1) else r[#r+1] = s end end local function parse(s) if not s then return nil end local r = {} local i = 1 local b = find(s, ";", 1, true) while b do local p = sub(s, i, b - 1) kv(r, p) i = b + 1 b = find(s, ";", i, true) end local p = sub(s, i) if p ~= "" then kv(r, p) end return r end return function(options) options = options or defaults local get = uargs(options.max_get_args or defaults.max_get_args) local ct = var.content_type or "" local post = {} local files = {} if sub(ct, 1, 33) == "application/x-www-form-urlencoded" then body() post = pargs(options.max_post_args or defaults.max_post_args) elseif sub(ct, 1, 19) == "multipart/form-data" then local tmpdr = options.tmp_dir or defaults.tmp_dir if tmpdr and sub(tmpdr, -1) ~= sep then tmpdr = tmpdr .. sep end local maxfz = options.max_file_size or defaults.max_file_size local maxfs = options.max_file_uploads or defaults.max_file_uploads local chunk = options.chunk_size or defaults.chunk_size local form, e = upload:new(chunk, options.max_line_size or defaults.max_line_size) if not form then return nil, e end local h, p, f, o, s local u = 0 form:set_timeout(options.timeout or defaults.timeout) while true do local t, r, e = form:read() if not t then return nil, e end if t == "header" then if not h then h = {} end if type(r) == "table" then local k, v = r[1], parse(r[2]) if v then h[k] = v end end elseif t == "body" then if h then local d = h["Content-Disposition"] if d then if d.filename then if maxfz then s = 0 end f = { name = d.name, type = h["Content-Type"] and h["Content-Type"][1], file = basename(d.filename), temp = tmpdr and (tmpdr .. basename(tmpname())) or tmpname() } o, e = open(f.temp, "w+b") if not o then return nil, e end o:setvbuf("full", chunk) else p = { name = d.name, data = { n = 1 } } end end h = nil end if o then if maxfz then s = s + #r if maxfz < s then o:close() return nil, "The maximum size of an uploaded file exceeded." end end if maxfs and maxfs < u + 1 then o:close() return nil, "The maximum number of files allowed to be uploaded simultaneously exceeded." end local ok, e = o:write(r) if not ok then o:close() return nil, e end elseif p then local n = p.data.n p.data[n] = r p.data.n = n + 1 end elseif t == "part_end" then if o then f.size = o:seek() o:close() o = nil if maxfs and f.size > 0 then u = u + 1 end end local c, d if f then c, d, f = files, f, nil elseif p then c, d, p = post, p, nil end if c then local n = d.name local s = d.data and concat(d.data) or d if n then local z = c[n] if z then if z.n then z.n = z.n + 1 z[z.n] = s else z = { z, s } z.n = 2 end c[n] = z else c[n] = s end else c.n = c.n + 1 c[c.n] = s end end elseif t == "eof" then break end end local t, _, e = form:read() if not t then return nil, e end elseif sub(ct, 1, 16) == "application/json" then body() local j = data() if j == nil then local f = file() if f ~= nil then j = read(f) if j then post = decode(j) or {} end end else post = decode(j) or {} end else body() local b = data() if b == nil then local f = file() if f ~= nil then b = read(f) end end if b then post = { b } end end return get, post, files end
--[[ optional music.lua version: 19.02.09 Copyright (C) 2018, 2019 Jeroen P. Broks This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ]] local o = {} local mozart -- will be used to store the music in local tag = { [true]='one', [false]='two'} local btag local pushed = {} -- 0 = never play music -- 1 = only play if the music file has been found -- 2 = always play music and throw an error if we don't have it. o.use = 1 function o.allow(bool) -- true will set o.use to 2 and false will set it to 0 if bool then o.use=2 else o.use=2 end end o.playing = nil function o.play(file) assert(type(file)=='string','Huh? What do you want me to do! I did expect the name of a music file, not a '..type(file)..' variable.') if o.use==0 then return end if o.playing==upper(file) then return end local got=JCR_Exists(file) assert(got or o.use~=2,"Music file '"..file..'" has not been found!') if not got then return end assert(type(o.swap)=="string","I need you to set the music.swap variable to the name of the swap dir I can use (inside the love work dir). Now I have a '"..type(o.swap).."' value there, whatever that means.") local data = JCR_B(file) local ds = mysplit(file,".") local e = ds[#ds] btag = not btag local swapmus = o.swap.."/muziek."..tag[btag].."."..e local s,m = love.filesystem.write(swapmus,data) data=nil -- save this crap and get rid of it asap! assert(s,m) if mozart then love.audio.stop(mozart) end mozart = love.audio.newSource(swapmus) mozart:setLooping(true) love.audio.play(mozart) o.playing=upper(file) end function o.push() -- if not mozart then return end if not o.playing then return end pushed[#pushed+1]=o.playing end function o.pop() if #pushed==0 then return end local f = pushed[#pushed] pushed[#pushed]=nil o.play(f) end o.pull = o.pop -- Searches an entire dir and plays a tune at random... ;) function o.random(dir) if o.use==0 then return end local got=JCR_HasDir(dir) assert(got or o.use~=2,"Music folder '"..dir.."' has not been found!") if not got then return end local files = JCR_GetDir(dir) local musics = {} for f in each(files) do local uf=f:upper() if (suffixed(uf,".MP3") or suffixed(uf,".OGG")) and prefixed(uf,dir:upper().."/") then musics[#musics+1]=f end end assert(#musics>0,"Cannot randomize empty music folder!") -- There must be at least one file in here recognized as a music file! o.play(musics[love.math.random(1,#musics)]) end return o
--[[ Do you think it is a good design to keep the transliteration table as part of the state of the library, isntead of being a parameter to transliterate? ]] --[[ No, not as in the previous two examples. This forces clients of the library to coordinate with each other to ensure that the hidden state still has its expected value. Alternately, each client could set the state each time it uses the transliterate function, but this defeats the purpose of storing the state internally. Instead, it would be better to use a quick closure to achieve the desired behavior (shown in Lua, but could be done in C): function specializedtransliterate(t) return function(s) transliterate(s, t) end end ]]
--[[------------ Q U A K E II Heads Up Display Weapon images ]]-------------- if CLIENT then -- Parameters local PISTOL_HOLDTYPES = {"pistol", "revolver", "duel"}; Q2HUD.WeaponModels = {}; -- A list of weapon models Q2HUD.WeaponClasses = {}; -- A list of weapon classes Q2HUD.QuakeWeapons = {}; -- A list of quake weapon icons -- Methods --[[ Adds a weapon model related to an icon @param {string} model @param {string} icon @void ]] function Q2HUD:AddWeaponModel(model, icon) self.WeaponModels[model] = icon; end --[[ Gets the icon of a weapon model @param {string} model @return {string} icon ]] function Q2HUD:GetWeaponModelIcon(model) return self.WeaponModels[model]; end --[[ Returns the weapon models list @return {table} Q2HUD.WeaponModels ]] function Q2HUD:GetWeaponModels() return self.WeaponModels; end --[[ Adds a weapon class related to an icon @param {string} class @param {string} icon @void ]] function Q2HUD:AddWeaponClassIcon(class, icon) self.WeaponClasses[class] = icon; end --[[ Gets the icon of a weapon class @param {string} class @return {string} icon ]] function Q2HUD:GetWeaponClassIcon(class) return self.WeaponClasses[class]; end --[[ Returns the weapon classes list @return {table} Q2HUD.WeaponClasses ]] function Q2HUD:GetWeaponClasses() return self.WeaponClasses; end --[[ Returns the icon of a weapon @param {Weapon} weapon @return {string} icon ]] function Q2HUD:GetWeaponIcon(weapon) local icon = "null"; local model = self:GetWeaponModelIcon(weapon:GetWeaponWorldModel()); local class = self:GetWeaponClassIcon(weapon:GetClass()); if (model ~= nil) then icon = model; elseif (class ~= nil) then icon = class; else icon = self:GenerateWeaponIcon(weapon); end return icon; end --[[ Tries to generate an icon from the weapon data @param {Weapon} weapon @return {string} icon ]] function Q2HUD:GenerateWeaponIcon(weapon) local holdtype = weapon:GetHoldType(); local ammotype = weapon:GetPrimaryAmmoType(); local icon = ""; if icon == "" then if (table.HasValue(PISTOL_HOLDTYPES, holdtype)) then icon = self.QuakeWeapons.pistol; else if Q2HUD.WeaponByAmmo[game.GetAmmoName(ammotype)] ~= nil then icon = Q2HUD.WeaponByAmmo[game.GetAmmoName(ammotype)]; else icon = Q2HUD.WeaponByHoldType[holdtype] or "hcrowbar"; end end end return icon; end end
---------------------------------- -- Requires -- ---------------------------------- local __constants = require("utils.constants") ---------------------------------- -- Combinator item -- ---------------------------------- -- Create a new combinator item from decider combinator local combinatorItem = table.deepcopy(data.raw.item["decider-combinator"]) -- Add icon combinatorItem.icon = __constants.imagePaths.combinatorIcon combinatorItem.icon_size = 64 combinatorItem.icon_mipmaps = 4 combinatorItem.name = __constants.names.wocCombinatorName combinatorItem.place_result = __constants.names.wocCombinatorName combinatorItem.order = "c[combinators]-d[" .. __constants.names.wocCombinatorName .. "]" data:extend({ combinatorItem }) ---------------------------------- -- Hidden items for ports -- ---------------------------------- local inputPortItem = table.deepcopy(data.raw.item["constant-combinator"]) -- Add icon inputPortItem.icon = __constants.imagePaths.inputPortIcon inputPortItem.icon_size = 64 inputPortItem.icon_mipmaps = 4 inputPortItem.name = __constants.names.inputPortName inputPortItem.place_result = __constants.names.inputPortName inputPortItem.flags = { "hidden" } local outputPortItem = table.deepcopy(data.raw.item["constant-combinator"]) -- Add icon outputPortItem.icon = __constants.imagePaths.outputPortIcon outputPortItem.icon_size = 64 outputPortItem.icon_mipmaps = 4 outputPortItem.name = __constants.names.outputPortName outputPortItem.place_result = __constants.names.outputPortName outputPortItem.flags = { "hidden" } data:extend({ inputPortItem, outputPortItem })
local app = app local Signal = require "Signal" local Utils = require "Utils" local Class = require "Base.Class" local Base = require "ListWindow" local Manager = require "Package.Manager" -- Package Manager Interface local Interface = Class {} Interface:include(Base) function Interface:init() local opts = { title = "Package Manager", showDetailPanel = true, columns = { { name = "name", width = 0.75, showCheck = true, emptyText = "No packages found." }, { name = "status", width = 0.25, justify = app.justifyRight } } } Base.init(self, opts) self:setClassName("Package.Interface") self.detailText:setJustification(app.justifyLeft) self:setSubCommand(1, "uninstall all", self.doUninstallAll) self:setSubCommand(3, "create package", self.doCreatePackage) Signal.weakRegister("cardMounted", self) Signal.weakRegister("cardEjected", self) end function Interface:doRestart() local Application = require "Application" Application.restart(true) end function Interface:doUninstallAll() Manager.reset() self:refresh() end function Interface:doCreatePackage() local Creator = require "Package.Creator" local dlg = Creator() local task = function(success) if success then Manager.invalidatePackageCache() self:refresh() end end dlg:subscribe("done", task) dlg:show() end function Interface:doInstallPackage() local id = self:getSelection() local package = Manager.getPackage(id) if package then local success, msg = Manager.install(package) if success then self:refresh() else local Message = require "Message" local dialog = Message.Main("Install failed.", msg) dialog:show() end end end function Interface:doUninstallPackage() local id = self:getSelection() local package = Manager.getPackage(id) if package and Manager.uninstall(package) then self:refresh() end end function Interface:doDeletePackage() local id = self:getSelection() local package = Manager.getPackage(id) if package then local Verification = require "Verification" local dialog = Verification.Main(package.filename, "Do you really want to delete?") local task = function(ans) if ans then Manager.delete(package) self:refresh() end end dialog:subscribe("done", task) dialog:show() end end function Interface:doConfigurePackage() local id = self:getSelection() local package = Manager.getPackage(id) if package then package:libraryCall("showMenu") end end function Interface:refresh() local selected = self:getSelection() local packages = Manager.getPackages() self:clearRows() for id, package in Utils.orderedPairs(packages) do self:addRow{ { label = package:getName(), data = id, checked = package.installed }, { label = package:getVersion(), data = id } } end self:setSelection(selected) local Card = require "Card" if Card.mounted() then self.colByName["name"]:setEmptyText("No packages found.") else self.colByName["name"]:setEmptyText("No card present.") end end function Interface:onSelectionChanged() local id = self:getSelection() local package = Manager.getPackage(id) if package then if package.installed then self:setMainCommand(5, "uninstall", self.doUninstallPackage) if package:libraryCall("hasMenu") then self:setMainCommand(6, "config", self.doConfigurePackage) else self:setMainCommand(6, "") end else self:setMainCommand(5, "install", self.doInstallPackage) self:setMainCommand(6, "delete", self.doDeletePackage) end local author = package:getAuthor() or "anonymous" local units = package:getUnits() or {} local presets = package:getPresets() or {} local unitCount = #units local presetCount = #presets local detail = string.format("By: %s\nUnits: %d\nPresets: %d", author, unitCount, presetCount) self.detailText:setText(detail) else self:clearMainCommand(5) self:clearMainCommand(6) self.detailText:setText("") end if Manager.isRebootNeeded() then self:setSubCommand(2, "restart", self.doRestart) else self:clearSubCommand(2) end end function Interface:cardMounted() if self.visible then self:refresh() end end function Interface:cardEjected() if self.visible then self:refresh() end end function Interface:onShow() self:refresh() end function Interface:enterReleased() local id = self:getSelection() local package = Manager.getPackage(id) if package.installed then Manager.uninstall(package) else Manager.install(package) end self:refresh() return true end return Interface()
AddCSLuaFile() local Behaviour = include("gw_behaviour_tree_lib.lua") ENT.Base = "base_nextbot" GW_WALKER_TARGET_TYPE_NONE = 0 GW_WALKER_TARGET_TYPE_POSITION = 1 GW_WALKER_TARGET_TYPE_HIDING_SPOT = 2 function ENT:SetupDataTables() self:NetworkVar("Int", 0, "LastAct") self:NetworkVar("Int", 1, "WalkerColorIndex") self:NetworkVar("Int", 2, "WalkerModelIndex") end function ENT:SetupColorAndModel() local models = GAMEMODE.GWConfig.HidingModels if SERVER then self:SetWalkerModelIndex(math.random(1, #models)) end self:SetModel(models[self:GetWalkerModelIndex()]) local walkerColors = GAMEMODE.GWConfig.WalkerColors if SERVER then self:SetWalkerColorIndex(math.random(1, #walkerColors)) end self.walkerColor = Vector( walkerColors[self:GetWalkerColorIndex()].r / 255, walkerColors[self:GetWalkerColorIndex()].g / 255, walkerColors[self:GetWalkerColorIndex()].b / 255 ) self.GetPlayerColor = function() return self.walkerColor end self.lerpedAnimationVelocity = 0 end function ENT:Initialize() GAMEMODE.GWStuckMessageCount = GAMEMODE.GWStuckMessageCount or 0 self:SetupColorAndModel() self:SetHealth(100) if SERVER then self.walkSpeed = GetConVar("gw_hiding_walk_speed"):GetFloat() self.runSpeed = GetConVar("gw_hiding_run_speed"):GetFloat() self.boundsSize = 16 -- maybe 10? self.boundsHeight = 70 self:SetCollisionBounds( Vector(-self.boundsSize, -self.boundsSize, 0), Vector(self.boundsSize, self.boundsSize, self.boundsHeight) ) self.loco:SetStepHeight(18) self.loco:SetJumpHeight(82) self.loco:SetDesiredSpeed(self.walkSpeed) self.nextPossibleJump = CurTime() + 2 -- dont jump right after spawning self.nextPossibleSettingsChange = CurTime() + 10 self.isDoging = false self.dogeUntil = CurTime() self.lastNPCContact = CurTime() self.NPCContactsInARow = 0 self.noCollideEndTime = CurTime() self.isNoCollided = false self.dogePos = Vector() self.isJumping = false self.shouldCrouch = false self.isFirstPath = true self.currentPathMaxAge = 0 self.isStuck = false self.stuckTime = CurTime() self.stuckPos = Vector() self.targetPos = Vector() self.targetType = GW_WALKER_TARGET_TYPE_NONE self.isSitting = false self.isIdle = false self.isDancing = false self.sitUntil = CurTime() self.behaviourTree = nil self.currentPath = nil end end function ENT:IsAlone(radius) local entsAround = ents.FindInSphere(self:GetPos(), radius) local walkersAround = {} for _, ent in pairs(entsAround) do if ent:GetClass() == self:GetClass() then table.insert(walkersAround, ent) end end local doorsAround = {} for _, ent in pairs(entsAround) do if ((ent:GetClass() == "func_door") or (ent:GetClass() == "func_door_rotating")) or (ent:GetClass() == "prop_door_rotating") then table.insert(doorsAround, ent) end end if ((#walkersAround) < 3) and ((#doorsAround) == 0) then return true end return false end function ENT:Sit(duration) if duration == nil then duration = math.random(10, 30) end self.isSitting = true self.sitUntil = CurTime() + duration self:SetSequence("sit_zen") self:SetCrouchCollision(true) end function ENT:StopSit() self:SetCrouchCollision(false) self.isSitting = false end function ENT:Dance() self.isDancing = true end function ENT:Idle(duration) if duration == nil then duration = math.random(10, 30) end self.isIdle = true self.idleUntil = CurTime() + duration end function ENT:StopIdle() self.isIdle = false end function ENT:SetCrouchCollision(state) if state then self:SetCollisionBounds( Vector(-self.boundsSize, -self.boundsSize, 0), Vector(self.boundsSize, self.boundsSize, 36) ) else self:SetCollisionBounds( Vector(-self.boundsSize, -self.boundsSize, 0), Vector(self.boundsSize, self.boundsSize, self.boundsHeight) ) end end function ENT:Doge(dogePos, maxDuration) if maxDuration == nil then maxDuration = 0.35 end self.dogePos = dogePos self.dogeUntil = CurTime() + maxDuration self.isDoging = true end function ENT:Jump() if self.isJumping or (self.nextPossibleJump > CurTime()) then return end self.loco:Jump() self.isJumping = true self.nextPossibleJump = CurTime() + 1.5 end function ENT:Think() if SERVER then local doors = ents.FindInSphere(self:GetPos(), 60) for _, door in pairs(doors) do local doorClass = door:GetClass() if ((doorClass == "func_door") or (doorClass == "func_door_rotating")) or (doorClass == "prop_door_rotating") then door:Fire("Unlock", "", 0) door:Fire("Open", "", 0.01) door:SetCollisionGroup(COLLISION_GROUP_DEBRIS) end end -- try to resolve stuck after 5 seconds by nocolliding if (self.isStuck and (CurTime() - self.stuckTime > 10) and (CurTime() - self.stuckTime < 10.25)) then self:StartNoCollide(0.25) end if (self.isStuck and (CurTime() - self.stuckTime > 15)) and (self.stuckPos:DistToSqr(self:GetPos()) < 25) then local spawnPoints = GAMEMODE.GWRound.SpawnPoints local spawnPoint = spawnPoints[(math.random(#spawnPoints) - 1) + 1]:GetPos() self:SetPos(spawnPoint) self.isStuck = false self.targetType = GW_WALKER_TARGET_TYPE_NONE if (IsValid(self.currentPath)) then self.currentPath:Invalidate() end if GAMEMODE.GWStuckMessageCount <= 32 then MsgN( "Nextbot [" .. self:EntIndex() .. "][" .. self:GetClass() .. "]" .. "Got stuck for over 15 seconds and will be repositioned, if this error gets spammed " .. "you might want to consider the following: Edit the navmesh or lower the walker amount." ) end if GAMEMODE.GWStuckMessageCount == 32 then MsgN( "Nextbot stuck message displayed 32 times, supressing future messages." ) end GAMEMODE.GWStuckMessageCount = GAMEMODE.GWStuckMessageCount + 1 end if self.isStuck and (self.stuckPos:DistToSqr(self:GetPos()) > 400) then self.isStuck = false end -- Reset solid mask if we are no longer stuck inside another npc if self.noCollideEndTime < CurTime() and self:GetSolidMask() == MASK_NPCSOLID_BRUSHONLY then local entsInBox = ents.FindInBox( self:GetPos() + Vector(-self.boundsSize, -self.boundsSize, 0), self:GetPos() + Vector(self.boundsSize, self.boundsSize, self.boundsHeight) ) local occupied = false for _, entInBox in pairs(entsInBox) do if (entInBox:GetClass() == GW_WALKER_CLASS) and (entInBox ~= self) or entInBox:IsPlayer() then occupied = true end end if not occupied then self:SetSolidMask(MASK_NPCSOLID) self:SetCollisionGroup(COLLISION_GROUP_NPC) self.isNoCollided = false end end end return false end function ENT:RunBehaviour() self.behaviourTree = Behaviour.TreeBuilder() :Sequence() :Action(function() if self.nextPossibleSettingsChange > CurTime() then return Behaviour.Status.Success end local rand = math.random(1, 100) if (rand > 0) and (rand < 25) then self.loco:SetDesiredSpeed(self.runSpeed) elseif (rand > 25) and (rand < 38) then if self:IsAlone(350) then self:Sit(math.random(10, 60)) end else self.loco:SetDesiredSpeed(self.walkSpeed) end self.nextPossibleSettingsChange = CurTime() + 8 return Behaviour.Status.Success end) :Action(function() if not self.isSitting then return Behaviour.Status.Success end if self.sitUntil < CurTime() then self:StopSit() return Behaviour.Status.Success end return Behaviour.Status.Running end) :Action(function() if not self.isIdle then return Behaviour.Status.Success end if self.idleUntil < CurTime() then self:StopIdle() return Behaviour.Status.Success end return Behaviour.Status.Running end) :Action(function() if IsValid(self.currentPath) then return Behaviour.Status.Success end local radius = 3200 if self.isFirstPath then radius = 8000 end local rand = math.random(1, 100) local allowedStepChange = 400 if rand < 25 then self.targetPos = self:FindSpot("random", {type= "hiding", pos = self:GetPos(), radius = radius, stepup = allowedStepChange, stepdown = allowedStepChange}) if (not self.targetPos) then self.targetType = GW_WALKER_TARGET_TYPE_NONE return Behaviour.Status.Failure end self.targetType = GW_WALKER_TARGET_TYPE_HIDING_SPOT else local navs = navmesh.Find(self:GetPos(), radius, allowedStepChange, allowedStepChange) local nav = navs[(math.random(#navs) - 1) + 1] if not IsValid(nav) or nav:IsUnderwater() then self.targetType = GW_WALKER_TARGET_TYPE_NONE return Behaviour.Status.Failure end self.targetType = GW_WALKER_TARGET_TYPE_POSITION self.targetPos = nav:GetRandomPoint() end self.currentPath = Path("Follow") self.currentPath:SetMinLookAheadDistance(10) self.currentPath:SetGoalTolerance(42) local isValidPath = self.currentPath:Compute(self, self.targetPos) if isValidPath then if not IsValid(self.currentPath) then return Behaviour.Status.Failure end if self.isFirstPath then self.currentPathMaxAge = 30 else self.currentPathMaxAge = math.Clamp(self.currentPath:GetLength() / 90, 1, 25) end self.isFirstPath = false return Behaviour.Status.Success else return Behaviour.Status.Failure end end) :Action(function() if not IsValid(self.currentPath) then if (self.targetType == GW_WALKER_TARGET_TYPE_HIDING_SPOT and self.targetPos:Distance(self:GetPos()) < 50) and self:IsAlone(150) then self:Idle(math.random(4, 10)) end return Behaviour.Status.Success end if self.isDancing then local seqs = { "taunt_robot", "taunt_dance", "taunt_muscle" } self:PlaySequenceAndWait(table.Random(seqs), 1) self.isDancing = false return Behaviour.Status.Failure end if (self.isDoging and not self.isJumping and (self.dogeUntil > CurTime())) and (self.dogePos:DistToSqr(self:GetPos()) > 100) then self.loco:FaceTowards(self.dogePos) self.loco:Approach(self.dogePos, 1) return Behaviour.Status.Running else self.isDoging = false end local goal = self.currentPath:GetCurrentGoal() local distToGoal = self:GetPos():Distance(goal.pos) local currentNavArea = navmesh.GetNearestNavArea(self:GetPos(), false) if not self.isJumping then if goal.type == 3 then self.isJumping = true self.loco:JumpAcrossGap(goal.pos, goal.forward) elseif IsValid(currentNavArea) and not currentNavArea:HasAttributes(bit.bor(NAV_MESH_NO_JUMP, NAV_MESH_STAIRS)) then if currentNavArea:HasAttributes(NAV_MESH_JUMP) then self:Jump() elseif (goal.type == 2) and (distToGoal < 30) then self:Jump() else local scanDist = math.max(30, 25 * self.loco:GetVelocity():Length2D() / 100) local forward = self:GetForward() local scanPointPath = self:GetPos() + (forward * scanDist) local scanPointOnPath = self.currentPath:GetClosestPosition(scanPointPath) --debugoverlay.Sphere(scanPointOnPath, 10, 0.1, Color(0, 255, 0)) local jumpBasedOnPathScan = self:GetPos().z < scanPointOnPath.z and math.abs(self:GetPos().z - scanPointOnPath.z) > self.loco:GetStepHeight() and (distToGoal < 100) local jumpBasedOnNavScan = false local scanPointNav = self:GetPos() + (forward * math.max(15, scanDist * 0.5)) + Vector(0, 0, self.loco:GetStepHeight() * 1.2) --debugoverlay.Sphere(scanPointNav, 10, 0.1, Color(255, 255, 0)) local scanNavArea = navmesh.GetNearestNavArea(scanPointNav, false, scanDist * 2) if not jumpBasedOnPathScan and IsValid(scanNavArea) then if scanNavArea:HasAttributes(NAV_MESH_JUMP) then jumpBasedOnNavScan = true else local scanPointOnNav = scanNavArea:GetClosestPointOnArea(scanPointNav) if scanPointOnNav then --debugoverlay.Sphere(scanPointOnNav, 10, 0.1, Color(255, 0, 0)) -- higher threshold for navareaBasejumps jumpBasedOnNavScan = self:GetPos().z < scanPointOnNav.z and math.abs(self:GetPos().z - scanPointOnNav.z) > self.loco:GetStepHeight() * 1.2 end end end if (jumpBasedOnPathScan or jumpBasedOnNavScan) then self:Jump() end end end end self.currentPath:Update(self) if self.loco:IsStuck() then self:HandleStuck() end if self.currentPath:GetAge() > self.currentPathMaxAge then self.currentPath:Invalidate() return Behaviour.Status.Failure end return Behaviour.Status.Running end) :Finish() :Build() while true do self.behaviourTree:Tick() coroutine.yield() end end function ENT:BodyUpdate() local idealAct = ACT_HL2MP_IDLE local velocity = self:GetVelocity() self.lerpedAnimationVelocity = Lerp(0.2, self.lerpedAnimationVelocity, velocity:Length2D()) if self.lerpedAnimationVelocity > self.walkSpeed * 1.05 then idealAct = ACT_HL2MP_RUN elseif self.lerpedAnimationVelocity > 5 then idealAct = ACT_HL2MP_WALK end if self.isJumping and (self:WaterLevel() <= 0) then idealAct = ACT_HL2MP_JUMP_SLAM end if ((self:GetActivity() ~= idealAct) and (not self.isSitting)) and (not self.isDancing) then self:StartActivity(idealAct) end if (idealAct == ACT_HL2MP_RUN) or (idealAct == ACT_HL2MP_WALK) then self:BodyMoveXY() end self:FrameAdvance() end function ENT:OnLandOnGround(ent) self.isJumping = false self:SetCrouchCollision(false) end function ENT:OnLeaveGround(ent) self.isJumping = true self:SetCrouchCollision(true) end local gwWalkerDogeAngle = 1 / math.sqrt(2) function ENT:OnContact(ent) local curTime = CurTime() if (ent:GetClass() == self:GetClass()) then if curTime - self.lastNPCContact > 1.5 then self.NPCContactsInARow = 1 elseif curTime - self.lastNPCContact > 0.5 then self.NPCContactsInARow = self.NPCContactsInARow + 1 if self.NPCContactsInARow >= 5 then self:StartNoCollide(1) self.NPCContactsInARow = 0 end end self.lastNPCContact = curTime end if not self.isNoCollided and (ent:GetClass() == self:GetClass()) or ent:IsPlayer() then if not self.isDoging and not self.isSitting then local dogeDirection = (ent:GetPos() - self:GetPos()):GetNormalized() local directionForwardDot = self:GetForward():Dot(dogeDirection) local isEntInFront = directionForwardDot > gwWalkerDogeAngle if isEntInFront then dogeDirection:Rotate(Angle(0, math.random(70, 80), 0)) dogeDirection.z = 0 local dogeTarget = self:GetPos() + (dogeDirection * 200) local navAreaInDogeDir = navmesh.GetNearestNavArea(dogeTarget, false, 400, true) if IsValid(navAreaInDogeDir) then local dogeTargetOnNavArea = navAreaInDogeDir:GetClosestPointOnArea(dogeTarget) if dogeTargetOnNavArea then self:Doge(dogeTargetOnNavArea, math.random(0.4, 0.6)) end end end end end if (ent:GetClass() == "prop_physics_multiplayer") or ((ent:GetClass() == "prop_physics") and (not GetConVar("gw_propfreeze_enabled"):GetBool())) then local phys = ent:GetPhysicsObject() if not IsValid(phys) then return end local force = ((ent:GetPos() - self:GetPos()):GetNormalized() * 3) * self:GetVelocity():Length2D() force.z = 0 phys:ApplyForceCenter(force) DropEntityIfHeld(ent) end if (ent:GetClass() == "func_breakable") or (ent:GetClass() == "func_breakable_surf") then ent:Fire("Shatter") end if self.isStuck and ((ent:GetClass() == self:GetClass()) or ent:IsPlayer()) then local thisMin = self:OBBMins() + self:GetPos() local thisMax = self:OBBMaxs() + self:GetPos() local entMin = ent:OBBMins() + ent:GetPos() local entMax = ent:OBBMaxs() + ent:GetPos() if not ((((thisMax.x < entMin.x) or (thisMin.x > entMax.x)) or (thisMax.y < entMin.y)) or (thisMin.y > entMax.y)) then self:StartNoCollide(0) end end end function ENT:StartNoCollide(duration) self:SetSolidMask(MASK_NPCSOLID_BRUSHONLY) self:SetCollisionGroup(COLLISION_GROUP_DEBRIS) self.noCollideEndTime = CurTime() + duration self.isNoCollided = true end function ENT:OnStuck() if not self.isStuck then self.stuckTime = CurTime() self.isStuck = true end self.stuckPos = self:GetPos() end function ENT:OnUnStuck() if (self.stuckPos:DistToSqr(self:GetPos()) > 100) or self.isSitting then self.isStuck = false end end function ENT:Use(activator, caller, useType, value) if caller:GWIsHiding() and GetConVar("gw_changemodel_hiding"):GetBool() then caller:SetModel(self:GetModel()) end end -- unused function ENT:PathGenerator() return function(area, fromArea, ladder, elevator, length) if not IsValid(fromArea) then return 0 end if not self.loco:IsAreaTraversable(area) then return -1 end local dist = 0 if IsValid(ladder) then dist = ladder:GetLength() elseif length > 0 then dist = length else dist = area:GetCenter():Distance(fromArea:GetCenter()) end local cost = dist + fromArea:GetCostSoFar() local deltaZ = fromArea:ComputeAdjacentConnectionHeightChange(area) if deltaZ >= self.loco:GetStepHeight() then if deltaZ >= (self.loco:GetMaxJumpHeight() - 20) then return -1 end cost = cost + deltaZ elseif deltaZ < (-self.loco:GetDeathDropHeight()) then return -1 end return cost end end
function love.conf(t) t.version = "11.3" -- The LÖVE version this game was made for (string) t.console = true -- Attach a console (boolean, Windows only) t.audio.mixwithsystem = true -- Keep background music playing when opening LOVE (boolean, iOS and Android only) t.window.title = "Pong!" -- The window title (string) t.window.icon = "icon.png" -- Filepath to an image to use as the window's icon (string) end
love.graphics.setDefaultFilter('nearest', 'nearest') enemiesController = {} enemiesController.enemies = {} enemiesController.img = love.graphics.newImage('alien.png') enemiesController.exp =love.audio.newSource('explosion.wav') enemiesController.scale = 3 enemy = {} function love.load() music = love.audio.newSource('Penitent Existence.mp3') love.audio.play(music) love.audio.setVolume(0) backgroundImage = love.graphics.newImage('bg.jpg') gg = love.graphics.newImage('gg.png') halfOfWgg = gg:getWidth()/2 halfOfHgg = gg:getHeight()/2 + 50 screenCenter = {} screenCenter.x = love.graphics.getWidth()/2 screenCenter.y = love.graphics.getHeight()/2 gameOver = false player = {} player.img = love.graphics.newImage('ship.png') player.sound = {} player.sound.fire = love.audio.newSource('fire.wav') player.sound.empty = love.audio.newSource('empty.wav') player.x = 0 player.y = 540 player.bullets = {} player.cooldown = 20 player.speed = 5 player.fire = function ( ) if player.cooldown <= 0 then love.audio.play(player.sound.fire) player.cooldown = 20 bullet = {} bullet.x = player.x + 23 bullet.y = player.y table.insert(player.bullets, bullet) else love.audio.play(player.sound.empty) end end for i=1, 11 do enemiesController:spawnEnemy(i*40, 10) end end function enemiesController:spawnEnemy(x,y) enemy = {} enemy.x = x enemy.y = y enemy.height = enemiesController.img:getHeight() * enemiesController.scale enemy.width = enemiesController.img:getWidth() * enemiesController.scale enemy.bullets = {} enemy.cooldown = 20 enemy.speed = 5 table.insert(self.enemies, enemy) end function enemy:fire() if self.cooldown <= 0 then self.cooldown = 20 bullet = {} bullet.x = self.x + 35 bullet.y = self.y table.insert(self.bullets, bullet) end end function checkCollisions(enemies, bullets) for i,e in ipairs(enemies) do for j,b in ipairs(bullets) do if b.y <= e.y + e.height and b.x > e.x and b.x < e.x + e.width then table.remove(enemies,i) table.remove(bullets,j) love.audio.play(enemiesController.exp) particleSystem:spawn(e.x,e.y) end end end end particleSystem = {} particleSystem.list = {} particleSystem.img = love.graphics.newImage('particle.png') function particleSystem:spawn(x,y) local ps = {} ps.x = x ps.y = y ps.ps = love.graphics.newParticleSystem(particleSystem.img, 32) ps.ps:setParticleLifetime(2, 4) ps.ps:setEmissionRate(5) ps.ps:setSizeVariation(1) ps.ps:setLinearAcceleration(-20,-20,20,20) ps.ps:setColors(100,255,100,255,0,255,0,255) table.insert(particleSystem.list,ps) end function particleSystem:draw() for _,v in pairs(particleSystem.list) do love.graphics.draw(v.ps, v.x, v.y) end end function particleSystem:update(dt) for _,v in pairs(particleSystem.list) do v.ps:update(dt) end end function particleSystem:cleanup() -- for _,v in pairs(particleSystem.list) do -- v.ps:update(dt) -- end end function love.update( dt ) player.cooldown = player.cooldown -1 volume = love.audio.getVolume() if volume < 1 then volume = volume + .005 love.audio.setVolume(volume) end if love.keyboard.isDown('right') then player.x = player.x+player.speed end if love.keyboard.isDown('left') then player.x = player.x-player.speed end if love.keyboard.isDown("space") then player.fire() end for i,bullet in ipairs(player.bullets) do bullet.y = bullet.y - 5 if bullet.y < -10 then table.remove(player.bullets, i) end end for _,e in pairs(enemiesController.enemies) do e.y = e.y + 1 if e.y+e.height >= love.graphics.getHeight() then gameOver = true end end checkCollisions(enemiesController.enemies, player.bullets) end function love.draw() love.graphics.setColor(150,150,150) love.graphics.draw(backgroundImage) love.graphics.setColor(255,255,255) love.graphics.draw(player.img, player.x, player.y, 0, .30) for _,e in pairs(enemiesController.enemies) do love.graphics.draw(enemiesController.img, e.x, e.y, 0, enemiesController.scale) end love.graphics.setColor(255,0,0) for _,bullet in pairs(player.bullets) do love.graphics.rectangle("fill", bullet.x, bullet.y, 10,10, 5, 5) end if gameOver then love.graphics.setColor(255,255,255,150) love.graphics.rectangle("fill", 0, 0, love.graphics.getWidth(),love.graphics.getHeight()) love.graphics.setColor(255,255,255) love.graphics.draw(gg, screenCenter.x - halfOfWgg, screenCenter.y - halfOfHgg) end end
local rootElement = getRootElement() function showHelp(element) return triggerClientEvent(element, "doShowHelp", rootElement) end function hideHelp(element) return triggerClientEvent(element, "doHideHelp", rootElement) end
--[[--------------------------------------------------------------------------------------- Wraith ARS 2X Created by WolfKnight For discussions, information on future updates, and more, join my Discord: https://discord.gg/fD4e6WD MIT License Copyright (c) 2020 WolfKnight Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------------------------------------------------------------------------------]]-- -- Branding! local label = [[ // || __ __ _ _ _ _____ _____ ___ __ __ || \ \ / / (_) | | | /\ | __ \ / ____| |__ \\ \ / / || \ \ /\ / / __ __ _ _| |_| |__ / \ | |__) | (___ ) |\ V / || \ \/ \/ / '__/ _` | | __| '_ \ / /\ \ | _ / \___ \ / / > < || \ /\ /| | | (_| | | |_| | | | / ____ \| | \ \ ____) | / /_ / . \ || \/ \/ |_| \__,_|_|\__|_| |_| /_/ \_\_| \_\_____/ |____/_/ \_\ || || Created by WolfKnight ||]] -- Returns the current version set in fxmanifest.lua function GetCurrentVersion() return GetResourceMetadata( GetCurrentResourceName(), "version" ) end -- Grabs the latest version number from the web GitHub PerformHttpRequest( "https://wolfknight98.github.io/wk_wars2x_web/version.txt", function( err, text, headers ) -- Wait to reduce spam Citizen.Wait( 2000 ) -- Print the branding! print( label ) -- Get the current resource version local curVer = GetCurrentVersion() if ( text ~= nil ) then -- Print out the current and latest version print( " || Current version: " .. curVer ) print( " || Latest recommended version: " .. text .."\n ||" ) -- If the versions are different, print it out if ( text ~= curVer ) then print( " || ^1Your Wraith ARS 2X version is outdated, visit the FiveM forum post to get the latest version.\n^0 \\\\\n" ) else print( " || ^2Wraith ARS 2X is up to date!\n^0 ||\n \\\\\n" ) end else -- In case the version can not be requested, print out an error message print( " || ^1There was an error getting the latest version information, if the issue persists contact WolfKnight#8586 on Discord.\n^0 ||\n \\\\\n" ) end end )
object_tangible_quest_menagerie_terminal_42 = object_tangible_quest_shared_menagerie_terminal_42:new { } ObjectTemplates:addTemplate(object_tangible_quest_menagerie_terminal_42, "object/tangible/quest/menagerie_terminal_42.iff")
local function SetHighlight(self) PROFILE("BaseModelMixin:SetHighlight") if self:GetIsHighlightEnabled() == 1 then if HasMixin(self, "Team") then if self:GetTeamNumber() == kTeam2Index then if self:isa("Gorge") then self._renderModel:SetMaterialParameter("highlight", 0.95) else self._renderModel:SetMaterialParameter("highlight", 1.0) end elseif self:GetTeamNumber() == kTeam1Index then if self:isa("Gorge") then self._renderModel:SetMaterialParameter("highlight", 0.85) else self._renderModel:SetMaterialParameter("highlight", 0.9) end else self._renderModel:SetMaterialParameter("highlight", 0.8) end else self._renderModel:SetMaterialParameter("highlight", 0.7) end elseif self:GetIsHighlightEnabled() == 0.5 then self._renderModel:SetMaterialParameter("highlight", 0.5) end end debug.replaceupvalue( BaseModelMixin.GetRenderModel, "SetHighlight", SetHighlight, true)
local NoteReader = Class(function(self,inst) end) return NoteReader
--登录奖励 local LogonRewardLayer = class("LogonRewardLayer", cc.Layer) local ExternalFun = appdf.req(appdf.EXTERNAL_SRC .. "ExternalFun") local AnimationHelper = appdf.req(appdf.EXTERNAL_SRC .. "AnimationHelper") local RewardShowLayer = appdf.req(appdf.CLIENT_SRC.."plaza.views.layer.plaza.RewardShowLayer") function LogonRewardLayer:ctor() --初始化数据 self._drawReward = 0 self._logonReward = 0 self._totalReward = 0 local csbNode = ExternalFun.loadCSB("LogonReward/LogonRewardLayer.csb"):addTo(self) self._content = csbNode:getChildByName("content") self._spTable = self._content:getChildByName("sp_table") self._spTableItemHighlight = self._content:getChildByName("sp_table_item_highlight") self._spTableItemFlash0 = self._content:getChildByName("sp_table_item_flash_0") self._spTableItemFlash1 = self._content:getChildByName("sp_table_item_flash_1") self._panelSign = self._content:getChildByName("panel_sign") self._panelResult = self._content:getChildByName("panel_result") --关闭 self._btnClose = self._content:getChildByName("btn_close") self._btnClose:addClickEventListener(function() --播放音效 ExternalFun.playClickEffect() dismissPopupLayer(self) end) --抽奖 self._btnDraw = self._content:getChildByName("btn_draw") self._btnDraw:addClickEventListener(function() self:onClickDraw() end) --领取 local btnReceive = self._panelResult:getChildByName("btn_receive") btnReceive:addClickEventListener(function() self:onClickReceive() end) --填充转盘信息 local x0 = self._spTable:getContentSize().width / 2 local y0 = self._spTable:getContentSize().height / 2 for i = 1, #GlobalUserItem.dwLotteryQuotas do local txtQuota = ccui.Text:create(GlobalUserItem.dwLotteryQuotas[i], "fonts/round_body.ttf", 40) local x = x0 + 170 * math.sin((i - 1) * 30 * 3.14 /180 ) local y = y0 + 170 * math.cos((i - 1) * 30 * 3.14 /180 ) txtQuota:setPosition(x, y) txtQuota:setRotation( (270 + (i - 1) * 30) % 360 ) txtQuota:enableOutline(cc.c3b(136, 70, 0), 1) txtQuota:addTo(self._spTable) end --更新签到信息 self:onUpdateSignInfo() --内容跳入 AnimationHelper.jumpIn(self._content) end -------------------------------------------------------------------------------------------------------------------- -- 事件处理 --更新签到信息 function LogonRewardLayer:onUpdateSignInfo() local txtSignDays = self._panelSign:getChildByName("txt_sign_days") txtSignDays:setString("已连续签到 " .. GlobalUserItem.wSeriesDate .. " 天") local wSeriesDate = GlobalUserItem.wSeriesDate local bTodayChecked = GlobalUserItem.bTodayChecked for i = 1, yl.LEN_WEEK do local spGoldItemBg = self._panelSign:getChildByName("sp_gold_item_bg_" .. i) local spGoldItem = spGoldItemBg:getChildByName("sp_gold_item") local spReceived = spGoldItemBg:getChildByName("sp_received") local txtReward = spGoldItemBg:getChildByName("txt_reward") local bSigned = wSeriesDate >= i --已签到 local bCanSign = (wSeriesDate + 1 == i and not bTodayChecked) --可签到 --local bToday = bTodayChecked and (wSeriesDate == i and true or false) or (wSeriesDate == i - 1 and true or false) --是否是今日 --背景 spGoldItemBg:setTexture("LogonReward/sp_gold_item_bg_" .. (bCanSign and 1 or 0) .. ".png") --金币 spGoldItem:setTexture("LogonReward/sp_gold_item_" .. i .. "_" .. (bSigned and 1 or 0) .. ".png") --已签到标志 spReceived:setVisible(bSigned) --奖励金额 txtReward:setString(GlobalUserItem.lCheckinRewards[i]) end end --更新奖励结果 function LogonRewardLayer:onUpdateRewardResult() local txtDrawReward = self._panelResult:getChildByName("txt_draw_reward") local txtLogonReward = self._panelResult:getChildByName("txt_logon_reward") local txtTotalReward = self._panelResult:getChildByName("txt_total_reward") txtDrawReward:setString(self._drawReward) txtLogonReward:setString(self._logonReward) txtTotalReward:setString(self._totalReward) end --转盘开始 function LogonRewardLayer:onTurnTableBegin(index) local itemCount = #GlobalUserItem.dwLotteryQuotas local degree = 1800 + (itemCount - index + 1) * (360 / itemCount) self._spTable:runAction(cc.Sequence:create( cc.EaseSineInOut:create(cc.RotateTo:create(5.0, degree)), cc.CallFunc:create(function() self:onTurnTableEnd() end) ) ) --转盘音效 self:runAction(cc.Sequence:create( cc.DelayTime:create(0.8), cc.CallFunc:create(function() ExternalFun.playPlazaEffect("zhuanpanBegin.mp3") end) ) ) end --转盘结束 function LogonRewardLayer:onTurnTableEnd() --更新状态 GlobalUserItem.wSeriesDate = GlobalUserItem.wSeriesDate + 1 GlobalUserItem.bTodayChecked = true --统计奖励 self._logonReward = GlobalUserItem.lCheckinRewards[GlobalUserItem.wSeriesDate] self._totalReward = self._drawReward + self._logonReward --闪烁选中奖品 self._spTableItemHighlight:setVisible(true) self:runAction( cc.RepeatForever:create( cc.Sequence:create( cc.CallFunc:create(function() if self._spTableItemFlash0:isVisible() then self._spTableItemFlash0:setVisible(false) self._spTableItemFlash1:setVisible(true) else self._spTableItemFlash0:setVisible(true) self._spTableItemFlash1:setVisible(false) end end), cc.DelayTime:create(0.2) ) ) ) --显示签到动画和结果页 self:runAction(cc.Sequence:create( cc.CallFunc:create(function() --已签到动画 self:onCheckedAnimation() --音效 ExternalFun.playPlazaEffect("zhuanzhong.mp3") end), cc.DelayTime:create(2.0), cc.CallFunc:create(function() --更新奖励结果 self:onUpdateRewardResult() --显示结果页面 self._panelSign:setVisible(false) self._panelResult:setVisible(true) end) ) ) end --已签到动画 function LogonRewardLayer:onCheckedAnimation() if GlobalUserItem.wSeriesDate < 1 or GlobalUserItem.wSeriesDate > 7 then return end local spGoldItemBg = self._panelSign:getChildByName("sp_gold_item_bg_" .. GlobalUserItem.wSeriesDate) local spReceived = spGoldItemBg:getChildByName("sp_received") spReceived:setVisible(true) spReceived:setScale(2.0) spReceived:runAction(cc.Sequence:create( cc.CallFunc:create(function() --更新签到信息 self:onUpdateSignInfo() end), cc.ScaleTo:create(0.5, 1.0), cc.DelayTime:create(0.5) ) ) end --点击抽奖 function LogonRewardLayer:onClickDraw() --播放音效 ExternalFun.playClickEffect() self._btnDraw:setEnabled(false) self:requestLotteryStart() -- self:onTurnTableBegin(2) -- self._lotteryResult = { -- ItemIndex = 2, -- ItemQuota = 200 -- } end --点击领取 function LogonRewardLayer:onClickReceive() showPopupLayer( RewardShowLayer:create(RewardType.Gold, self._totalReward, function() dismissPopupLayer(self) end), true, false ) end -------------------------------------------------------------------------------------------------------------------- -- 网络请求 --开始抽奖 function LogonRewardLayer:requestLotteryStart() showPopWait() local ostime = os.time() local url = yl.HTTP_URL .. "/WS/Lottery.ashx" --local url = "http://localhost:12569/WS/Lottery.ashx" appdf.onHttpJsionTable(url ,"GET","action=LotteryStart&userid=" .. GlobalUserItem.dwUserID .. "&time=".. ostime .. "&signature=".. GlobalUserItem:getSignature(ostime),function(jstable,jsdata) dismissPopWait() local msg = "抽奖异常" if type(jstable) == "table" then msg = jstable["msg"] local data = jstable["data"] if type(data) == "table" then local valid = data["valid"] if nil ~= valid and true == valid then local list = data["list"] if type(list) == "table" then local idx = list["ItemIndex"] msg = nil if nil ~= idx then --保存抽奖数据 self._itemIndex = idx self._drawReward = list["ItemQuota"] --保存财富数据 GlobalUserItem.lUserScore = list["Score"] GlobalUserItem.dUserBeans = list["Currency"] GlobalUserItem.lUserIngot = list["UserMedal"] --隐藏关闭按钮 self._btnClose:setVisible(false) --转盘开始 self:onTurnTableBegin(idx) else msg = "抽奖异常" end end end end end if nil ~= msg then showToast(self, msg, 2) self._btnDraw:setEnabled(true) end end) end return LogonRewardLayer
return { _type_ = 'Decorator', id = 3001, name = "耳环", desc = "耳环", duration = 100, }
local M = {} local make_iter = require "parse_sql_dump.utils".make_iter M.NULL = require "parse_sql_dump.utils".NULL -- It would be neater to generate these by parsing the description of the table in the SQL file. M.babel = make_iter("babel", "babel", [[ user user_id lang string level string ]]) M.category = make_iter("category", "cat", [[ id category_id title page_title pages integer subcats integer files integer ]]) M.categorylinks = make_iter("category", "cl", [[ from page_id to page_title sortkey string timestamp timestamp sortkey_prefix string collation string type page_type ]]) M.change_tag = make_iter("change_tag", "ct", [[ id integer rc_id nullable_integer log_id nullable_integer rev_id nullable_integer params nullable_string tag_id integer ]]) M.change_tag_def = make_iter("change_tag_def", "ctd", [[ id integer name string user_defined boolean count integer ]]) M.externallinks = make_iter("externallinks", "el", [[ id integer from page_id to string index string index_60 string ]]) M.geo_tags = make_iter("geo_tags", "gt", [[ id integer page_id page_id globe string primary boolean lat_int integer lon_int integer lat nullable_float lon nullable_float dim nullable_integer type nullable_string name nullable_string country string region string ]]) M.image = make_iter("image", "img", [[ name page_title size integer width integer height integer metadata string bits integer media_type string -- actually enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE','3D') major_mime string -- actually enum('unknown','application','audio','image','text','video','message','model','multipart') minor_mime string description_id integer actor integer timestamp timestamp sha1 string deleted integer ]]) M.imagelinks = make_iter("imagelinks", "il", [[ from page_id namespace page_namespace to string ]]) M.iwlinks = make_iter("iwlinks", "iwl", [[ from page_id prefix string title page_title ]]) M.langlinks = make_iter("langlinks", "ll", [[ from page_id lang string title page_title ]]) M.page = make_iter("page", "page", [[ id page_id namespace page_namespace title page_title restrictions string is_redirect boolean is_new boolean random float touched timestamp links_updated nullable_timestamp latest rev_id len integer content_model nullable_string lang nullable_string ]]) M.page_restrictions = make_iter("page_restrictions", "pr", [[ page page_id type string level string cascade integer user nullable_integer expiry nullable_string id integer ]]) M.pagelinks = make_iter("pagelinks", "pl", [[ from page_id from_namespace page_namespace namespace page_namespace title page_title ]]) M.protected_titles = make_iter("protected_titles", "pt", [[ namespace page_namespace title page_title user user_id reason_id integer timestamp timestamp expiry timestamp create_perm string ]]) M.redirect = make_iter("redirect", "rd", [[ from page_id namespace page_namespace title page_title interwiki nullable_string fragment nullable_string ]]) M.site_stats = make_iter("site_stats", "ss", [[ row_id integer total_edits nullable_integer good_articles nullable_integer total_pages nullable_integer users nullable_integer images nullable_integer active_users nullable_integer ]]) M.sites = make_iter("sites", "site", [[ id integer global_key string type string group string source string language string protocol string domain string data string forward boolean config string ]]) M.templatelinks = make_iter("templatelinks", "tl", [[ from page_id namespace page_namespace title page_title from_namespace page_namespace ]]) M.user_former_groups = make_iter("user_former_groups", "ufg", [[ user user_id group user_group ]]) M.user_groups = make_iter("user_groups", "ug", [[ user user_id group user_group expiry timestamp ]]) M.wbc_entity_usage = make_iter("wbc_entity_usage", "eu", [[ row_id integer -- bigint(20), but will probably not overflow 64-bit signed integer soon entity_id string aspect string page_id page_id ]]) return M
local ns2_Embryo_SetGestationData = Embryo.SetGestationData function Embryo:SetGestationData(techIds, previousTechId, healthScalar, armorScalar) ns2_Embryo_SetGestationData(self, techIds, previousTechId, healthScalar, armorScalar) if self.isSpawning then self.gestationTime = kSpawnGestateTime else self.gestationTime = kSkulkGestateTime end end
#!/usr/bin/env luajit -- script to convert text files to another format require 'ext' --local gcmem = require 'ext.gcmem' local result, ffi = pcall(require, 'ffi') local useffi = true local OutputPoints = require 'output_points' local julian = assert(loadfile('../horizons/julian.lua'))() local mjdOffset = 2400000.5 local auInM = 149597870700 -- 1AU in meters local Columns = require 'columns' --[[ args: inputFile (text) processRow = function(line) outputObj --]] local function processToFile(args) local inputFilename = assert(args.inputFilename) local processRow = assert(args.processRow) local outputObj = assert(args.outputObj) local lastTime = os.time() -- file[] read is not working on luajit in windows --local data = file[inputFilename] local data = io.readfile(inputFilename) local lines = assert(data, "failed to read file "..inputFilename):split('\n') local cols = Columns(lines) print(tolua(cols.columns)) for i=3,#lines do -- skip headers and ---- line local line = lines[i] if #line:trim() > 0 then xpcall(function() outputObj:processBody(assert(processRow(cols(line)))) end, function(err) io.stderr:write('failed on file '..inputFilename..' line '..i..'\n') io.stderr:write(err..'\n'..debug.traceback()..'\n') os.exit(1) end) end local thisTime = os.time() if thisTime ~= lastTime then print(inputFilename..' '..math.floor(100*(i-2)/(#lines-2))..'% complete...') lastTime = thisTime end end end OutputPoints:staticInit() -- these match the fields in coldesc.lua and probably row-desc.json local numberFields = table{ 'epoch', 'perihelionDistance', --comets 'semiMajorAxis', --asteroids 'eccentricity', 'inclination', 'argumentOfPeriapsis', 'longitudeOfAscendingNode', 'meanAnomalyAtEpoch', --asteroids 'absoluteMagnitude', --asteroids 'magnitudeSlopeParameter', --asteroids 'timeOfPerihelionPassage', --comets } local real if useffi then real = 'double' local template = require 'template' local code = template([[ typedef <?=real?> real; typedef struct { <? for _,field in ipairs(numberFields) do ?> real <?=field?>; <? end ?> int bodyType; // 0=comet, 1=numbered, 2=unnum int horizonID; //for numbered asteroids only char name[43+1]; char orbitSolutionReference[12+1]; //computed parameters: long index; real pos[3], vel[3], A[3], B[3]; real eccentricAnomaly; real timeOfPeriapsisCrossing; real meanAnomaly; int orbitType; // 0=elliptic, 1=hyperbolic, 2=parabolic ... this can be derived from eccentricity real orbitalPeriod; } body_t; ]], { real = real, numberFields = numberFields, }) ffi.cdef(code) local allFields = numberFields:mapi(function(name) return {name=name, type=real} end):append{ {name='bodyType', type='int'}, {name='horizonID', type='int'}, {name='name', type='char[44]'}, {name='orbitSolutionReference', type='char[13]'}, {name='index', type='long'}, {name='pos', type=real..'[3]'}, {name='vel', type=real..'[3]'}, {name='A', type=real..'[3]'}, {name='B', type=real..'[3]'}, {name='eccentricAnomaly', type=real}, {name='timeOfPeriapsisCrossing', type=real}, {name='meanAnomaly', type=real}, {name='orbitType', type='int'}, {name='orbitalPeriod', type=real}, } local f = assert(io.open('body_t_desc.lua', 'w')) f:write'return {\n' f:write('\tname = '..('%q'):format'body_t'..',\n') f:write('\tsize = '..ffi.sizeof'body_t'..',\n') f:write'\tfields = {\n' for _,field in ipairs(allFields) do f:write('\t\t'..field.name..' = {' ..'type='..('%q'):format(field.type)..', ' ..'offset='..ffi.offsetof('body_t', field.name)..', ' ..'size='..ffi.sizeof(ffi.new(field.type))..', ' ..'},\n') end f:write'\t},\n' f:write'}\n' end local function newBody() if not useffi then return setmetatable({}, { __index = { getPos = function(self) return unpack(self.pos) end, }, }) end local body = setmetatable({ _ptr = ffi.new'body_t[1]', --gcmem.new('body_t',1), getPos = function(self) return self._ptr[0].pos[0], self._ptr[0].pos[1], self._ptr[0].pos[2] end, }, { -- can you use cdata as __index and __newindex values -- similar to how you can use tables? __index = function(self,k) return self._ptr[0][k] end, __newindex = function(self,k,v) self._ptr[0][k] = v end }) for _,field in ipairs(numberFields) do body[field] = math.nan end body.horizonID = 0 body.absoluteMagnitude = math.huge return body end -- [[ process comets processToFile{ inputFilename = 'ELEMENTS.COMET', outputObj = OutputPoints{ filename = 'comets.json', variableName = 'cometData', bodyType = 0, }, processRow = function(row) local body = newBody() local numberAndName = row['Num Name'] body.name = numberAndName:trim() body.epoch = assert(tonumber(row.Epoch:trim())) + mjdOffset body.perihelionDistance = assert(tonumber(row.q:trim())) * auInM body.eccentricity = assert(tonumber(row.e:trim())) body.inclination = math.rad(assert(tonumber(row.i:trim()))) -- wrt J2000 ecliptic plane body.argumentOfPeriapsis = math.rad(assert(tonumber(row.w:trim()))) body.longitudeOfAscendingNode = math.rad(assert(tonumber(row.Node:trim()))) -- time of perihelion passage do local str = row.Tp local year = assert(tonumber(str:sub(1,4))) local month = assert(tonumber(str:sub(5,6))) local day = assert(tonumber(str:sub(7))) -- TODO calendarToJulian() function. this is a rough rough guess. body.timeOfPerihelionPassage = julian.fromCalendar{year=year, month=month, day=day} end body.orbitSolutionReference = row.Ref:trim() return body end, } --]] -- [[ process numbered bodies processToFile{ inputFilename = 'ELEMENTS.NUMBR', outputObj = OutputPoints{ filename = 'smallbodies-numbered.json', variableName = 'numberedSmallBodyData', bodyType = 1, }, processRow = function(row) local body = newBody() body.horizonID = assert(tonumber(row.Num:trim())) body.name = row.Name:trim() body.epoch = assert(tonumber(row.Epoch:trim())) + mjdOffset body.semiMajorAxis = assert(tonumber(row.a:trim())) * auInM body.eccentricity = assert(tonumber(row.e:trim())) body.inclination = math.rad(assert(tonumber(row.i:trim()))) body.argumentOfPeriapsis = math.rad(assert(tonumber(row.w:trim()))) body.longitudeOfAscendingNode = math.rad(assert(tonumber(row.Node:trim()))) body.meanAnomalyAtEpoch = math.rad(assert(tonumber(row.M:trim()))) body.absoluteMagnitude = assert(tonumber(row.H:trim())) body.magnitudeSlopeParameter = assert(tonumber(row.G:trim())) body.orbitSolutionReference = row.Ref:trim() return body end, } --]] -- [[ process unnumbered bodies processToFile{ inputFilename = 'ELEMENTS.UNNUM', outputObj = OutputPoints{ filename = 'smallbodies-unnumbered.json', variableName = 'unnumberedSmallBodyData', bodyType = 2, }, processRow = function(row) local body = newBody() body.name = row.Designation:trim() body.epoch = assert(tonumber(row.Epoch:trim())) + mjdOffset body.semiMajorAxis = assert(tonumber(row.a:trim())) * auInM body.eccentricity = assert(tonumber(row.e:trim())) body.inclination = math.rad(assert(tonumber(row.i:trim()))) body.argumentOfPeriapsis = math.rad(assert(tonumber(row.w:trim()))) body.longitudeOfAscendingNode = math.rad(assert(tonumber(row.Node:trim()))) body.meanAnomalyAtEpoch = math.rad(assert(tonumber(row.M:trim()))) body.absoluteMagnitude = assert(tonumber(row.H:trim())) body.magnitudeSlopeParameter = assert(tonumber(row.G:trim())) body.orbitSolutionReference = row.Ref:trim() return body end, } --]] OutputPoints:staticDone()
slot2 = "SlwhRoomCcsView" SlwhRoomCcsView = class(slot1) SlwhRoomCcsView.onCreationComplete = function (slot0) slot6 = slot0.layerRoomList.content_sv.getContentSize(slot7).height slot7 = cc.size(slot4, display.width) slot0.layerRoomList.content_sv.setContentSize(display.width, slot2) slot6 = slot0.layerRoomList.content_sv slot9 = slot0.layerRoomList.layerContent slot0.layerRoomList.content_sv.setInnerContainerSize(display.width, slot0.layerRoomList.layerContent.getContentSize(slot2)) slot7 = false slot0.layerRoomList.content_sv.setClippingEnabled(display.width, slot2) slot7 = true slot0.layerRoomList.content_sv.setIsCenterWhileNeed(display.width, slot2) slot7 = slot0.layerRoomList.layerContent slot0.layerRoomList.content_sv.addContentChild(display.width, slot2) slot6 = slot0.layerRoomList.content_sv DisplayUtil.setAllCascadeOpacityEnabled(display.width) slot0._roomBtnInitPoses = {} slot0._roomBtns = {} for slot8 = 1, 5, 1 do if slot1["btn" .. slot8] ~= nil then slot13 = slot9 table.insert(slot11, slot0._roomBtns) slot9._index = slot8 slot9._kind = slot8 slot15 = slot9 slot0._roomBtnInitPoses[slot8] = DisplayUtil.ccpCopy(slot9.getPosition(slot14)) if device.platform ~= "windows" then slot13 = slot9 slot2.addBtn2HandleTouchOperate(slot11, slot2) end end end slot7 = slot0 slot0.initRoomSpine(slot6) slot9 = Hero slot11 = { x = 0.5, y = 0.5 } slot10 = TreeFunc.createSpriteNumber(Hero.getUserScore, slot5, Tree.root .. "room/money/number_%s.png", {}) slot0.layerBottom.node_score.addChild(slot5, slot0.layerBottom.node_score) slot9 = slot0 slot0.alignComponent(slot5) slot9 = slot1 slot0._originX, slot0._originY = slot1.getPosition(slot5) slot0._lastOffset = 0 slot7 = CONFIG_CUR_WIDTH + 352 slot0._maxOffsetX = 10 end SlwhRoomCcsView.alignComponent = function (slot0) slot6 = 80 slot0.controller.adjustSlimWidth(slot2, slot0.controller, slot0.layerTop.btnBack, UIConfig.ALIGN_LEFT) slot6 = 80 slot0.controller.adjustSlimWidth(slot2, slot0.controller, slot0.layerTop.btnQuestion, UIConfig.ALIGN_LEFT) slot6 = -80 slot0.controller.adjustSlimWidth(slot2, slot0.controller, slot0.layerBottom.btnFastBegin, UIConfig.ALIGN_RIGHT) slot6 = -80 slot0.controller.adjustSlimWidth(slot2, slot0.controller, slot0.imageLogo, UIConfig.ALIGN_RIGHT) for slot5 = 1, #{ slot0.layerBottom.head, slot0.layerBottom.sprite_head_frame, slot0.layerBottom.text_name, slot0.layerBottom.image_money_panel, slot0.layerBottom.money_icon, slot0.layerBottom.node_score, slot0.layerBottom.btnAdd, slot0.layerBottom.imag_hero_panel }, 1 do slot11 = 80 slot0.controller.adjustSlimWidth(slot7, slot0.controller, slot1[slot5], UIConfig.ALIGN_LEFT) end end SlwhRoomCcsView.initRoomSpine = function (slot0) for slot5 = 1, 5, 1 do slot12 = Tree.Room[slot5][1].atlas slot8 = sp.SkeletonAnimation.create(slot9, sp.SkeletonAnimation, Tree.Room[slot5][1].json) slot14 = true slot8.setAnimation(sp.SkeletonAnimation, slot8, 0, "animation") slot12 = slot8 slot0._roomBtns[slot5].node_spine.addChild(sp.SkeletonAnimation, slot0._roomBtns[slot5].node_spine) slot13 = Tree.Room[slot5][2].atlas slot9 = sp.SkeletonAnimation.create(sp.SkeletonAnimation, sp.SkeletonAnimation, Tree.Room[slot5][2].json) slot15 = true slot9.setAnimation(sp.SkeletonAnimation, slot9, 0, "animation") slot13 = slot9 slot0._roomBtns[slot5].node_spine.addChild(sp.SkeletonAnimation, slot0._roomBtns[slot5].node_spine) slot14 = Tree.Room[slot5][3].atlas slot10 = sp.SkeletonAnimation.create(sp.SkeletonAnimation, sp.SkeletonAnimation, Tree.Room[slot5][3].json) slot16 = true slot10.setAnimation(sp.SkeletonAnimation, slot10, 0, "animation") slot14 = slot10 slot0._roomBtns[slot5].node_spine.addChild(sp.SkeletonAnimation, slot0._roomBtns[slot5].node_spine) end slot6 = Tree.root .. "animation/quickstart/slwh_quickstart.atlas" slot2 = sp.SkeletonAnimation.create(slot3, sp.SkeletonAnimation, Tree.root .. "animation/quickstart/slwh_quickstart.json") slot8 = slot0.layerBottom.btnFastBegin.getContentSize(sp.SkeletonAnimation).height * 0.5 slot2.setPosition(slot0.layerBottom.btnFastBegin, slot2, slot0.layerBottom.btnFastBegin.getContentSize(sp.SkeletonAnimation).width * 0.5) slot9 = true slot2.setAnimation(slot0.layerBottom.btnFastBegin, slot2, 0, "animation") slot7 = slot2 slot0.layerBottom.btnFastBegin.addChild(slot0.layerBottom.btnFastBegin, slot0.layerBottom.btnFastBegin) slot8 = Tree.root .. "animation/room/slwh_xcbg_hou.atlas" slot4 = sp.SkeletonAnimation.create(slot0.layerBottom.btnFastBegin, sp.SkeletonAnimation, Tree.root .. "animation/room/slwh_xcbg_hou.json") slot10 = true slot4.setAnimation(sp.SkeletonAnimation, slot4, 0, "animation") slot8 = slot4 slot0.node_animation.addChild(sp.SkeletonAnimation, slot0.node_animation) slot0._skeleton1 = slot4 slot9 = Tree.root .. "animation/room/slwh_xcbg_zhong.atlas" slot5 = sp.SkeletonAnimation.create(sp.SkeletonAnimation, sp.SkeletonAnimation, Tree.root .. "animation/room/slwh_xcbg_zhong.json") slot11 = true slot5.setAnimation(sp.SkeletonAnimation, slot5, 0, "animation") slot9 = slot5 slot0.node_animation.addChild(sp.SkeletonAnimation, slot0.node_animation) slot0._skeleton2 = slot5 slot10 = Tree.root .. "animation/room/slwh_xcbg_qian.atlas" slot6 = sp.SkeletonAnimation.create(sp.SkeletonAnimation, sp.SkeletonAnimation, Tree.root .. "animation/room/slwh_xcbg_qian.json") slot12 = true slot6.setAnimation(sp.SkeletonAnimation, slot6, 0, "animation") slot10 = slot6 slot0.node_animation.addChild(sp.SkeletonAnimation, slot0.node_animation) slot0._skeleton3 = slot6 slot10 = Tree.root .. "particle/slwh_xcbg1.plist" slot7 = cc.ParticleSystemQuad.create(sp.SkeletonAnimation, cc.ParticleSystemQuad) slot12 = -300 slot7.setPosition(cc.ParticleSystemQuad, slot7, -467) slot11 = slot7 slot0.node_animation.addChild(cc.ParticleSystemQuad, slot0.node_animation) slot11 = Tree.root .. "particle/slwh_xcbg2.plist" slot8 = cc.ParticleSystemQuad.create(cc.ParticleSystemQuad, cc.ParticleSystemQuad) slot13 = -300 slot8.setPosition(cc.ParticleSystemQuad, slot8, -467) slot12 = slot8 slot0.node_animation.addChild(cc.ParticleSystemQuad, slot0.node_animation) slot12 = Tree.root .. "particle/slwh_xcbg3.plist" slot9 = cc.ParticleSystemQuad.create(cc.ParticleSystemQuad, cc.ParticleSystemQuad) slot14 = -300 slot9.setPosition(cc.ParticleSystemQuad, slot9, 467) slot13 = slot9 slot0.node_animation.addChild(cc.ParticleSystemQuad, slot0.node_animation) slot13 = Tree.root .. "particle/slwh_xcbg4.plist" slot10 = cc.ParticleSystemQuad.create(cc.ParticleSystemQuad, cc.ParticleSystemQuad) slot15 = -300 slot10.setPosition(cc.ParticleSystemQuad, slot10, 467) slot14 = slot10 slot0.node_animation.addChild(cc.ParticleSystemQuad, slot0.node_animation) end SlwhRoomCcsView.updateButtonState = function (slot0) slot4 = gameMgr slot3 = gameMgr.getServerVosDicEx(slot0.model)[slot0.model.getGameKind(slot2)] or {} slot0._cellScore = {} slot5 = 0 slot6 = {} for slot10 = 1, 5, 1 do if slot3[slot0._roomBtns[slot10]._kind] then slot16 = true DisplayUtil.setVisible(slot14, slot11) slot6[slot5 + 1] = slot11 slot16 = true slot11.setEnabled(slot14, slot11) slot16 = slot0._roomBtnInitPoses[slot5 + 1] slot11.setPosition(slot14, slot11) slot0._cellScore[slot10] = slot12._dwCellScore if slot12._miniNeed > 0 then if slot11.costImage then slot17 = false slot11.costImage.setVisible(slot15, slot11.costImage) end if slot11.txtEntry_tf ~= nil then slot17 = Tree.root .. "room/entry/number_%s.png" slot18 = HtmlUtil.createArtNumWithHansUnits(slot15, slot13) slot11.txtEntry_tf.setHtmlText(slot13, slot11.txtEntry_tf) slot18 = 5 slot11.txtEntry_tf.setSkewY(slot13, slot11.txtEntry_tf) end end else slot16 = false DisplayUtil.setVisible(slot14, slot11) if slot11.txtEntry_tf then slot16 = false slot11.txtEntry_tf.setVisible(slot14, slot11.txtEntry_tf) end if slot11.costImage then slot16 = false slot11.costImage.setVisible(slot14, slot11.costImage) end slot16 = false slot11.setCanTouch(slot14, slot11) end end slot7 = slot0.layerRoomList.layerContent slot8 = slot0.layerRoomList.content_sv slot9 = 0 slot0._roomCount = slot5 if slot5 > 0 then slot19 = slot6[slot5] slot19 = slot6[slot5] slot15 = 50 + slot6[slot5].getPositionX(slot16) + slot6[slot5].getScaleX(slot10) * slot6[slot5]:getContentSize().width * slot6[slot5]:getAnchorPoint().x slot9 = math.max(slot13, slot9) end slot12 = slot8 slot18 = slot7 slot16 = slot7.getContentSize(slot17).height slot8.setInnerContainerSize(slot11, cc.size(slot14, slot9 + 100)) if display.width <= slot9 then slot11 = 80 slot14 = (display.width - CUR_SELECTED_WIDTH) * 0.5 if math.abs(slot13) < 10 then slot11 = 0 end if display.width <= CONFIG_CUR_WIDTH then slot11 = slot11 + 20 end slot15 = -slot10 + slot11 slot8.setPositionX(slot13, slot8) else slot13 = (display.width - slot9) * 0.5 slot14 = (CONFIG_DESIGN_WIDTH - display.width) * 0.5 + math.max(slot11, 40) slot8.setPositionX(40, slot8) end slot0._roomsWidth = slot9 slot0._curShowingBtns = slot6 end SlwhRoomCcsView.onHide = function (slot0) slot5 = slot0 Hero.pNickNameChangedSignal.remove(slot2, Hero.pNickNameChangedSignal, slot0.onUserNameChanged) slot5 = slot0 Hero.userScoreChangedSignal.remove(slot2, Hero.userScoreChangedSignal, slot0.onUserScoreChanged) slot5 = slot0 slot0.layerRoomList.content_sv._viewTouchSignal.remove(slot2, slot0.layerRoomList.content_sv._viewTouchSignal, slot0.onTouchOpation) slot3 = slot0 slot0.unscheduleUpdate(slot2) end SlwhRoomCcsView.onShow = function (slot0) slot5 = slot0 slot5 = slot0.getParent(slot4) slot5 = { x = 407, y = 673 } TweenLite.to(slot2, slot0.getParent(slot4).getParent(slot4).layerNotice, 0.4) slot5 = slot0 Hero.pNickNameChangedSignal.add(slot2, Hero.pNickNameChangedSignal, slot0.onUserNameChanged) slot5 = slot0 Hero.userScoreChangedSignal.add(slot2, Hero.userScoreChangedSignal, slot0.onUserScoreChanged) slot4 = 0 slot0.layerRoomList.content_sv.jumpTo(slot2, slot0.layerRoomList.content_sv) slot3 = slot0 slot0.updateButtonState(slot2) slot3 = slot0 slot0.onUserNameChanged(slot2) slot3 = slot0 slot0.onUserScoreChanged(slot2) slot3 = slot0 slot0.playEntryAnimation(slot2) slot5 = slot0 slot0.layerRoomList.content_sv._viewTouchSignal.add(slot2, slot0.layerRoomList.content_sv._viewTouchSignal, slot0.onTouchOpation) slot5 = 1 slot0.scheduleUpdateWithPriorityLua(slot2, slot0, function (slot0) slot4 = slot0 slot0.slowSmoothAction(slot2, slot0) end) end SlwhRoomCcsView.playEntryAnimation = function (slot0) slot4 = true slot0.layerRoomList.setCascadeOpacityEnabled(slot2, slot0.layerRoomList) slot4 = true slot0.layerTop.setCascadeOpacityEnabled(slot2, slot0.layerTop) slot4 = true slot0.layerBottom.setCascadeOpacityEnabled(slot2, slot0.layerBottom) if slot0._roomCount >= 5 then slot5 = slot0.layerRoomList.content_sv slot3, slot4 = slot0.layerRoomList.content_sv.getPosition(slot4) slot10 = slot0._originY slot0.layerRoomList.layerContent.setPosition(CONFIG_DESIGN_WIDTH, slot0.layerRoomList.layerContent, slot5) slot10 = 0 slot0.layerRoomList.layerContent.setOpacity(slot0.layerRoomList.layerContent, slot6) slot9 = slot0.layerRoomList.layerContent slot16 = 0.2 slot13 = cc.DelayTime.create(slot14, cc.DelayTime) slot0.layerRoomList.layerContent.runAction(slot0.layerRoomList.layerContent, cc.Sequence.create(slot11, cc.Sequence, cc.FadeTo.create(cc.DelayTime, cc.FadeTo, 0.1))) slot9 = slot0.layerRoomList.layerContent slot16 = 0.3 slot13 = cc.DelayTime.create(cc.FadeTo.create, cc.DelayTime) slot16 = cc.EaseBackOut slot20 = 1 slot24 = slot0._originY slot0.layerRoomList.layerContent.runAction(slot0.layerRoomList.layerContent, cc.Sequence.create(slot11, cc.Sequence, cc.EaseBackOut.create(cc.DelayTime, cc.MoveTo.create(255, cc.MoveTo, cc.p(slot22, slot0._originX))))) else slot5 = slot0._originY slot2 = cc.p(slot3, slot0._originX) slot6 = 0 slot0.layerRoomList.layerContent.setOpacity(slot0._originX, slot1) slot0.layerRoomList.layerContent.setPosition(slot0._originX, slot1, slot2.x + 100) slot5 = slot0.layerRoomList.layerContent slot0.layerRoomList.layerContent.runAction(slot0._originX, cc.FadeTo.create(slot2.y, cc.FadeTo, 0.3)) slot5 = slot0.layerRoomList.layerContent slot8 = cc.EaseBackOut slot13 = slot2 slot0.layerRoomList.layerContent.runAction(slot0._originX, cc.EaseBackOut.create(slot2.y, cc.MoveTo.create(255, cc.MoveTo, 0.4))) end slot6 = slot0.layerTop slot2 = cc.p(slot0.layerTop.getPosition(slot5)) slot6 = 0 slot0.layerTop.setOpacity(slot0.layerTop.getPosition, slot1) slot0.layerTop.setPosition(slot0.layerTop.getPosition, slot1, slot2.x) slot5 = slot0.layerTop slot0.layerTop.runAction(slot0.layerTop.getPosition, cc.FadeTo.create(slot2.y + 60, cc.FadeTo, 0.3)) slot5 = slot0.layerTop slot8 = cc.EaseBackOut slot13 = slot2 slot0.layerTop.runAction(slot0.layerTop.getPosition, cc.EaseBackOut.create(slot2.y + 60, cc.MoveTo.create(255, cc.MoveTo, 0.4))) slot8 = slot0.layerBottom slot4 = cc.p(slot0.layerBottom.getPosition(slot2.y + 60)) slot8 = 0 slot0.layerBottom.setOpacity(slot0.layerBottom.getPosition, slot3) slot0.layerBottom.setPosition(slot0.layerBottom.getPosition, slot3, slot4.x) slot7 = slot0.layerBottom slot0.layerBottom.runAction(slot0.layerBottom.getPosition, cc.FadeTo.create(slot4.y - 60, cc.FadeTo, 0.3)) slot7 = slot0.layerBottom slot10 = cc.EaseBackOut slot15 = slot4 slot0.layerBottom.runAction(slot0.layerBottom.getPosition, cc.EaseBackOut.create(slot4.y - 60, cc.MoveTo.create(255, cc.MoveTo, 0.4))) end SlwhRoomCcsView.onUserNameChanged = function (slot0) slot7 = 2 slot5 = StringUtil.truncate(Hero, Hero.getPNickName(slot2), 9, nil) slot0.layerBottom.text_name.setString(Hero, slot0.layerBottom.text_name) end SlwhRoomCcsView.onUserScoreChanged = function (slot0) slot5 = Hero slot4 = slot0.layerBottom.node_score slot0.layerBottom.node_score.removeAllChildren(Hero.getUserScore) slot7 = { x = 0.5, y = 0.5 } slot6 = TreeFunc.createSpriteNumberWithDot(Hero.getUserScore, parseInt(Hero.getUserScore(slot4)), Tree.root .. "room/money/number_%s.png", {}) slot0.layerBottom.node_score.addChild(parseInt(Hero.getUserScore(slot4)), slot0.layerBottom.node_score) slot7 = GAME_STATE.ROOM slot0.controller.setHeadBg(parseInt(Hero.getUserScore(slot4)), slot0.controller, slot0.layerBottom.head) if not B_HEADCLIPPING then slot6 = slot0.layerBottom.head.mask slot0.layerBottom.head.checkMask2(slot4, slot0.layerBottom.head) else slot6 = false slot0.layerBottom.head.mask.mask.setVisible(slot4, slot0.layerBottom.head.mask.mask) end end SlwhRoomCcsView.onBtnClick = function (slot0, slot1, slot2) slot5 = "--------onButtonEvent----" print(slot4) if slot1 == slot0.layerTop.btnBack then slot5 = slot0.controller slot0.controller.exitGame(slot4) elseif slot1 == slot0.layerTop.btnQuestion then slot6 = true slot0.model.setIsShowingRule(slot4, slot0.model) elseif slot1 == slot0.layerBottom.btnAdd then slot5 = slot0.controller slot0.controller.try2OpenBank(slot4) elseif slot1 == slot0.layerBottom.btnFastBegin then slot5 = slot0.controller slot0.controller.quickStartGame(slot4) else slot6 = slot1._kind slot0.controller.requestEnterRoom(slot4, slot0.controller) slot5 = slot0.controller slot0.controller.onNetMessageCabcelCache(slot4) end end SlwhRoomCcsView.onTouchOpation = function (slot0, slot1, slot2) if slot2 == ccs.TOUCH_EVENT_BEGAN then slot0._touchOffsetX = slot1.x slot0._lastOffset = 0 elseif slot2 == ccs.TOUCH_EVENT_MOVED then slot6 = slot0._skeleton3 if slot0._maxOffsetX < slot0._skeleton3.getPositionX(slot5) + (slot1.x - slot0._touchOffsetX) * 0.5 * 0.35 then slot3 = slot0._maxOffsetX - slot4 elseif slot4 + slot3 * 0.35 < -slot0._maxOffsetX then slot3 = -slot0._maxOffsetX - slot4 end slot8 = slot4 + slot3 * 0.35 slot0._skeleton3.setPositionX(slot6, slot0._skeleton3) slot7 = slot0._skeleton2 slot8 = slot0._skeleton2.getPositionX(slot6) + slot3 * 0.06 slot0._skeleton2.setPositionX(slot6, slot0._skeleton2) slot7 = slot0._skeleton1 slot8 = slot0._skeleton1.getPositionX(slot6) + slot3 * 0.03 slot0._skeleton1.setPositionX(slot6, slot0._skeleton1) slot0._touchOffsetX = slot1.x slot0._lastOffsetT = slot3 elseif slot2 == ccs.TOUCH_EVENT_ENDED then slot0._lastOffset = slot0._lastOffsetT or 0 end end SlwhRoomCcsView.slowSmoothAction = function (slot0, slot1) if slot0._lastOffset ~= 0 then slot6 = slot0._skeleton1 slot3 = slot0._skeleton2.getPositionX(slot0._skeleton3) + slot0._lastOffset * 0.92 * 0.5 * 0.06 slot4 = slot0._skeleton1.getPositionX(slot0._skeleton2) + slot0._lastOffset * 0.92 * 0.5 * 0.03 if slot0._maxOffsetX < slot0._skeleton3.getPositionX(slot3) + slot0._lastOffset * 0.92 * 0.5 * 0.35 then slot2 = slot0._maxOffsetX slot3 = (slot0._maxOffsetX * 0.06) / 0.35 slot4 = (slot0._maxOffsetX * 0.03) / 0.35 elseif slot2 < -slot0._maxOffsetX then slot2 = -slot0._maxOffsetX slot3 = (-slot0._maxOffsetX * 0.06) / 0.35 slot4 = (-slot0._maxOffsetX * 0.03) / 0.35 end slot10 = slot2 slot0._skeleton3.setPositionX(slot8, slot0._skeleton3) slot10 = slot3 slot0._skeleton2.setPositionX(slot8, slot0._skeleton2) slot10 = slot4 slot0._skeleton1.setPositionX(slot8, slot0._skeleton1) slot9 = slot5 slot0._lastOffset = (math.abs(slot8) < 0.1 and 0) or slot5 end end SlwhRoomCcsView.destroy = function (slot0) print(slot2) slot4 = slot0.layerRoomList.layerContent.btn1 slot0.layerRoomList.layerContent.btn1.destroy("--destroy serial_room_view--") slot4 = slot0.layerRoomList.layerContent.btn2 slot0.layerRoomList.layerContent.btn2.destroy("--destroy serial_room_view--") slot4 = slot0.layerRoomList.layerContent.btn3 slot0.layerRoomList.layerContent.btn3.destroy("--destroy serial_room_view--") slot4 = slot0.layerRoomList.layerContent.btn4 slot0.layerRoomList.layerContent.btn4.destroy("--destroy serial_room_view--") slot4 = slot0.layerRoomList.layerContent.btn5 slot0.layerRoomList.layerContent.btn5.destroy("--destroy serial_room_view--") slot4 = slot0.layerTop.btnBack slot0.layerTop.btnBack.destroy("--destroy serial_room_view--") slot4 = slot0.layerTop.btnQuestion slot0.layerTop.btnQuestion.destroy("--destroy serial_room_view--") slot4 = slot0.layerRoomList.content_sv slot0.layerRoomList.content_sv.destroy("--destroy serial_room_view--") slot4 = slot0.layerBottom.btnFastBegin slot0.layerBottom.btnFastBegin.destroy("--destroy serial_room_view--") end return
Star = class() -- Star class -- 20/4/2012 -- xixgames.com -- Ludum Dare #23 -- Tiny World -- in this magic tiny world people need others like you! function Star:init(pos, vel, angl) self.position = pos self.velocity = vel self.angle = angl end function Star:update() self.position.x = self.position.x - self.velocity end function Star:draw() p = self.position pushMatrix() if self.angle ~= 0 then translate(WIDTH/3,-HEIGHT/3) end rotate(self.angle) line(p.x-self.velocity,p.y,p.x,p.y) popMatrix() end function Star:shouldCull() -- Check if off the left of the screen if (self.position.x - self.velocity) < 0 then return true end return false end ---------------------------------------------- -- All stars ---------------------------------------------- Stars = class() function Stars:init() self.minSpeed = 6 self.speed = 23 self.spawnRate = 1 self.stars = {} self.angle = 45 end function Stars:updateAndCull() toCull = {} for i,star in ipairs(self.stars) do if star:shouldCull() then table.remove( self.stars, i ) else star:update() end end end function Stars:update() -- Create spawnRate lines per update for i = 1,self.spawnRate do -- Generate random spawn location vel = math.random(self.minSpeed, self.speed) spawn = vec2( WIDTH - vel, math.random(HEIGHT) ) table.insert(self.stars, Star(spawn, vel, self.angle)) end -- Update and cull offscreen lines self:updateAndCull() end function Stars:draw() pushMatrix() self:update() pushStyle() -- noSmooth() -- stroke(179, 153, 180, 173) --strokeWidth(2) -- lineCapMode(SQUARE) for i,star in ipairs(self.stars) do star:draw() end popStyle() popMatrix() end
function PowerConsumerMixin:SetPowerSurgeDuration(duration) --if self:GetIsPowered() then -- CreateEntity( EMPBlast.kMapName, self:GetOrigin(), self:GetTeamNumber() ) --end self.timePowerSurgeEnds = Shared.GetTime() + duration self.powerSurge = true --Make sure to call this after setting up the powersurge parameters! if self.OnPowerOn then self:OnPowerOn() end end
function CreateHelpCenter() if(Window == nil) then Window = {} Label = {} Image = {} Window[1] = guiCreateWindow(296,266,437,276,"Quick help",false) Window[2] = guiCreateWindow(304,330,424,115,"Quick help",false) guiSetAlpha(Window[1],1) Label[1] = guiCreateLabel(0.0389,0.1400,0.9245,0.0543,"Where can I see the available commands?",true,Window[1]) Label[2] = guiCreateLabel(0.0401,0.2348,0.9175,0.581,"",true,Window[2]) Label[3] = guiCreateLabel(0.3042,0.8348,0.4976,0.1304,"Click anywhere on the window to close it",true,Window[2]) Label[4] = guiCreateLabel(0.8032,0.9022,0.1716,0.0616,"Close window",true,Window[1]) Label[5] = guiCreateLabel(0.0389,0.2100,0.9245,0.0543,"How can I make the chatbox look better?",true,Window[1]) Label[6] = guiCreateLabel(0.0389,0.2800,0.9245,0.0543,"I jump in a car, but I can't drive!",true,Window[1]) Label[7] = guiCreateLabel(0.0389,0.3500,0.9245,0.0543,"How do I bind keys to commands?",true,Window[1]) Label[8] = guiCreateLabel(0.0389,0.4200,0.9245,0.0543,"How do I contact the admins?",true,Window[1]) Label[9] = guiCreateLabel(0.0389,0.4900,0.9245,0.0543,"Where can I get more info about roleplay basics?",true,Window[1]) Label[10] = guiCreateLabel(0.0389,0.5600,0.9245,0.0543,"Sometimes when I use commands they don't work!",true,Window[1]) Label[11] = guiCreateLabel(0.0389,0.6300,0.9245,0.0543,"I have a problem and its not listed here!",true,Window[1]) Image[1] = guiCreateStaticImage(0.7529,0.1268,0.1487,0.2029,"info.png",true,Window[1]) guiSetAlpha(Label[1],1) guiLabelSetVerticalAlign(Label[1],"top") guiLabelSetHorizontalAlign(Label[1],"left",false) guiSetFont(Label[1],"default-bold-small") for i=5,11 do guiSetAlpha(Label[i],1) guiLabelSetVerticalAlign(Label[i],"top") guiLabelSetHorizontalAlign(Label[i],"left",false) guiSetFont(Label[i],"default-bold-small") end guiLabelSetVerticalAlign(Label[2],"top") guiLabelSetHorizontalAlign(Label[2],"left",true) guiSetFont(Label[2],"default-bold-small") guiLabelSetVerticalAlign(Label[3],"top") guiLabelSetHorizontalAlign(Label[3],"left",false) guiSetFont(Label[3],"default-small") guiSetAlpha(Label[4],1) guiLabelSetVerticalAlign(Label[4],"top") guiLabelSetHorizontalAlign(Label[4],"left",false) guiSetAlpha(Image[1],1) guiSetVisible(Window[1], true) guiSetVisible(Window[2], false) showCursor(true) addEventHandler( "onClientGUIClick", Label[4], DestroyHelpCenter, false) addEventHandler( "onClientGUIClick", Window[2], HideSelection) addEventHandler( "onClientGUIClick", Label[1], function() Selection(1) end, false) addEventHandler( "onClientGUIClick", Label[5], function() Selection(2) end, false) addEventHandler( "onClientGUIClick", Label[6], function() Selection(3) end, false) addEventHandler( "onClientGUIClick", Label[7], function() Selection(4) end, false) addEventHandler( "onClientGUIClick", Label[8], function() Selection(5) end, false) addEventHandler( "onClientGUIClick", Label[9], function() Selection(6) end, false) addEventHandler( "onClientGUIClick", Label[10], function() Selection(7) end, false) addEventHandler( "onClientGUIClick", Label[11], function() Selection(8) end, false) end end addCommandHandler("helpme", CreateHelpCenter) function DestroyHelpCenter() removeEventHandler( "onClientGUIClick", Label[4], DestroyHelpCenter, false) removeEventHandler( "onClientGUIClick", Label[3], HideSelection, false) removeEventHandler( "onClientGUIClick", Label[1], function() Selection(1) end, false) removeEventHandler( "onClientGUIClick", Label[5], function() Selection(2) end, false) removeEventHandler( "onClientGUIClick", Label[6], function() Selection(3) end, false) removeEventHandler( "onClientGUIClick", Label[7], function() Selection(4) end, false) removeEventHandler( "onClientGUIClick", Label[8], function() Selection(5) end, false) removeEventHandler( "onClientGUIClick", Label[9], function() Selection(6) end, false) removeEventHandler( "onClientGUIClick", Label[10], function() Selection(7) end, false) removeEventHandler( "onClientGUIClick", Label[11], function() Selection(8) end, false) guiSetVisible(Window[1], false) guiSetVisible(Window[2], false) showCursor(false) elements = getElementChildren(Window[1]) for k,v in ipairs(elements) do destroyElement(v) v = nil end elements = getElementChildren(Window[2]) for k,v in ipairs(elements) do destroyElement(v) v = nil end destroyElement(Window[1]) destroyElement(Window[2]) Window = nil Label = nil Image = nil end function HideSelection() guiSetVisible(Window[2], false) guiSetVisible(Window[1], true) end function Selection(opt) guiSetVisible(Window[1], false) guiSetVisible(Window[2], true) if(opt == 1) then xml = getResourceConfig("1.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) elseif(opt == 2) then xml = getResourceConfig("2.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) elseif(opt == 3) then xml = getResourceConfig("3.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) elseif(opt == 4) then xml = getResourceConfig("4.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) elseif(opt == 5) then xml = getResourceConfig("5.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) elseif(opt == 6) then xml = getResourceConfig("6.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) elseif(opt == 7) then xml = getResourceConfig("7.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) elseif(opt == 8) then xml = getResourceConfig("8.xml") entry = xmlNodeGetValue(xml) guiSetText(Label[2], entry) end end
HedgewarsScriptLoad("/Scripts/Locale.lua") local player = nil -- This variable will point to the hog's gear local p2 = nil local enemy = nil local bCrate = nil local playerTeamName = loc("Feeble Resistance") local GameOver = false function onGameInit() -- Things we don't modify here will use their default values. Seed = 0 -- The base number for the random number generator GameFlags = gfDisableWind-- Game settings and rules TurnTime = 30000 -- The time the player has to move each round (in ms) CaseFreq = 0 -- The frequency of crate drops MinesNum = 0 -- The number of mines being placed MinesTime = 1 Explosives = 0 -- The number of explosives being placed Map = "Mushrooms" -- The map to be played Theme = "Nature" -- The theme to be used -- Disable Sudden Death HealthDecrease = 0 WaterRise = 0 playerTeamName = AddMissionTeam(-1) player = AddMissionHog(50) p2 = AddMissionHog(20) AddTeam(loc("Cybernetic Empire"), -6, "ring", "Island", "Robot_qau", "cm_cyborg") enemy = AddHog(loc("Unit 3378"), 5, 30, "cyborg1") SetGearPosition(player,1403,235) SetGearPosition(p2,1269,239) SetGearPosition(enemy,492,495) end function onGameStart() --mines AddGear(276,76,gtMine, 0, 0, 0, 0) AddGear(301,76,gtMine, 0, 0, 0, 0) AddGear(326,76,gtMine, 0, 0, 0, 0) AddGear(351,76,gtMine, 0, 0, 0, 0) AddGear(376,76,gtMine, 0, 0, 0, 0) AddGear(401,76,gtMine, 0, 0, 0, 0) AddGear(426,76,gtMine, 0, 0, 0, 0) AddGear(451,76,gtMine, 0, 0, 0, 0) AddGear(476,76,gtMine, 0, 0, 0, 0) AddGear(886,356,gtMine, 0, 0, 0, 0) AddGear(901,356,gtMine, 0, 0, 0, 0) AddGear(926,356,gtMine, 0, 0, 0, 0) AddGear(951,356,gtMine, 0, 0, 0, 0) AddGear(976,356,gtMine, 0, 0, 0, 0) AddGear(1001,356,gtMine, 0, 0, 0, 0) -- crates crates and more crates bCrate = SpawnSupplyCrate(1688,476,amBaseballBat) SpawnSupplyCrate(572,143,amGirder) SpawnSupplyCrate(1704,954,amPickHammer) SpawnSupplyCrate(704,623,amBlowTorch) SpawnSupplyCrate(1543,744,amJetpack) SpawnSupplyCrate(227,442,amDrill) ShowMission(loc("Teamwork"), loc("Scenario"), loc("Eliminate Unit 3378.") .. "|" .. loc("Both your hedgehogs must survive.") .. "|" .. loc("Mines time: 0 seconds"), 1, 0) end function onAmmoStoreInit() SetAmmo(amBlowTorch, 0, 0, 0, 1) SetAmmo(amGirder, 0, 0, 0, 1) SetAmmo(amPickHammer, 0, 0, 0, 2) SetAmmo(amJetpack, 0, 0, 0, 1) SetAmmo(amDrill, 0, 0, 0, 2) SetAmmo(amBaseballBat, 0, 0, 0, 1) SetAmmo(amSwitch, 9, 0, 0, 0) SetAmmo(amSkip, 9, 0, 0, 0) end function onGearDelete(gear) if gear == bCrate then HogSay(CurrentHedgehog, loc("Hmmm..."), SAY_THINK) end if (GetGearType(gear) == gtCase) and (band(GetGearMessage(gear), gmDestroy) ~= 0) then SetTurnTimeLeft(TurnTimeLeft + 5000) AddCaption(string.format(loc("+%d seconds!"), 5), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage) PlaySound(sndExtraTime) end -- Note: The victory sequence is done automatically by Hedgewars if ( ((gear == player) or (gear == p2)) and (GameOver == false)) then GameOver = true SetHealth(p2,0) SetHealth(player,0) end end function onGameResult(winner) if winner == GetTeamClan(playerTeamName) then SaveMissionVar("Won", "true") SendStat(siGameResult, loc("Mission succeeded!")) GameOver = true else SendStat(siGameResult, loc("Mission failed!")) GameOver = true end end
require "scripts.variableholder"; require "scripts.info" Ability = class(VariableHolder, function (obj, ...) VariableHolder.init(obj, ...) obj.OnSpellStart = obj.OnSpellStart obj.OnAbilityPhaseStart = obj.OnAbilityPhaseStart obj.OnAbilityPhaseInterrupted = obj.OnAbilityPhaseInterrupted obj.OnChannelFinish = obj.OnChannelFinish obj.OnUpgrade = obj.OnUpgrade obj.OnAttached = obj.OnAttached obj.OnDetached = obj.OnDetached end); function Ability:SetCooldown(cooldown) self:RegisterVariable("cooldown_max",cooldown); self:RegisterDependentVariable("cooldown"); self:RegisterVariable("cooldown_current",cooldown); if( not self:HasValue("cooldown_timer") ) then self:RegisterVariable("cooldown_timer"); end end function Ability:GetLevel() return AbilityRequestBus.Event.GetLevel(self.entityId) or 0; end function Ability:SetLevel(level) if( level >= 0 and level <= Ability.GetMaxLevel(self)) then AbilityRequestBus.Event.SetLevel(self.entityId,level); end end function Ability:GetMaxLevel() if GetAbilityInfo(self.entityId) then return GetAbilityInfo(self.entityId).MaxLevel or 4; end return 4 end function Ability:Upgrade () if not Game:IsAuthoritative() then GameNetSyncRequestBus.Broadcast.SendNewOrder(self:GetCaster().entityId, UpgradeOrder(self.entityId), false) return end local owner = self:GetOwner() if owner and owner:GetValue("ability_points") > 0 then owner:Take("ability_points", 1) else Debug.Log('Not enough ability points! level up more, noob...') return end local level = Ability.GetLevel(self); if level < Ability.GetMaxLevel(self) then Ability.SetLevel(self, level + 1); else Debug.Log("Ability:Upgrade() : already at max level!"); end end function Ability:GetCosts() return AbilityRequestBus.Event.GetCosts(self.entityId); end function Ability:SetCosts(costs) if( type(costs) == 'table' ) then local vector = vector_Amount(); for k,v in pairs(costs) do if(type(v)=='number') then local cost=Amount(k,v); vector:push_back(cost); end end return AbilityRequestBus.Event.SetCosts(self.entityId,vector); else return AbilityRequestBus.Event.SetCosts(self.entityId,costs); end end function Ability:OnCreated () end function Ability:OnDestroyed () end function Ability:GetModifiers () return {} end function Ability:OnActivate() Debug.Log("Ability:OnActivate() id is ["..tostring(self:GetId()).."]"); if self:HasValue("cooldown_max") then self:SetCooldown(self:GetValue("cooldown_max")) end self.AbilityNotificationBusHandler = AbilityNotificationBus.Connect(self,self.entityId); if self:GetCaster() then self:AttachModifiers(self:GetCaster()) end end function Ability:OnDeactivate() end function Ability:GetType() return AbilityRequestBus.Event.GetAbilityTypeId(self.entityId) or ""; end function Ability:GetName() return AbilityRequestBus.Event.GetAbilityTypeId(self.entityId) or ""; end function Ability:GetCastingBehavior() return AbilityRequestBus.Event.GetCastingBehavior(self.entityId); end function Ability:SetCastingBehavior(behavior) AbilityRequestBus.Event.SetCastingBehavior(self.entityId,behavior); end function Ability:GetCaster() local unitId = CastContextRequestBus.Event.GetCaster(self.entityId) if unitId and unitId:IsValid() then return Unit({ entityId = unitId }); end return self:GetOwner() end function Ability:GetOwner() local unitId = AbilityRequestBus.Event.GetCaster(self.entityId) if unitId and unitId:IsValid() then return Unit({ entityId = unitId }); end return nil end function Ability:GetCursorTarget() local unit_id = CastContextRequestBus.Event.GetCursorTarget(self.entityId); if(unit_id:IsValid()) then return Unit({entityId=unit_id}); else return nil; end end function Ability:GetCursorPosition() return CastContextRequestBus.Event.GetCursorPosition(self.entityId); end function Ability:GetBehaviorUsed() return CastContextRequestBus.Event.GetBehaviorUsed(self.entityId); end function Ability:IsItem() local result = StaticDataRequestBus.Event.GetValue(self.entityId, "IsItem") Debug.Log('is item! ' .. tostring(result)) return StaticDataRequestBus.Event.GetValue(self.entityId, "IsItem") == "true" end function Ability:OnAbilityPhaseStart() return true; end function Ability:OnSpellStart() end function Ability:OnAttached(unitId) self:AttachModifiers(unitId) end function Ability:DetachModifiers () if not self.modifiers then return end for i,m in ipairs(self.modifiers) do m:Destroy() end self.modifiers = {} end function Ability:OnUpgrade () Debug.Log('This ability has been upgraded!!') self:AttachModifiers(self:GetCaster()) end function Ability:AttachModifiers (caster) self:DetachModifiers() if not caster or self:GetLevel() < 1 then return end local modifiers = self:GetModifiers() if not modifiers or #modifiers == 0 then return end local unit = Unit({entityId = GetId(caster) }) self.modifiers = {} for i,modifierName in ipairs(modifiers) do Debug.Log('Attaching modifier ' .. modifierName) local modifier = unit:AddNewModifier(caster, self, modifierName, {}) table.insert(self.modifiers, modifier) end end function Ability:GetSpecialValue (name) local value = StaticDataRequestBus.Event.GetSpecialValueLevel(self.entityId, name, self:GetLevel()) if value==nil or value=="" then return nil end return tonumber(value) or value end function Ability:DetachAndDestroy() local unitId = AbilityRequestBus.Event.GetCaster(self.entityId) if( unitId and unitId:IsValid()) then UnitAbilityRequestBus.Event.DetachAbility(unitId, self.entityId) end GameManagerRequestBus.Broadcast.DestroyEntity(self.entityId) end
ITEM.name = "Фамильный длинный меч" ITEM.desc = "Весь покрыт гравировками. Похож на семейную реликвию." ITEM.class = "nut_long_family" ITEM.weaponCategory = "primary" ITEM.price = 600 ITEM.category = "Оружие" ITEM.model = "models/morrowind/silver/longsword/w_silver_longsword.mdl" ITEM.width = 5 ITEM.height = 1 ITEM.iconCam = { pos = Vector(-0.5, 71.682510375977, 11.756512641907), ang = Angle(0, 270, -98.883293151855), fov = 45 } ITEM.damage = {1, 8} ITEM.permit = "melee" ITEM.pacData = {[1] = { ["children"] = { [1] = { ["children"] = { [1] = { ["children"] = { }, ["self"] = { ["Event"] = "weapon_class", ["Arguments"] = "nut_long_family", ["UniqueID"] = "4011003967", ["ClassName"] = "event", }, }, }, ["self"] = { ["Angles"] = Angle(-5.4428701400757, 152.64366149902, 74.911987304688), ["UniqueID"] = "732790205", ["Position"] = Vector(3.51318359375, -4.351318359375, 1.10107421875), ["EditorExpand"] = true, ["Bone"] = "left thigh", ["Model"] = "models/morrowind/silver/longsword/w_silver_longsword.mdl", ["ClassName"] = "model", }, }, }, ["self"] = { ["EditorExpand"] = true, ["UniqueID"] = "2083764954", ["ClassName"] = "group", ["Name"] = "my outfit", ["Description"] = "add parts to me!", }, }, }
return { { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1300 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 3, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1380 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 3.5, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1460 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 4, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1560 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 4.5, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1680 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 5, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1800 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 5.5, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1950 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 6, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 2100 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 6.5, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 2300 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 7, mul = 0 } } } }, { effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 2500 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 8, mul = 0 } } } }, time = 0, name = "完美的娇小女仆", init_effect = "jinengchufablue", color = "blue", picture = "", desc = "航速、机动提高", stack = 1, id = 11281, icon = 11280, last_effect = "", blink = { 0, 0.7, 1, 0.3, 0.3 }, effect_list = { { type = "BattleBuffAddAttrRatio", trigger = { "onAttach" }, arg_list = { attr = "dodgeRate", number = 1300 } }, { type = "BattleBuffFixVelocity", trigger = { "onAttach" }, arg_list = { add = 3, mul = 0 } } } }
local lib = {} ---------------- -- Meta stuff --- same function lib.same(x) return x end -- meta function lib.map(t,f, u) u,f = {}, type(f)== "function" and f or _ENV[f] for i,v in pairs(t or {}) do u[i] = f(v) end return u end ---------------- -- Column stuff --- same function lib.num () return {lo=math.maxinteger, hi=math.mininteger} end ----------------- -- String stuff --- oo -- Recursive print of a table. Ignore keys starting with "_" function lib.oo(t,pre, indent,fmt) pre = pre or "" indent = indent or 0 if indent < 10 then for k, v in pairs(t or {}) do if not (type(k)=='string' and k:match("^_")) then if not (type(v)=='function') then fmt = pre..string.rep("| ",indent)..tostring(k)..": " if type(v) == "table" then lib.oo(v, pre, indent+1) else print(fmt .. tostring(v)) end end end end end end --- trim function trim(str) return (str:gsub("^%s*(.-)%s*$", "%1")) end --- words function words(str,pat,fun, t) t = {} for x in str:gmatch(pat) do t[#t+1] = fun(x) or trim(x) end return t end --- csv function lib.csv(file, ch,fun, pat,stream,tmp,row) stream = file and io.input(file) or io.input() tmp = io.read() pat = "([^".. (ch or ",") .."]+)" fun = tonumber return function() if tmp then row = words(tmp:gsub("[\t\r ]*",""),pat,fun)-- no spaces tmp = io.read() if #row > 0 then for i,x in pairs(row) do row[i] = tonumber(row[i]) or row[i] end return row end else io.close(stream) end end end return lib
local name = string local clock = os.clock function sleep(n) local start = clock() while clock() - start <= n do end end for k, v in pairs(name) do print(k .. " = " .. tostring(v)) end sleep(1) print("Erasing contents...") sleep(1) for k, v in pairs(name) do if type(name[k]) == "function" then name[k] = function(...) print("No using this") end else name[k] = nil end end
local HomeScreen = Class("HomeScreen") SnakeBean=require "src/bean/SnakeBean" function HomeScreen:init(game) self.game = game self.input = "home" self.title = love.graphics.newImage("res/title.png") self.began = love.graphics.newImage("res/began.png") self.help = love.graphics.newImage("res/help.png") self.quit = love.graphics.newImage("res/quit.png") self.pmusic = love.graphics.newImage("res/pmusic.png") self.nmusic = love.graphics.newImage("res/nmusic.png") self.xiangji = love.graphics.newImage("res/xiangji.png") self.snake1 = SnakeBean(300,300) self.snake1:setDirction(1) self.winWidth = love.graphics.getWidth() self.winHeight = love.graphics.getHeight() end function HomeScreen:draw() love.graphics.draw(self.title,20+self.winWidth/2,40,0,1,1,self.title:getWidth()/2,0) love.graphics.draw(self.began,self.winWidth/2,(self.winHeight/3)+40,0,1,1,self.began:getWidth()/2,self.began:getHeight()/2) love.graphics.draw(self.help,self.winWidth/2,(self.winHeight/3) +180,0,1,1,self.help:getWidth()/2,self.help:getHeight()/2) love.graphics.draw(self.quit,self.winWidth/2,(self.winHeight/3) +320,0,1,1,self.quit:getWidth()/2,self.quit:getHeight()/2) self.snake1:paint() love.graphics.draw(self.xiangji,self.winWidth-200,self.winHeight/2+100) if self.game.isPaly then love.graphics.draw(self.pmusic,self.winWidth-200,self.winHeight/2-100) else love.graphics.draw(self.nmusic,self.winWidth-200,self.winHeight/2-100) end end local i = 0 local dir = {4,2,3,1} local j = 1 local p = 1 function HomeScreen:update(dt) if self.input == "began" then self.game.state = "fight" elseif self.input == "help" then self.game.state = "help" elseif self.input == "changeBg" then self.game.state = "changeBg" elseif self.input == "quit" then self.game.state = "quit" end self.input = "home" if p == 5 then self.snake1:move() if i == 4 then self.snake1:setDirction(dir[j]) j = j + 1 if j == 5 then j = 1 end i = 0 end i = i + 1 p = 0 end p = p + 1 end function HomeScreen:keypressed(key) end function HomeScreen:mousepressed(x,y,button,istouch) if (x > (self.winWidth/2 - 175)) and (x < (self.winWidth/2 + 175)) and (y > ((self.winHeight/3)+40 - 56)) and (y < ((self.winHeight/3)+40 + 56)) then self.input = "began" elseif (x > (self.winWidth/2 - 175)) and (x < (self.winWidth/2 + 175)) and (y > ((self.winHeight/3) +180 - 56)) and (y < ((self.winHeight/3) +180 + 56)) then self.input = "help" elseif x < (self.winWidth-100) and x > self.winWidth-200 and y<self.winHeight/2 +200 and y > self.winHeight/2 +100 then self.input = "changeBg" elseif (x > (self.winWidth/2 - 175)) and (x < (self.winWidth/2 + 175)) and (y > ((self.winHeight/3) +320 - 56)) and (y < ((self.winHeight/3) +320 + 56)) then self.input = "quit" end if x < (self.winWidth-100) and x > self.winWidth-200 and y<self.winHeight/2 and y > self.winHeight/2-100 then if self.game.isPaly == true then self.game.isPaly = false else self.game.isPaly = true end end end function HomeScreen:touchmoved( id, x, y, dx, dy, pressure ) end function HomeScreen:touchpressed( id, x, y, dx, dy, pressure ) if (x > (self.winWidth/2 - 175)) and (x < (self.winWidth/2 + 175)) and (y > ((self.winHeight/3)+40 - 56)) and (y < ((self.winHeight/3)+40 + 56)) then self.input = "began" elseif (x > (self.winWidth/2 - 175)) and (x < (self.winWidth/2 + 175)) and (y > ((self.winHeight/3) +180 - 56)) and (y < ((self.winHeight/3) +180 + 56)) then self.input = "help" elseif (x > (self.winWidth/2 - 175)) and (x < (self.winWidth/2 + 175)) and (y > ((self.winHeight/3) +320 - 56)) and (y < ((self.winHeight/3) +320 + 56)) then self.input = "quit" end end return HomeScreen
GChroma_PlayerModuleLoaded = true util.AddNetworkString( "GChromaPlayerInit" ) local function GChromaPlayerSpawn( ply ) if gchroma then net.Start( "GChromaPlayerInit" ) net.WriteBool( false ) net.Send( ply ) end end hook.Add( "PlayerSpawn", "GChromaPlayerSpawn", GChromaPlayerSpawn ) local function GChromaPlayerInitSpawn( ply ) hook.Add( "SetupMove", ply, function( self, ply, _, cmd ) if self == ply and !cmd:IsForced() then hook.Run( "PlayerFullLoad", self ) hook.Remove( "SetupMove", self ) end end ) end hook.Add( "PlayerInitialSpawn", "GChromaPlayerInitSpawn", GChromaPlayerInitSpawn ) local function GChromaFullyLoaded( ply ) if gchroma then net.Start( "GChromaPlayerInit" ) net.WriteBool( true ) net.Send( ply ) end end hook.Add( "PlayerFullLoad", "GChromaFullyLoaded", GChromaFullyLoaded ) local function GChromaPlayerDeath( ply ) if gchroma then local tbl = { gchroma.ResetDevice( GCHROMA_DEVICE_ALL ), gchroma.SetDeviceColor( GCHROMA_DEVICE_ALL, GCHROMA_COLOR_RED ) } gchroma.SendFunctions( ply, tbl ) end end hook.Add( "PostPlayerDeath", "GChromaPlayerDeath", GChromaPlayerDeath ) util.AddNetworkString( "GChromaNoclip" ) local function GChromaPlayerNoclip( ply, enable ) if gchroma and IsFirstTimePredicted() then --This hook is predicted so it needs to be run server-side in order to work in singleplayer net.Start( "GChromaNoclip" ) net.WriteBool( enable ) net.Send( ply ) end end hook.Add( "PlayerNoClip", "GChromaPlayerNoclip", GChromaPlayerNoclip ) util.AddNetworkString( "GChromaFlashlight" ) local function GChromaFlashlight( ply, enabled ) if gchroma then net.Start( "GChromaFlashlight" ) net.WriteBool( enabled ) net.Send( ply ) end end hook.Add( "PlayerSwitchFlashlight", "GChromaFlashlight", GChromaFlashlight ) util.AddNetworkString( "GChromaUpdateSlots" ) local function GChromaPickupWeapon( weapon, ply ) if gchroma and ply:IsPlayer() then timer.Simple( 0.1, function() net.Start( "GChromaUpdateSlots" ) net.Send( ply ) end ) end end hook.Add( "WeaponEquip", "GChromaPickupWeapon", GChromaPickupWeapon ) local function GChromaDropWeapon( ply, weapon ) if gchroma and ply:IsPlayer() then timer.Simple( 0.1, function() net.Start( "GChromaUpdateSlots" ) net.Send( ply ) end ) end end hook.Add( "PlayerDroppedWeapon", "GChromaPickupWeapon", GChromaPickupWeapon )
BeanConfig = { beans = { ClearSanBoxCacheBean, LoadStaticDataBean, DeployManagersBean, DeployTweenBean, CheckSplashCompleteBean, GaoFangBean, CheckIpSkipBean, CheckBandByAppStoreBean, CheckFixGameStateBean, CheckLoginBean, AfterLoginBean, CheckGameVersionBean, CheckRelogingBean, LoadPicesAsyncBean, CheckInstallGamesBean, CheckIosVerifyBean, FakeLoadingBean, DeployLbsBean, CheckRoomResultBean, CheckModuleStateBean, CheckNewbieBean, BeginGameBean, BeginNewbieBean, CheckGameSilenceDownloadBean, CheckNoticeBean } } return
-- Replace coal with carbon if bobs/angels is on -- Prioritize angels's version -- Rework technology to have a dependency on it
-- plat set_config("plat", os.host()) -- project set_project("co") -- set xmake minimum version set_xmakever("2.2.5") -- set common flags set_languages("c++11") set_optimize("faster") -- faster: -O2 fastest: -O3 none: -O0 set_warnings("all") -- -Wall set_symbols("debug") -- dbg symbols if is_plat("macosx", "linux") then add_cxflags("-g3", "-Wno-narrowing", "-Wno-sign-compare", "-Wno-class-memaccess") if is_plat("macosx") then add_cxflags("-fno-pie") end add_syslinks("pthread", "dl") end if is_plat("windows") then add_defines("_ITERATOR_DEBUG_LEVEL=0") add_cxflags("-MD", "-EHsc") end ---[[ --add_requires("zlib", {optional = true}) add_requires("openssl >=1.1.0", {optional = true}) add_requires("libcurl", {optional = true, configs = {openssl = true, zlib = true}}) if has_package("libcurl") then add_defines("HAS_LIBCURL") add_packages("libcurl") end --if has_package("zlib") then -- add_defines("HAS_ZLIB") -- add_packages("zlib") --end if has_package("openssl") then add_defines("CO_SSL") add_defines("HAS_OPENSSL") add_packages("openssl") end --]] -- include dir add_includedirs("include") -- install header files add_installfiles("(include/**)", {prefixdir = ""}) add_installfiles("*.md", {prefixdir = "include/co"}) -- include sub-projects includes("src", "gen", "test", "unitest")
function greetingScreen() background(156, 222, 193) pushStyle() font("Verdana-BoldItalic") fontSize(fontSize() * 3) button("Hi!") popStyle() button("This is a SimpleButton!") button("It sizes itself to fit any text...") button([[ ...it can even accommodate a text block...]] ) pushStyle() fontSize(fontSize() * 0.9) button([[ ...and you can also manually set the button dimensions if you want.]], nil, WIDTH * 0.7, WIDTH * 0.18 ) popStyle() button("next", function() currentScreen = actionsDemo end) end
local DIR = (...) .. '/' local World = require(DIR .. 'world') local Husk = {} -- initializes new spatial hash map function Husk:newWorld(cell_size) return setmetatable({ cell_size = cell_size or 128, spatial_hash = {} }, World) end return Husk
#!/usr/bin/env luajit -- AUTHOR: Stephen McGill, 2017 -- Usage: ./test_pcan FILENAME.pcap -- Description: Decode CAN messages from ethernet frames captured with the PEAK CAN-Ethernet device --------------- -- Dependencies local ffi = require("ffi") local pcap = require("pcap") local pcan = require("pcan") --------------- -- "tcpdump -i any" implies offset of 44, else 42 local OFFSET0 = 44 local PCAN_SZ = 36 local MAX_SZ = PCAN_SZ * 15 local ID_COUNT = {} local SHOW_COUNT = os.getenv'SHOW_COUNT' if SHOW_COUNT then io.stdout:write('ID', '\t', 'Count', '\t', 'name', '\n') else io.stdout:write('t', '\t', 'ID', '\t', 'DLC', '\n') end local filename = assert(arg[1], 'Please provide a filepath') for t, pkt_n_len in pcap.entries(filename) do local packet, len = unpack(pkt_n_len) packet = packet + OFFSET0 len = len - OFFSET0 for offset=0,len-1,PCAN_SZ do local id, msg, dlc = pcan.decode(packet + offset, PCAN_SZ) if dlc > PCAN_SZ then io.stderr:write(string.format( "Bad PCAN packet size: %d > %d\n", dlc, PCAN_SZ)) else -- Print the ID and message length if not SHOW_COUNT then io.stdout:write(string.format('%f\t0x%03x\t%d\n', t, id, dlc)) end local str = ffi.string(msg, dlc) if id<4096 then ID_COUNT[id] = (ID_COUNT[id] or 0) + 1 else io.stderr:write(string.format("Bad ID [too big]: 0x%x\n", id)) end end end end if SHOW_COUNT then for id,count in pairs(ID_COUNT) do io.stdout:write(string.format('0x%03x\t%d', id, count)) local name = libLexusLS.name[id] if has_lexus and type(name)=='string' then io.stdout:write('\t', name) end io.stdout:write('\n') end end
-- Minetest: builtin/common/chatcommands.lua core.registered_chatcommands = {} function core.register_chatcommand(cmd, def) def = def or {} def.params = def.params or "" def.description = def.description or "" def.privs = def.privs or {} def.mod_origin = core.get_current_modname() or "??" core.registered_chatcommands[cmd] = def end function core.unregister_chatcommand(name) if core.registered_chatcommands[name] then core.registered_chatcommands[name] = nil else core.log("warning", "Not unregistering chatcommand " ..name.. " because it doesn't exist.") end end function core.override_chatcommand(name, redefinition) local chatcommand = core.registered_chatcommands[name] assert(chatcommand, "Attempt to override non-existent chatcommand "..name) for k, v in pairs(redefinition) do rawset(chatcommand, k, v) end core.registered_chatcommands[name] = chatcommand end local cmd_marker = "/" local function gettext(...) return ... end local function gettext_replace(text, replace) return text:gsub("$1", replace) end if INIT == "client" then cmd_marker = "." gettext = core.gettext gettext_replace = fgettext_ne end local function do_help_cmd(name, param) local function format_help_line(cmd, def) local msg = core.colorize("#00ffff", cmd_marker .. cmd) if def.params and def.params ~= "" then msg = msg .. " " .. def.params end if def.description and def.description ~= "" then msg = msg .. ": " .. def.description end return msg end if param == "" then local cmds = {} for cmd, def in pairs(core.registered_chatcommands) do if INIT == "client" or core.check_player_privs(name, def.privs) then cmds[#cmds + 1] = cmd end end table.sort(cmds) return true, gettext("Available commands: ") .. table.concat(cmds, " ") .. "\n" .. gettext_replace("Use '$1help <cmd>' to get more information," .. " or '$1help all' to list everything.", cmd_marker) elseif param == "all" then local cmds = {} for cmd, def in pairs(core.registered_chatcommands) do if INIT == "client" or core.check_player_privs(name, def.privs) then cmds[#cmds + 1] = format_help_line(cmd, def) end end table.sort(cmds) return true, gettext("Available commands:").."\n"..table.concat(cmds, "\n") elseif INIT == "game" and param == "privs" then local privs = {} for priv, def in pairs(core.registered_privileges) do privs[#privs + 1] = priv .. ": " .. def.description end table.sort(privs) return true, "Available privileges:\n"..table.concat(privs, "\n") else local cmd = param local def = core.registered_chatcommands[cmd] if not def then return false, gettext("Command not available: ")..cmd else return true, format_help_line(cmd, def) end end end if INIT == "client" then core.register_chatcommand("help", { params = gettext("[all/<cmd>]"), description = gettext("Get help for commands"), func = function(param) return do_help_cmd(nil, param) end, }) else core.register_chatcommand("help", { params = "[all/privs/<cmd>]", description = "Get help for commands or list privileges", func = do_help_cmd, }) end
local http = require "http" local ipOps = require "ipOps" local stdnse = require "stdnse" local string = require "string" local table = require "table" description = [[ Discovers hostnames that resolve to the target's IP address by querying the online Robtex service at http://ip.robtex.com/. ]] --- -- @usage -- nmap --script hostmap-robtex -sn -Pn scanme.nmap.org -- -- @output -- | hostmap-robtex: -- | hosts: -- |_ scanme.nmap.org -- -- @xmloutput -- <table key="hosts"> -- <elem>nmap.org</elem> -- </table> --- author = "Arturo 'Buanzo' Busleiman" license = "Same as Nmap--See http://nmap.org/book/man-legal.html" categories = { "discovery", "safe", "external" } --- Scrape domains sharing target host ip from robtex website -- @param data string containing the retrieved web page -- @return table containing the host names sharing host.ip function parse_robtex_response (data) local result = {} for domain in string.gmatch(data, "<span id=\"dns[0-9]+\"><a href=\"//[a-z]+.robtex.com/([^\"]-)%.html\"") do if not table.contains(result, domain) then table.insert(result, domain) end end return result end hostrule = function (host) return not ipOps.isPrivate(host.ip) end action = function (host) local link = "http://ip.robtex.com/" .. host.ip .. ".html" local htmldata = http.get_url(link) local domains = parse_robtex_response(htmldata.body) local output_tab = stdnse.output_table() if (#domains > 0) then output_tab.hosts = domains end return output_tab end function table.contains (table, element) for _, value in pairs(table) do if value == element then return true end end return false end
-- ===================================================================== -- -- luasnip.lua - -- -- Created by liubang on 2021/09/04 21:07 -- Last Modified: 2021/09/04 21:07 -- -- ===================================================================== local ls = require 'luasnip' -- some shorthands... local s = ls.snippet local t = ls.text_node local i = ls.insert_node local f = ls.function_node local c = ls.choice_node local fmta = require('luasnip.extras.fmt').fmta local calculate_comment_string = require('Comment.ft').calculate local region = require('Comment.utils').get_region ls.config.setup { history = true, updateevents = 'TextChanged,TextChangedI', delete_check_events = 'TextChanged', ext_opts = {}, } local get_cstring = function(ctype) local cstring = calculate_comment_string { ctype = ctype, range = region() } or '' local cstring_table = vim.split(cstring, '%s', { plain = true, trimempty = true }) if #cstring_table == 0 then return { '', '' } end return #cstring_table == 1 and { cstring_table[1], '' } or { cstring_table[1], cstring_table[2] } end local todo_snippet_nodes = function(aliases, opts) local aliases_nodes = vim.tbl_map(function(alias) return i(nil, alias) end, aliases) -- format them into the actual snippet local comment_node = fmta('<> <>(liubang): <> <>', { f(function() return get_cstring(opts.ctype)[1] end), c(1, aliases_nodes), i(2), f(function() return get_cstring(opts.ctype)[2] end), }) return comment_node end local todo_snippet = function(context, aliases, opts) opts = opts or {} aliases = type(aliases) == 'string' and { aliases } or aliases context = context or {} if not context.trig then return error('context doesn\'t include a `trig` key which is mandatory', 2) end opts.ctype = opts.ctype or 1 local alias_string = table.concat(aliases, '|') context.name = context.name or (alias_string .. ' comment') context.dscr = context.dscr or (alias_string .. ' comment with a signature-mark') local comment_node = todo_snippet_nodes(aliases, opts) return s(context, comment_node, opts) end local todo_snippet_specs = { { { trig = 'todo' }, 'TODO' }, { { trig = 'fix' }, { 'FIX', 'BUG', 'ISSUE', 'FIXIT' } }, { { trig = 'hack' }, 'HACK' }, { { trig = 'warn' }, { 'WARN', 'WARNING', 'XXX' } }, { { trig = 'perf' }, { 'PERF', 'PERFORMANCE', 'OPTIM', 'OPTIMIZE' } }, { { trig = 'note' }, { 'NOTE', 'INFO' } }, { { trig = 'todob' }, 'TODO', { ctype = 2 } }, { { trig = 'fixb' }, { 'FIX', 'BUG', 'ISSUE', 'FIXIT' }, { ctype = 2 } }, { { trig = 'hackb' }, 'HACK', { ctype = 2 } }, { { trig = 'warnb' }, { 'WARN', 'WARNING', 'XXX' }, { ctype = 2 } }, { { trig = 'perfb' }, { 'PERF', 'PERFORMANCE', 'OPTIM', 'OPTIMIZE' }, { ctype = 2 } }, { { trig = 'noteb' }, { 'NOTE', 'INFO' }, { ctype = 2 } }, } local todo_comment_snippets = {} for _, v in ipairs(todo_snippet_specs) do table.insert(todo_comment_snippets, todo_snippet(v[1], v[2], v[3])) end ls.add_snippets('all', todo_comment_snippets, { type = 'snippets', key = 'todo_comments' }) ls.add_snippets('go', { s({ trig = 'main' }, { t { 'func main() {', '\t' }, i(1, '// put your code hare'), t { '', '}' }, }), s({ trig = 'pmain' }, { t { 'package main', '', 'func main() {', '\t' }, i(1, '// put your code hare'), t { '', '}' }, }), }, { type = 'snippets', key = 'go' }) ls.add_snippets('cpp', { s({ trig = 'pmain' }, { t { '#include <iostream>', '', '' }, t { 'int main(int argc, char* argv[]) {', '\t' }, i(1, { '// put your code hare' }), t { '', '\treturn 0;', '}' }, }), s({ trig = 'main' }, { t { 'int main(int argc, char* argv[]) {', '\t' }, i(1, { '// put your code hare' }), t { '', '\treturn 0;', '}' }, }), s({ trig = 'ignore' }, { t { '// clang-format off', '' }, i(1, { '' }), t { '', '// clang-format on' }, }), }, { type = 'snippets', key = 'cpp' }) ls.add_snippets('c', { s({ trig = 'pmain' }, { t { '#include <stdio.h>', '', '' }, t { 'int main(int argc, char* argv[]) {', '\t' }, i(1, { '// put your code hare' }), t { '', '\treturn 0;', '}' }, }), s({ trig = 'main' }, { t { 'int main(int argc, char* argv[]) {', '\t' }, i(1, { '// put your code hare' }), t { '', '\treturn 0;', '}' }, }), }, { type = 'snippets', key = 'c' }) ls.add_snippets('lua', { s({ trig = 'ignore' }, { t '-- stylua: ignore', }), s({ trig = 'fun' }, { t 'function ', i(1, 'function_name'), t { '()', ' ' }, i(0), t { '', 'end' }, }), }, { type = 'snippets', key = 'lua' }) vim.keymap.set({ 'i', 's' }, '<C-n>', function() if ls.choice_active() then ls.change_choice(1) end end) vim.keymap.set({ 'i', 's' }, '<C-p>', function() if ls.choice_active() then ls.change_choice(-1) end end)
--[[ Automatically apply profiles based on runtime conditions. At least mpv 0.21.0 is required. This script queries the list of loaded config profiles, and checks the "profile-desc" field of each profile. If it starts with "cond:", the script parses the string as Lua expression, and evaluates it. If the expression returns true, the profile is applied, if it returns false, it is ignored. Expressions can reference properties by accessing "p". For example, "p.pause" would return the current pause status. If the variable name contains any "_" characters, they are turned into "-". For example, "playback_time" would return the property "playback-time". (Although you can also just write p["playback-time"].) Note that if a property is not available, it will return nil, which can cause errors if used in expressions. These are printed and ignored, and the expression is considered to be false. You can also write e.g. get("playback-time", 0) instead of p.playback_time to default to 0. Whenever a property referenced by a profile condition changes, the condition is re-evaluated. If the return value of the condition changes from false or error to true, the profile is applied. Note that profiles cannot be "unapplied", so you may have to define inverse profiles with inverse conditions do undo a profile. Using profile-desc is just a hack - maybe it will be changed later. Supported --script-opts: auto-profiles: if set to "no", the script disables itself (but will still listen to property notifications etc. - if you set it to "yes" again, it will re-evaluate the current state) Example profiles: # the profile names aren't used (except for logging), but must not clash with # other profiles [test] profile-desc=cond:p.playback_time>10 video-zoom=2 # you would need this to actually "unapply" the "test" profile [test-revert] profile-desc=cond:p.playback_time<=10 video-zoom=0 --]] local utils = require 'mp.utils' local msg = require 'mp.msg' local profiles = {} local watched_properties = {} -- indexed by property name (used as a set) local cached_properties = {} -- property name -> last known raw value local properties_to_profiles = {} -- property name -> set of profiles using it local have_dirty_profiles = false -- at least one profile is marked dirty -- Used during evaluation of the profile condition, and should contain the -- profile the condition is evaluated for. local current_profile = nil local function evaluate(profile) msg.verbose("Re-evaluate auto profile " .. profile.name) current_profile = profile local status, res = pcall(profile.cond) current_profile = nil if not status then -- errors can be "normal", e.g. in case properties are unavailable msg.info("Error evaluating: " .. res) res = false elseif type(res) ~= "boolean" then msg.error("Profile '" .. profile.name .. "' did not return a boolean.") res = false end if res ~= profile.status and res == true then msg.info("Applying profile " .. profile.name) mp.commandv("apply-profile", profile.name) end profile.status = res profile.dirty = false end local function on_property_change(name, val) cached_properties[name] = val -- Mark all profiles reading this property as dirty, so they get re-evaluated -- the next time the script goes back to sleep. local dependent_profiles = properties_to_profiles[name] if dependent_profiles then for profile, _ in pairs(dependent_profiles) do assert(profile.cond) -- must be a profile table profile.dirty = true have_dirty_profiles = true end end end local function on_idle() if mp.get_opt("auto-profiles") == "no" then return end -- When events and property notifications stop, re-evaluate all dirty profiles. if have_dirty_profiles then for _, profile in ipairs(profiles) do if profile.dirty then evaluate(profile) end end end have_dirty_profiles = false end mp.register_idle(on_idle) local evil_meta_magic = { __index = function(table, key) -- interpret everything as property, unless it already exists as -- a non-nil global value local v = _G[key] if type(v) ~= "nil" then return v end -- Lua identifiers can't contain "-", so in order to match with mpv -- property conventions, replace "_" to "-" key = string.gsub(key, "_", "-") -- Normally, we use the cached value only (to reduce CPU usage I guess?) if not watched_properties[key] then watched_properties[key] = true mp.observe_property(key, "native", on_property_change) cached_properties[key] = mp.get_property_native(key) end -- The first time the property is read we need add it to the -- properties_to_profiles table, which will be used to mark the profile -- dirty if a property referenced by it changes. if current_profile then local map = properties_to_profiles[key] if not map then map = {} properties_to_profiles[key] = map end map[current_profile] = true end return cached_properties[key] end, } local evil_magic = {} setmetatable(evil_magic, evil_meta_magic) local function compile_cond(name, s) chunk, err = loadstring("return " .. s, "profile " .. name .. " condition") if not chunk then msg.error("Profile '" .. name .. "' condition: " .. err) return function() return false end end return chunk end for i, v in ipairs(mp.get_property_native("profile-list")) do local desc = v["profile-desc"] if desc and desc:sub(1, 5) == "cond:" then local profile = { name = v.name, cond = compile_cond(v.name, desc:sub(6)), properties = {}, status = nil, dirty = true, -- need re-evaluate } profiles[#profiles + 1] = profile have_dirty_profiles = true end end -- these definitions are for use by the condition expressions p = evil_magic function get(property_name, default) local val = p[property_name] if val == nil then val = default end return val end -- re-evaluate all profiles immediately on_idle()
SB.Include(Path.Join(SB.DIRS.SRC, 'view/editor.lua')) HeightmapEditor = Editor:extends{} HeightmapEditor:Register({ name = "heightmapEditor", tab = "Map", caption = "Terrain", tooltip = "Edit heightmap", image = Path.Join(SB.DIRS.IMG, 'peaks.png'), order = 0, }) function HeightmapEditor:init() self:super("init") self:AddField(AssetField({ name = "patternTexture", title = "Pattern:", rootDir = "brush_patterns/terrain/", expand = true, itemWidth = 65, itemHeight = 65, Validate = function(obj, value) if value == nil then return true end if not AssetField.Validate(obj, value) then return false end local ext = Path.GetExt(value) or "" return table.ifind(SB_IMG_EXTS, ext), value end, Update = function(...) AssetField.Update(...) local texture = self.fields["patternTexture"].value SB.model.terrainManager:generateShape(texture) end })) self.btnAddState = TabbedPanelButton({ x = 0, y = 0, tooltip = "Left Click to add height, Right Click to remove height", children = { TabbedPanelImage({ file = Path.Join(SB.DIRS.IMG, 'up-card.png') }), TabbedPanelLabel({ caption = "Add" }), }, OnClick = { function() SB.stateManager:SetState(TerrainShapeModifyState(self)) end }, }) self.btnSetState = TabbedPanelButton({ x = 70, y = 0, tooltip = "Left Click to set height. Right click to sample height", children = { TabbedPanelImage({ file = Path.Join(SB.DIRS.IMG, 'terrain-set.png') }), TabbedPanelLabel({ caption = "Set" }), }, OnClick = { function() SB.stateManager:SetState(TerrainSetState(self)) end }, }) self.btnSmoothState = TabbedPanelButton({ x = 140, y = 0, tooltip = "Click to smooth terrain", children = { TabbedPanelImage({ file = Path.Join(SB.DIRS.IMG, 'terrain-smooth.png') }), TabbedPanelLabel({ caption = "Smooth" }), }, OnClick = { function() SB.stateManager:SetState(TerrainSmoothState(self)) end }, }) self:AddDefaultKeybinding({ self.btnAddState, self.btnSetState, self.btnSmoothState }) self:AddControl("btn-show-elevation", { Button:New { caption = "Show elevation", width = 200, height = 40, OnClick = { function() Spring.SendCommands('showelevation') end } }, }) self:AddField(NumericField({ name = "size", value = 100, minValue = 10, maxValue = 5000, title = "Size:", tooltip = "Size of the height brush", })) self:AddField(NumericField({ name = "rotation", value = 0, minValue = -360, maxValue = 360, title = "Rotation:", tooltip = "Rotation of the shape", })) self:AddField(NumericField({ name = "strength", value = 10, step = 0.1, title = "Strength:", tooltip = "Strength of the height map tool", })) self:AddField(NumericField({ name = "height", value = 10, step = 0.1, title = "Height:", tooltip = "Goal height", })) self:AddField(ChoiceField({ name = "applyDir", items = {"Both", "Only Raise", "Only Lower"}, tooltip = "Whether terrain should be only lowered, raised or both.", })) self:Update("size") self:SetInvisibleFields("applyDir") local children = { self.btnAddState, self.btnSetState, self.btnSmoothState, ScrollPanel:New { x = 0, y = 70, bottom = 30, right = 0, borderColor = {0,0,0,0}, horizontalScrollbar = false, children = { self.stackPanel }, }, } self:Finalize(children) end function HeightmapEditor:OnLeaveState(state) for _, btn in pairs({self.btnAddState, self.btnSmoothState, self.btnSetState}) do btn:SetPressedState(false) end end function HeightmapEditor:OnEnterState(state) local btn if state:is_A(TerrainShapeModifyState) then self:SetInvisibleFields("applyDir") btn = self.btnAddState elseif state:is_A(TerrainSetState) then self:SetInvisibleFields() btn = self.btnSetState elseif state:is_A(TerrainSmoothState) then self:SetInvisibleFields("applyDir") btn = self.btnSmoothState end btn:SetPressedState(true) end function HeightmapEditor:IsValidState(state) return state:is_A(AbstractHeightmapEditingState) end
local this = Class.inherit(DecoSolid) function this:new(color, size) DecoSolid.new(self, color) self.size = size end function this:draw(screen, widget) if self.color ~= nil and widget.rect ~= nil then local r = widget.rect r = sdl.rect(r.x, r.y, r.w, r.h) if self.size then r.w = self.size.w r.h = self.size.h end r.x = r.x + widget.decorationx r.y = r.y + widget.decorationy screen:drawrect(self.color, r) end end return this
--Minetest --Copyright (C) 2013 sapier -- --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.1 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. -------------------------------------------------------------------------------- local function get_formspec(tabview, name, tabdata) -- Update the cached supported proto info, -- it may have changed after a change by the settings menu. common_update_cached_supp_proto() local fav_selected = menudata.favorites[tabdata.fav_selected] local retval = "label[9.5,0;".. fgettext("Name / Password") .. "]" .. "field[0.25,3.35;5.5,0.5;te_address;;" .. core.formspec_escape(core.settings:get("address")) .."]" .. "field[5.75,3.35;2.25,0.5;te_port;;" .. core.formspec_escape(core.settings:get("remote_port")) .."]" .. "button[10,2.6;2,1.5;btn_mp_connect;".. fgettext("Connect") .. "]" .. "field[9.8,1;2.6,0.5;te_name;;" .. core.formspec_escape(core.settings:get("name")) .."]" .. "pwdfield[9.8,2;2.6,0.5;te_pwd;]" if tabdata.fav_selected and fav_selected then if gamedata.fav then retval = retval .. "button[7.7,2.6;2.3,1.5;btn_delete_favorite;" .. fgettext("Del. Favorite") .. "]" end end retval = retval .. "tablecolumns[" .. image_column(fgettext("Favorite"), "favorite") .. ";" .. image_column(fgettext("Ping"), "") .. ",padding=0.25;" .. "color,span=3;" .. "text,align=right;" .. -- clients "text,align=center,padding=0.25;" .. -- "/" "text,align=right,padding=0.25;" .. -- clients_max image_column(fgettext("Creative mode"), "creative") .. ",padding=1;" .. image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" .. image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" .. "color,span=1;" .. "text,padding=1]" .. -- name "table[-0.05,0;9.2,2.75;favourites;" if #menudata.favorites > 0 then local favs = core.get_favorites("local") if #favs > 0 then for i = 1, #favs do for j = 1, #menudata.favorites do if menudata.favorites[j].address == favs[i].address and menudata.favorites[j].port == favs[i].port then table.insert(menudata.favorites, i, table.remove(menudata.favorites, j)) end end if favs[i].address ~= menudata.favorites[i].address then table.insert(menudata.favorites, i, favs[i]) end end end retval = retval .. render_serverlist_row(menudata.favorites[1], (#favs > 0)) for i = 2, #menudata.favorites do retval = retval .. "," .. render_serverlist_row(menudata.favorites[i], (i <= #favs)) end end if tabdata.fav_selected then retval = retval .. ";" .. tabdata.fav_selected .. "]" else retval = retval .. ";0]" end -- separator retval = retval .. "box[-0.28,3.75;12.4,0.1;#FFFFFF]" -- checkboxes retval = retval .. "checkbox[8.0,3.9;cb_creative;".. fgettext("Creative Mode") .. ";" .. dump(core.settings:get_bool("creative_mode")) .. "]".. "checkbox[8.0,4.4;cb_damage;".. fgettext("Enable Damage") .. ";" .. dump(core.settings:get_bool("enable_damage")) .. "]" -- buttons retval = retval .. "button[0,3.7;8,1.5;btn_start_singleplayer;" .. fgettext("Start Singleplayer") .. "]" .. "button[0,4.5;8,1.5;btn_config_sp_world;" .. fgettext("Config mods") .. "]" return retval end -------------------------------------------------------------------------------- local function main_button_handler(tabview, fields, name, tabdata) if fields.btn_start_singleplayer then gamedata.selected_world = gamedata.worldindex gamedata.singleplayer = true core.start() return true end if fields.favourites then local event = core.explode_table_event(fields.favourites) if event.type == "CHG" then if event.row <= #menudata.favorites then gamedata.fav = false local favs = core.get_favorites("local") local fav = menudata.favorites[event.row] local address = fav.address local port = fav.port gamedata.serverdescription = fav.description for i = 1, #favs do if fav.address == favs[i].address and fav.port == favs[i].port then gamedata.fav = true end end if address and port then core.settings:set("address", address) core.settings:set("remote_port", port) end tabdata.fav_selected = event.row end return true end end if fields.btn_delete_favorite then local current_favourite = core.get_table_index("favourites") if not current_favourite then return end core.delete_favorite(current_favourite) asyncOnlineFavourites() tabdata.fav_selected = nil core.settings:set("address", "") core.settings:set("remote_port", "30000") return true end if fields.cb_creative then core.settings:set("creative_mode", fields.cb_creative) return true end if fields.cb_damage then core.settings:set("enable_damage", fields.cb_damage) return true end if fields.btn_mp_connect or fields.key_enter then gamedata.playername = fields.te_name gamedata.password = fields.te_pwd gamedata.address = fields.te_address gamedata.port = fields.te_port local fav_idx = core.get_textlist_index("favourites") if fav_idx and fav_idx <= #menudata.favorites and menudata.favorites[fav_idx].address == fields.te_address and menudata.favorites[fav_idx].port == fields.te_port then local fav = menudata.favorites[fav_idx] gamedata.servername = fav.name gamedata.serverdescription = fav.description if menudata.favorites_is_public and not is_server_protocol_compat_or_error( fav.proto_min, fav.proto_max) then return true end else gamedata.servername = "" gamedata.serverdescription = "" end gamedata.selected_world = 0 core.settings:set("address", fields.te_address) core.settings:set("remote_port", fields.te_port) core.start() return true end if fields.btn_config_sp_world then local configdialog = create_configure_world_dlg(1) if configdialog then configdialog:set_parent(tabview) tabview:hide() configdialog:show() end return true end end -------------------------------------------------------------------------------- local function on_activate(type,old_tab,new_tab) if type == "LEAVE" then return end asyncOnlineFavourites() end -------------------------------------------------------------------------------- return { name = "main", caption = fgettext("Main"), cbf_formspec = get_formspec, cbf_button_handler = main_button_handler, on_change = on_activate }
-- Huntpad extension pack for the Sandcat Browser Huntpad = extensionpack:new() Huntpad.filename = 'Huntpad.scx' function Huntpad:init() end function Huntpad:afterinit() self:dofile('quickinject/quickinject.lua') quickinject:add() end
MySQL.createCommand("vRP/sell_vehicle_player","UPDATE vrp_user_vehicles SET user_id = @user_id, vehicle_plate = @registration WHERE user_id = @oldUser AND vehicle = @vehicle") -- sell vehicle veh_actions[lang.vehicle.sellTP.title()] = {function(playerID,player,vtype,name) if playerID ~= nil then vRPclient.getNearestPlayers(player,{15},function(nplayers) usrList = "" for k,v in pairs(nplayers) do usrList = usrList .. "[" .. vRP.getUserId(k) .. "]" .. GetPlayerName(k) .. " | " end if usrList ~= "" then vRP.prompt(player,"Players Nearby: " .. usrList .. "","",function(player,user_id) user_id = user_id if user_id ~= nil and user_id ~= "" then local target = vRP.getUserSource(tonumber(user_id)) if target ~= nil then vRP.prompt(player,"Price $: ","",function(player,amount) if (tonumber(amount)) and (tonumber(amount) > 0) then MySQL.query("vRP/get_vehicle", {user_id = user_id, vehicle = name}, function(pvehicle, affected) if #pvehicle > 0 then vRPclient.notify(player,{"~r~The player already has this vehicle type."}) else local tmpdata = vRP.getUserTmpTable(playerID) if tmpdata.rent_vehicles[name] == true then vRPclient.notify(player,{"~r~You cannot sell a rented vehicle!"}) return else vRP.request(target,GetPlayerName(player).." wants to sell: " ..name.. " Price: $"..amount, 10, function(target,ok) if ok then local pID = vRP.getUserId(target) local money = vRP.getMoney(pID) if (tonumber(money) >= tonumber(amount)) then vRPclient.despawnGarageVehicle(player,{vtype,15}) vRP.getUserIdentity(pID, function(identity) MySQL.execute("vRP/sell_vehicle_player", {user_id = user_id, registration = "P "..identity.registration, oldUser = playerID, vehicle = name}) end) vRP.giveMoney(playerID, amount) vRP.setMoney(pID,money-amount) vRPclient.notify(player,{"~g~You have successfully sold the vehicle to ".. GetPlayerName(target).." for $"..amount.."!"}) vRPclient.notify(target,{"~g~"..GetPlayerName(player).." has successfully sold you the car for $"..amount.."!"}) else vRPclient.notify(player,{"~r~".. GetPlayerName(target).." doesn't have enough money!"}) vRPclient.notify(target,{"~r~You don't have enough money!"}) end else vRPclient.notify(player,{"~r~"..GetPlayerName(target).." has refused to buy the car."}) vRPclient.notify(target,{"~r~You have refused to buy "..GetPlayerName(player).."'s car."}) end end) end vRP.closeMenu(player) end end) else vRPclient.notify(player,{"~r~The price of the car has to be a number."}) end end) else vRPclient.notify(player,{"~r~That ID seems invalid."}) end else vRPclient.notify(player,{"~r~No player ID selected."}) end end) else vRPclient.notify(player,{"~r~No player nearby."}) end end) end end, lang.vehicle.sellTP.description()}
require('replserver') visit_count = 0 function serve_index(conn) visit_count = visit_count + 1 s = '<html><head><title>Hello, World</title></head><body>' .. '<h1>Simple nodemcu page</h1>' .. '<br>visits: ' .. visit_count .. '<br>heap: ' .. node.heap() .. '<br>time: ' .. tmr.time() .. '</body></html>' sendstring(conn, s) end start_server(function(conn, payload) if http_match('GET', '/', payload) then serve_index(conn) else basic_response(conn, 'Not much here...') end end)
local cell = require "cell" cell.command { ping = function() cell.sleep(1) return "pong" end } function cell.main(...) print("pingpong launched") return ... end
include "freetype" include "glew" include "binpack" include "jsoncpp" include "stb_image" include "sdl2" include "lua"
table.insert(data.raw["lab"]["lab"].inputs, "research-data") table.insert(data.raw["technology"]["nuclear-fuel-reprocessing"].prerequisites, "uranium-processing") data.raw["technology"]["uranium-processing"].prerequisites = {"graphite-fuel-reprocessing"} data.raw["technology"]["nuclear-power"].prerequisites = {"graphite-processing"}
-- Controllers local edit_task_description = require "src.controller.edit_task_description" return function(parser) local edit_task_parser = parser:command("edit-task-description") edit_task_parser:summary("Edit the description of a specific task") edit_task_parser :argument("id", "Id of the task to edit") :convert(tonumber) edit_task_parser :argument("description", "The new description for the task") edit_task_parser:action(function(args, name) local _, err = edit_task_description(args.id, args.description) if err then print(err) end end) end
local status = nil Citizen.CreateThread(function() while true do Citizen.Wait(1) local playerId = PlayerId() local ped = PlayerPedId() local health = GetEntityHealth(ped) local armor = GetPedArmour(ped) local show = IsPauseMenuActive() Wait(250) SendNUIMessage({ show = IsPauseMenuActive(), health = (GetEntityHealth(PlayerPedId())-100), heal = health, armor = armor }) end end) Heal = false RegisterCommand('heal', function(source, args, rawCommand) if Heal == false then notify("~g~Healed") SetEntityHealth(GetPlayerPed(-1), 200) Heal = true Wait(1) Heal = false end if Heal == true then notify("~r~ You have to wait 5 minutes since the last use of this command") end end) Armor = false RegisterCommand('armour', function(source, args, rawCommand) if Armor == false then notify("~b~60% armour applied - Wait 5 mins to apply again") AddArmourToPed(GetPlayerPed(-1), 200) Armor = true Wait(1) Armor = false end if Armor == true then notify("~r~ You have to wait 5 minutes since the last use of this command") end end) function notify(msg) SetNotificationTextEntry("STRING") AddTextComponentString(msg) DrawNotification(true,false) end
-- ====================================================================== -- Corruption Checksum -- Advent of Code 2017 Day 02 -- Eric Wastl -- https://adventofcode.com -- -- lua implementation by Dr. Dean Earl Wright III -- ====================================================================== -- ====================================================================== -- c h e c k s u m . l u a -- ====================================================================== -- A solver for the Advent of Code 2017 Day 02 puzzle -- ---------------------------------------------------------------------- -- local -- ---------------------------------------------------------------------- local Checksum = { part2 = false, text = {}, rows = {} } -- ---------------------------------------------------------------------- -- constants -- ---------------------------------------------------------------------- -- ====================================================================== -- Checksum -- ====================================================================== -- Object for Corruption Checksum function Checksum:Checksum (o) -- 1. Set the initial values o = o or {} o.part2 = o.part2 or false o.text = o.text or {} o.rows = {} -- 2. Create the object metatable self.__index = self setmetatable(o, self) -- 3. Process text (if any) if o.text ~= nil and #o.text > 0 then o:_process_text(o.text) end return o end function Checksum:_process_text(text) -- Assign values from text -- 0. Precondition axioms assert(text ~= nil and #text > 0) -- 1. Loop for each line of the text for _, line in ipairs(text) do -- 2. Start a new row row = {} -- 3. Split up the row for num in string.gmatch(line, "[0-9]+") do -- 4. Add number to the row table.insert(row, tonumber(num)) end -- 5. Add the row of numbers table.insert(self.rows, row) end end function Checksum:row_min_max_diff(num) -- Returns the minimum and maximum of the specified row -- 1. Get the specified row row = self.rows[num] -- 2. Start with first value row_min = row[1] row_max = row[1] -- 3. Loop for the values in the row for indx = 2, #row do value = row[indx] -- 4. If higher or lower than saved values, set new value if value < row_min then row_min = value end if value > row_max then row_max = value end end -- 4 Return the difference between the minimum and maximum values of the row return row_max - row_min end function Checksum:row_div_even(num) -- Returns the result of dividing two numbers in the row evenly -- 1. Get the specified row row = self.rows[num] -- 2. Loop for all of the numbers in the row for indx, value in ipairs(row) do -- 3. Loop for all of the rest of the numbers in the row for indx2 = indx + 1, #row do value2 = row[indx2] -- 4. If they divide evenly, return the result if value > value2 and value % value2 == 0 then return value // value2 end if value2 > value and value2 % value == 0 then return value2 // value end end end -- 5. I was told that this wouldn't happen return nil end function Checksum:total() -- Returns the total of the row checksums -- 1. Start with nothing result = 0 -- 2. Loop for all of the rows for indx = 1, #self.rows do -- 3. Get the checksum for the row if self.part2 then chk = self:row_div_even(indx) else chk = self:row_min_max_diff(indx) end -- 4. Add it to the running total result = result + chk end -- 5. Return the total checksum return result end function Checksum:part_one(args) -- Returns the solution for part one -- 0. Precondition axioms local verbose = args.verbose or false local limit = args.limit or 0 assert(verbose == true or verbose == false) assert(limit >= 0) -- 1. Return the solution for part one return self:total() end function Checksum:part_two(args) -- Returns the solution for part two -- 0. Precondition axioms local verbose = args.verbose or false local limit = args.limit or 0 assert(verbose == true or verbose == false) assert(limit >= 0) -- 1. Return the solution for part two return self:total() end -- ---------------------------------------------------------------------- -- module initialization -- ---------------------------------------------------------------------- return Checksum -- ====================================================================== -- end c h e c k s u m . l u a end -- ======================================================================
--[[--ldoc desc @Module HomeScene.lua @Author JrueZhu Date: 2018-10-18 18:17:51 Last Modified by JrueZhu Last Modified time 2018-11-01 20:46:02 ]] local appPath = "app.demo.JrueZhu" local HomeScene = class("HomeScene", cc.load("mvc").ViewBase) local ClockCountDown = require(appPath .. ".widget.ClockCountDown") local function createBackground() local visiblieSize = cc.Director:getInstance():getVisibleSize() local background1 = cc.Sprite:create("Images/JrueZhu/background.png"); local spriteContentSize = background1:getTextureRect() background1:setPosition(visiblieSize.width/2, visiblieSize.height/2) background1:setScaleX(visiblieSize.width/spriteContentSize.width) background1:setScaleY(visiblieSize.height/spriteContentSize.height) local background2 = cc.Sprite:create("Images/JrueZhu/background.png"); local spriteContentSize = background2:getTextureRect() background2:setPosition(visiblieSize.width/2, background1:getContentSize().height - 2) background2:setScaleX(visiblieSize.width/spriteContentSize.width) background2:setScaleY(visiblieSize.height/spriteContentSize.height) -- 背景滚动 local function backgroundMove() background1:setPositionY(background1:getPositionY()-2) background2:setPositionY(background1:getPositionY() + background1:getContentSize().height - 2) if background2:getPositionY() == 0 then background1:setPositionY(0) end end local backgroundEntry = cc.Director:getInstance():getScheduler():scheduleScriptFunc(backgroundMove, 0.01, false) return background1, background2, backgroundEntry; end -- FIXME: local function createTitle() -- local title = cc.Label:createWithSystemFont("跳怪消星", "Arial", 30); local title = cc.Label:create(); title:setString("跳怪消星"); title:move(display.cx, display.cy + 50); return title; end local function createPlayBtn(backgroundEntry) local button = ccui.Button:create("Images/JrueZhu/btn_play.png", "", "", 0); button:move(display.cx, display.cy - 100) button:addTouchEventListener(function(sender, eventType) if (ccui.TouchEventType.began == eventType) then print("pressed") local playScene = require("PlayScene.lua") -- local playScene = self:getApp():getSceneWithName("PlayScene"); print("playScene------>", playScene) local transition = cc.TransitionTurnOffTiles:create( 0.5, playScene) cc.Director:getInstance():replaceScene(transition); -- 同时取消滚动 cc.Director:getInstance():getScheduler():unscheduleScriptEntry(backgroundEntry) elseif (ccui.TouchEventType.moved == eventType) then print("move") elseif (ccui.TouchEventType.ended == eventType) then print("up") elseif (ccui.TouchEventType.canceled == eventType) then print("cancel") end end) return button; end local function createCard() local frameCache = cc.SpriteFrameCache:getInstance(); frameCache:addSpriteFrames("Images/JrueZhu/CardResource/cards.plist") local bg = cc.Sprite:createWithSpriteFrameName("bg.png"); local bgHeight = bg:getContentSize().height; local bgWidth = bg:getContentSize().width; local valueImage = cc.Sprite:createWithSpriteFrameName("black_1.png"); print("valueImage------>", valueImage) valueImage:setAnchorPoint(0, 1); valueImage:setPosition(10, bgHeight - 10); local valueImageWith = valueImage:getContentSize().width; local valueImageHeight = valueImage:getContentSize().height; bg:addChild(valueImage); local smallTypeImage = cc.Sprite:createWithSpriteFrameName("color_2_small.png"); smallTypeImage:setAnchorPoint(0, 1); smallTypeImage:setPosition(10, bgHeight - valueImageHeight - 15); bg:addChild(smallTypeImage); local typeImage = cc.Sprite:createWithSpriteFrameName("color_2.png"); typeImage:setAnchorPoint(0.5, 0.5); typeImage:setPosition(bgWidth/2, bgHeight/2); bg:addChild(typeImage); return bg; end local function main() -- 创建主场景 local scene = cc.Scene:create() -- add moveable background -- local background1, background2, backgroundEntry = createBackground(); -- scene:addChild(background1); -- scene:addChild(background2); -- -- add play label -- scene:addChild(createTitle()); -- -- add play button -- scene:addChild(createPlayBtn(backgroundEntry)); -- scene:addChild(createCard()) local clock = ClockCountDown:create({timer = 60}):move(display.center); clock.timer = 10; clock:setTimeEndListener(function() dump("timeout!!!!") end) scene:addChild(clock); return scene; end return main;
AddCSLuaFile() local DbgPrint = GetLogging("MapScript") local MAPSCRIPT = {} MAPSCRIPT.PlayersLocked = false MAPSCRIPT.DefaultLoadout = { Weapons = { }, Ammo = { }, Armor = 0, HEV = false, } MAPSCRIPT.InputFilters = { } MAPSCRIPT.EntityFilterByClass = { --["env_global"] = true, } MAPSCRIPT.EntityFilterByName = { --["spawnitems_template"] = true, } function MAPSCRIPT:Init() end function MAPSCRIPT:PostInit() if SERVER then ents.WaitForEntityByName("goingdown", function(ent) ent:Spawn() end) GAMEMODE:WaitForInput("upper1", "InPass", function(ent) local goingdown = ents.FindFirstByName("goingdown") local train = ents.FindFirstByName("train") util.RunDelayed(function() if not IsValid(goingdown) or not IsValid(train) then return end goingdown:Input("Trigger", train, train) print("Forcing down", train) end, CurTime() + 2) end) end end function MAPSCRIPT:PostPlayerSpawn(ply) -- Failsafe: Make sure players are in the train ents.WaitForEntityByName("train", function(ent) local pos = ent:LocalToWorld(Vector(50, 40, 8)) local ang = ent:LocalToWorldAngles(Angle(0, 0, 0)) ply:TeleportPlayer(pos, ang) end) end return MAPSCRIPT
return {uvs={{0.534295,0.778521},{0.505379,0.771177},{0.505379,0.716352},{0.549035,0.710684},{0.505379,0.640037},{0.573205,0.805778},{0.546929,0.640053},{0.505379,0.563295},{0.597284,0.701878},{0.599466,0.787245},{0.598917,0.845258},{0.546929,0.56663},{0.505379,0.501191},{0.652979,0.823669},{0.611185,0.893659},{0.650507,0.76702},{0.596887,0.636767},{0.650416,0.6957},{0.596048,0.56663},{0.649729,0.634566},{0.594873,0.502423},{0.649271,0.56663},{0.648844,0.502423},{0.546929,0.502423},{0.594873,0.493022},{0.546929,0.493022},{0.593561,0.418905},{0.648844,0.493022},{0.505379,0.491484},{0.546929,0.418905},{0.505379,0.42194},{0.505379,0.336215},{0.546929,0.336215},{0.505379,0.255515},{0.546929,0.255515},{0.593561,0.336215},{0.593561,0.255515},{0.648493,0.255515},{0.648493,0.418905},{0.648493,0.336215},{0.702678,0.255515},{0.702678,0.493022},{0.702678,0.502423},{0.702678,0.418905},{0.702678,0.336215},{0.749996,0.255515},{0.749996,0.336215},{0.749996,0.418884},{0.79733,0.336215},{0.79733,0.255515},{0.79733,0.418905},{0.851499,0.336215},{0.851499,0.255515},{0.79733,0.493022},{0.906447,0.336215},{0.906447,0.255515},{0.953079,0.255515},{0.851499,0.418905},{0.953079,0.336215},{0.994614,0.255515},{0.994614,0.336215},{0.906447,0.418905},{0.953079,0.418905},{0.994614,0.42194},{0.994614,0.491484},{0.953079,0.493022},{0.851148,0.493022},{0.905135,0.493022},{0.953079,0.502423},{0.994614,0.501191},{0.953079,0.56663},{0.905135,0.502423},{0.994614,0.563295},{0.851148,0.502423},{0.90396,0.56663},{0.953079,0.640053},{0.994614,0.640037},{0.850736,0.56663},{0.79733,0.502423},{0.903121,0.636767},{0.950973,0.710684},{0.994614,0.716352},{0.994614,0.771177},{0.965713,0.778521},{0.926787,0.805778},{0.902724,0.701878},{0.900527,0.787245},{0.901091,0.845258},{0.849577,0.6957},{0.847013,0.823669},{0.849485,0.76702},{0.888808,0.893659},{0.850263,0.634566},{0.79733,0.7592},{0.79733,0.56663},{0.79733,0.692808},{0.79733,0.631263},{0.749996,0.502407},{0.749996,0.493001},{0.749996,0.56663},{0.702678,0.56663},{0.749996,0.631263},{0.702678,0.631263},{0.749996,0.692808},{0.702678,0.692808},{0.749996,0.758329},{0.702678,0.7592},{0.749996,0.8181},{0.703395,0.8181},{0.796597,0.8181},{0.749996,0.871085},{0.70489,0.874995},{0.795117,0.874995},{0.660334,0.881238},{0.749996,0.905653},{0.709819,0.907263},{0.673701,0.92016},{0.839658,0.881238},{0.790188,0.907263},{0.749996,0.933435},{0.826291,0.92016},{0.71751,0.937887},{0.782483,0.937887},{0.749996,0.961825},{0.724544,0.964536},{0.775448,0.964536},{0.689662,0.953561},{0.70959,0.973638},{0.810346,0.953561},{0.790402,0.973638},{0.845182,0.939235},{0.888808,0.929837},{0.888808,0.966228},{0.825773,0.981754},{0.798337,0.987307},{0.858213,0.973457},{0.859587,0.996606},{0.888808,0.996606},{0.826047,0.996606},{0.799191,0.996606},{0.67422,0.981754},{0.701671,0.987307},{0.700816,0.996606},{0.673961,0.996606},{0.640421,0.996606},{0.65481,0.939235},{0.611185,0.929837},{0.611185,0.966228},{0.611185,0.996606},{0.641779,0.973457},{0.494728,0.253884},{0.494728,0.335835},{0.44921,0.253884},{0.44921,0.335835},{0.397803,0.253884},{0.44921,0.422887},{0.494728,0.422887},{0.494728,0.493508},{0.397803,0.335835},{0.350454,0.253884},{0.397803,0.422887},{0.44921,0.493508},{0.44921,0.501911},{0.494728,0.501911},{0.494728,0.563834},{0.350439,0.335835},{0.296864,0.253884},{0.449195,0.563834},{0.494728,0.640353},{0.397803,0.493508},{0.397803,0.501911},{0.350439,0.422887},{0.297887,0.335835},{0.250004,0.253884},{0.298894,0.422866},{0.350668,0.493508},{0.250004,0.335835},{0.350668,0.501911},{0.397803,0.563834},{0.202121,0.335835},{0.203143,0.253884},{0.250004,0.422887},{0.149554,0.335835},{0.149554,0.253884},{0.201114,0.422866},{0.300801,0.493508},{0.10219,0.335835},{0.10219,0.253884},{0.300801,0.501911},{0.350088,0.563834},{0.050797,0.335835},{0.050782,0.253884},{0.00528,0.253884},{0.00528,0.335835},{0.102205,0.422887},{0.050797,0.422887},{0.00528,0.422887},{0.00528,0.493508},{0.050797,0.493508},{0.00528,0.501911},{0.050797,0.501911},{0.00528,0.563834},{0.149554,0.422887},{0.102205,0.493508},{0.050797,0.563834},{0.102205,0.501911},{0.00528,0.640353},{0.149325,0.493508},{0.102205,0.563834},{0.149325,0.501911},{0.050797,0.635996},{0.00528,0.716447},{0.199191,0.493508},{0.149905,0.563834},{0.199191,0.501911},{0.102205,0.631524},{0.051972,0.708321},{0.00528,0.771112},{0.050477,0.787199},{0.102205,0.698787},{0.150652,0.628411},{0.097688,0.765084},{0.084123,0.810134},{0.100984,0.834673},{0.150927,0.692578},{0.152804,0.755009},{0.200137,0.563834},{0.200046,0.627445},{0.250004,0.501911},{0.250004,0.493508},{0.250004,0.563834},{0.299855,0.563834},{0.250004,0.626445},{0.299947,0.627445},{0.34934,0.628411},{0.198779,0.687697},{0.301213,0.687697},{0.250004,0.687697},{0.197574,0.750881},{0.349065,0.692578},{0.302419,0.750881},{0.347189,0.755009},{0.397788,0.698787},{0.250004,0.749505},{0.402319,0.765084},{0.346807,0.808987},{0.399008,0.834673},{0.415885,0.810134},{0.449515,0.787199},{0.389013,0.882328},{0.448035,0.708321},{0.494728,0.771112},{0.494728,0.716447},{0.397788,0.631524},{0.449195,0.635996},{0.342748,0.873842},{0.389181,0.946331},{0.302556,0.801484},{0.359533,0.995886},{0.388952,0.995886},{0.250004,0.79978},{0.349081,0.963712},{0.326238,0.995886},{0.334112,0.928787},{0.323354,0.973296},{0.299275,0.995886},{0.298436,0.981716},{0.313893,0.953375},{0.294011,0.971821},{0.294011,0.912896},{0.29015,0.937256},{0.283528,0.964024},{0.250004,0.932472},{0.250004,0.960698},{0.21648,0.964024},{0.299306,0.86801},{0.250004,0.864046},{0.250004,0.907933},{0.209842,0.937256},{0.205982,0.971821},{0.205982,0.912896},{0.186114,0.953375},{0.201556,0.981716},{0.200702,0.86801},{0.176638,0.973296},{0.200732,0.995886},{0.173754,0.995886},{0.165881,0.928787},{0.150927,0.963712},{0.140475,0.995886},{0.110826,0.946331},{0.111055,0.995886},{0.15726,0.873842},{0.110979,0.882328},{0.197452,0.801484},{0.153185,0.808987},{0.484403,0.000929},{0.46036,0.00093},{0.484405,0.041111},{0.460362,0.041112},{0.484406,0.072877},{0.44778,0.041113},{0.447603,0.000931},{0.460363,0.072878},{0.423803,0.041114},{0.423691,0.000933},{0.376725,0.000935},{0.448023,0.072879},{0.460409,0.121298},{0.484408,0.121297},{0.423892,0.07288},{0.447937,0.121299},{0.460409,0.239052},{0.460367,0.195939},{0.484408,0.239053},{0.447937,0.239051},{0.48441,0.19594},{0.423982,0.121301},{0.460369,0.163971},{0.484412,0.163972},{0.484414,0.117619},{0.447808,0.195938},{0.423982,0.23905},{0.460371,0.117617},{0.484416,0.072023},{0.447699,0.163925},{0.460373,0.072022},{0.484418,0.042699},{0.447548,0.117617},{0.42394,0.195937},{0.423964,0.163854},{0.447506,0.072021},{0.460375,0.042697},{0.48442,0.003814},{0.4239,0.117615},{0.447376,0.042697},{0.42388,0.07202},{0.375065,0.163691},{0.374847,0.117613},{0.375217,0.195934},{0.323092,0.163504},{0.375368,0.239047},{0.3232,0.195931},{0.32333,0.239045},{0.376223,0.072883},{0.375368,0.121303},{0.323877,0.072886},{0.32333,0.121306},{0.376287,0.041117},{0.324422,0.000938},{0.324029,0.04112},{0.301631,0.00094},{0.301085,0.072888},{0.301259,0.041121},{0.280508,0.000941},{0.300648,0.121308},{0.300648,0.239043},{0.280006,0.072889},{0.28018,0.041122},{0.217117,0.000945},{0.300562,0.19593},{0.279679,0.121309},{0.279679,0.239042},{0.216989,0.072892},{0.217009,0.041126},{0.155264,0.000948},{0.155265,0.04113},{0.100875,0.000951},{0.155267,0.072896},{0.097408,0.041133},{0.06357,0.000954},{0.048312,0.04154},{0.216705,0.121313},{0.091635,0.0729},{0.155269,0.121316},{0.216705,0.239039},{0.279593,0.195929},{0.155269,0.239036},{0.216664,0.195926},{0.300476,0.163411},{0.279529,0.163341},{0.32305,0.11761},{0.3005,0.117609},{0.374608,0.072017},{0.322965,0.072015},{0.423882,0.042695},{0.374258,0.042693},{0.423862,0.003811},{0.447422,0.003812},{0.37437,0.003808},{0.460376,0.003813},{0.322768,0.04269},{0.48442,0.126662},{0.460376,0.126664},{0.460378,0.165581},{0.484421,0.16558},{0.447422,0.126664},{0.447533,0.165582},{0.423688,0.16556},{0.423862,0.126665},{0.447601,0.206157},{0.460402,0.206156},{0.484423,0.206155},{0.484425,0.245563},{0.460382,0.245564},{0.447625,0.245565},{0.423713,0.245566},{0.42369,0.206181},{0.376747,0.245569},{0.376723,0.206231},{0.324445,0.245571},{0.37615,0.165539},{0.37437,0.126668},{0.324443,0.20628},{0.301653,0.245573},{0.324133,0.165519},{0.301695,0.206305},{0.28053,0.245574},{0.322858,0.126671},{0.322858,0.003805},{0.301496,0.16552},{0.280572,0.206329},{0.21714,0.245577},{0.300418,0.126672},{0.217138,0.206402},{0.155286,0.24558},{0.280439,0.165498},{0.155284,0.206476},{0.100898,0.245583},{0.21696,0.165478},{0.048045,0.204522},{0.063592,0.245585},{0.096438,0.205359},{0.155282,0.165458},{0.27958,0.126673},{0.216343,0.126677},{0.092155,0.165601},{0.05676,0.165603},{0.034956,0.166981},{0.15528,0.12668},{0.088376,0.126684},{0.0505,0.126686},{0.023032,0.126687},{0.15528,0.003796},{0.155278,0.042681},{0.088376,0.003793},{0.216343,0.0038},{0.023032,0.003789},{0.0505,0.003791},{0.044768,0.042675},{0.01361,0.042674},{0.085191,0.042678},{0.040704,0.072},{0.008669,0.067172},{0.006273,0.117593},{0.038638,0.117595},{0.007149,0.148871},{0.08363,0.072002},{0.155277,0.072006},{0.083628,0.117597},{0.039426,0.163949},{0.009278,0.184056},{0.21632,0.042684},{0.27958,0.003803},{0.043113,0.195916},{0.012878,0.195915},{0.024447,0.242936},{0.279513,0.042688},{0.300418,0.003804},{0.21645,0.072009},{0.155275,0.117601},{0.300328,0.042689},{0.279599,0.072012},{0.300458,0.072013},{0.279575,0.117608},{0.216558,0.117604},{0.216621,0.163131},{0.155273,0.162921},{0.155271,0.195922},{0.083626,0.163974},{0.083624,0.195919},{0.085862,0.239032},{0.085862,0.12132},{0.051257,0.23903},{0.037664,0.073181},{0.024447,0.117028},{0.051257,0.121322},{0.059116,0.073407},{0.970828,0.24565},{0.996536,0.24563},{0.996507,0.206863},{0.970799,0.206883},{0.996484,0.176214},{0.957347,0.206894},{0.957188,0.245661},{0.970777,0.176235},{0.93171,0.206915},{0.931621,0.245682},{0.881403,0.245723},{0.957582,0.176246},{0.970788,0.129519},{0.996449,0.129499},{0.931781,0.176267},{0.957453,0.12953},{0.970342,0.001834},{0.994836,0.00184},{0.970288,0.046452},{0.957613,0.001831},{0.994827,0.046457},{0.931839,0.129551},{0.970281,0.079534},{0.99482,0.07954},{0.957469,0.046449},{0.933164,0.001826},{0.99481,0.12751},{0.970271,0.127504},{0.9948,0.174696},{0.957351,0.079578},{0.970262,0.17469},{0.994794,0.205043},{0.957184,0.127501},{0.93311,0.046443},{0.933126,0.079644},{0.957129,0.174687},{0.970255,0.205038},{0.994786,0.245284},{0.933048,0.127496},{0.956989,0.205035},{0.933016,0.174682},{0.883219,0.079799},{0.882985,0.127484},{0.883383,0.046431},{0.830175,0.079977},{0.883549,0.001814},{0.830294,0.046419},{0.830437,0.001802},{0.87986,0.129593},{0.880811,0.176308},{0.824841,0.176353},{0.824219,0.129638},{0.880904,0.206956},{0.82548,0.245768},{0.825028,0.207001},{0.80111,0.245787},{0.800471,0.176373},{0.800682,0.207021},{0.778525,0.245806},{0.799967,0.129657},{0.807288,0.001796},{0.777933,0.176391},{0.778144,0.207039},{0.710746,0.24586},{0.807189,0.046414},{0.777546,0.129676},{0.785887,0.001791},{0.710553,0.176445},{0.710599,0.207093},{0.622622,0.245914},{0.710212,0.12973},{0.622597,0.207147},{0.572451,0.245961},{0.622577,0.176499},{0.569226,0.207197},{0.538038,0.245993},{0.523936,0.206849},{0.563879,0.176553},{0.622547,0.129783},{0.533882,0.176094},{0.514093,0.176332},{0.558522,0.129843},{0.526601,0.129873},{0.501873,0.134041},{0.566808,0.001746},{0.622499,0.001762},{0.622492,0.046379},{0.517531,0.001379},{0.539042,0.001737},{0.532498,0.046353},{0.508238,0.046346},{0.565004,0.046362},{0.505346,0.058617},{0.564998,0.079421},{0.529533,0.079434},{0.503631,0.095028},{0.622487,0.080532},{0.564991,0.127415},{0.528891,0.127405},{0.502922,0.127397},{0.530539,0.174591},{0.504834,0.179578},{0.508794,0.204932},{0.564983,0.174601},{0.533794,0.204939},{0.516345,0.245175},{0.566229,0.204949},{0.538386,0.245182},{0.501654,0.120698},{0.526878,0.120676},{0.512575,0.080822},{0.622471,0.174618},{0.532598,0.082166},{0.524567,0.043669},{0.568777,0.245191},{0.561659,0.120645},{0.573072,0.002998},{0.538815,0.003029},{0.569006,0.042799},{0.565101,0.082137},{0.622466,0.204965},{0.623096,0.12059},{0.62246,0.245206},{0.62307,0.082224},{0.623042,0.041643},{0.623016,0.002954},{0.710155,0.12054},{0.721184,0.245221},{0.710779,0.082151},{0.710935,0.041661},{0.710904,0.002903},{0.72117,0.20498},{0.778455,0.041679},{0.778377,0.002852},{0.778346,0.082076},{0.777465,0.120488},{0.785724,0.245236},{0.800938,0.041685},{0.800861,0.002834},{0.800759,0.082036},{0.799644,0.120471},{0.825151,0.041689},{0.82512,0.002816},{0.824855,0.082017},{0.880798,0.041693},{0.880791,0.002773},{0.880222,0.081951},{0.82353,0.120453},{0.93079,0.0417},{0.930782,0.002735},{0.930821,0.081889},{0.956241,0.041704},{0.956234,0.002715},{0.878359,0.120411},{0.969867,0.041693},{0.969812,0.002705},{0.995404,0.002685},{0.995435,0.041674},{0.995466,0.081817},{0.969875,0.081836},{0.995497,0.120321},{0.956202,0.081847},{0.969905,0.120341},{0.970247,0.245279},{0.956116,0.120351},{0.957025,0.245276},{0.931038,0.12037},{0.932979,0.24527},{0.93301,0.205029},{0.882468,0.245258},{0.882364,0.205017},{0.882729,0.17467},{0.829813,0.205005},{0.829894,0.245246},{0.830021,0.174658},{0.83012,0.127472},{0.80691,0.205},{0.806991,0.245241},{0.807051,0.174652},{0.807105,0.127467},{0.807093,0.080067},{0.785749,0.127462},{0.785788,0.046409},{0.721615,0.001777},{0.785714,0.080133},{0.721561,0.046394},{0.72151,0.080332},{0.721433,0.127447},{0.785761,0.174648},{0.622479,0.127432},{0.721311,0.174633},{0.785666,0.204995}},vertex={{-1.280507,4.982406,0.327454},{-1.332924,4.914042,0.080062},{-1.373197,4.729558,0.111379},{-1.303637,4.728367,0.525131},{-1.471458,4.340656,0.141502},{-1.168974,5.173043,0.541581},{-1.414921,4.341139,0.57873},{-1.56345,3.922148,0.157138},{-1.121216,4.738314,0.892693},{-1.056802,5.17561,0.776962},{-1.016814,5.494626,0.604128},{-1.502012,3.922304,0.607973},{-1.637698,3.535187,0.164369},{-0.731993,5.538538,0.918741},{-0.940462,5.8347,0.472469},{-0.784871,5.169168,1.089072},{-1.213039,4.337524,0.976905},{-0.828078,4.747989,1.240419},{-1.289452,3.921131,1.019192},{-0.877851,4.342555,1.339599},{-1.333152,3.519912,1.039026},{-0.924389,3.922764,1.401124},{-0.963614,3.509098,1.435264},{-1.556141,3.529173,0.617641},{-1.383902,3.172942,1.073748},{-1.628012,3.198013,0.615007},{-1.705783,3.214289,0.162704},{-1.872359,2.80644,0.153081},{-1.797655,2.772621,0.661674},{-2.159506,2.326319,0.14139},{-2.074912,2.291854,0.726148},{-1.539303,2.726705,1.158159},{-1.778889,2.244208,1.295384},{-1.293784,2.200816,1.755509},{-1.004879,3.143667,1.478894},{-1.11734,2.6952,1.586488},{-0.673936,2.159698,2.069897},{-0.477554,3.495313,1.647767},{-0.506183,3.106351,1.706304},{-0.573592,2.653649,1.85315},{-0,2.146422,2.170822},{-0,2.650289,1.958617},{-0,3.105669,1.816884},{0.573592,2.653649,1.853149},{0.673936,2.159697,2.069897},{0.506182,3.106351,1.706304},{1.11734,2.6952,1.586488},{1.293784,2.200815,1.755509},{0.477554,3.495313,1.647767},{1.539303,2.726705,1.158159},{1.778889,2.244207,1.295384},{2.074912,2.291854,0.726147},{1.004879,3.143667,1.478894},{1.797655,2.772621,0.661674},{2.159506,2.326319,0.14139},{1.872359,2.80644,0.153081},{1.383902,3.172942,1.073748},{1.628012,3.198013,0.615007},{1.705783,3.214289,0.162704},{1.637698,3.535187,0.164369},{1.556141,3.529173,0.617641},{0.963614,3.509098,1.435264},{1.333152,3.519912,1.039026},{1.502012,3.922304,0.607973},{1.56345,3.922148,0.157138},{1.289452,3.921131,1.019192},{1.414921,4.341139,0.57873},{1.471458,4.340656,0.141502},{0.924389,3.922764,1.401124},{1.213039,4.337524,0.976905},{1.303637,4.728367,0.525131},{1.373197,4.729558,0.111379},{1.332924,4.914042,0.080062},{1.280507,4.982406,0.327454},{1.168974,5.173043,0.541581},{1.121216,4.738314,0.892693},{1.056802,5.17561,0.776962},{1.016814,5.494626,0.604128},{0.828078,4.747989,1.240419},{0.731993,5.538538,0.918741},{0.784871,5.169168,1.089072},{0.940462,5.8347,0.472469},{0.877851,4.342555,1.339599},{0.405716,5.182181,1.297395},{0.454305,3.922025,1.607099},{0.420386,4.752618,1.439167},{0.433361,4.340279,1.537655},{-0,3.495061,1.755329},{0,3.923197,1.697065},{-0.454305,3.922025,1.607099},{0,4.343888,1.625914},{-0.433361,4.340279,1.537655},{0,4.757738,1.517027},{-0.420386,4.752618,1.439167},{0,5.190552,1.367945},{-0.405716,5.182181,1.297395},{0,5.563218,1.198728},{-0.381228,5.552549,1.123923},{0.381228,5.552549,1.123923},{0,5.881484,1.001249},{-0.356945,5.875565,0.90982},{0.356945,5.875565,0.90982},{-0.658646,5.858573,0.721403},{0,6.056045,0.814812},{-0.330136,6.048918,0.740762},{-0.57669,6.055343,0.562195},{0.658646,5.858573,0.721403},{0.330136,6.048918,0.740762},{0,6.182165,0.630358},{0.57669,6.055343,0.562195},{-0.28865,6.189991,0.565574},{0.28865,6.189991,0.565574},{0,6.336719,0.470623},{-0.227323,6.33591,0.414521},{0.227323,6.33591,0.414521},{-0.50013,6.192433,0.40182},{-0.411235,6.333783,0.260784},{0.50013,6.192433,0.40182},{0.411236,6.333783,0.260783},{0.703251,6.070101,0.353196},{0.932782,5.977345,0.299356},{0.925094,6.034736,0.060211},{0.638254,6.206228,0.066242},{0.500433,6.330813,0.042131},{0.789191,6.114563,0.058438},{0.794033,6.136291,-0.134475},{0.939382,6.0562,-0.135853},{0.642616,6.210325,-0.137734},{0.503707,6.324553,-0.144968},{-0.638254,6.206228,0.066242},{-0.500433,6.330813,0.042131},{-0.503707,6.324553,-0.144968},{-0.642616,6.210325,-0.137734},{-0.794034,6.136291,-0.134475},{-0.703251,6.070101,0.353196},{-0.932782,5.977345,0.299356},{-0.925094,6.034736,0.060211},{-0.939382,6.0562,-0.135853},{-0.789191,6.114563,0.058438},{-2.159506,2.326319,0.14139},{-1.872359,2.80644,0.153081},{-2.018533,2.337144,-0.551825},{-1.762581,2.821432,-0.44805},{-1.670303,2.345091,-1.14341},{-1.614823,3.239854,-0.371201},{-1.705783,3.214289,0.162704},{-1.637698,3.535187,0.164369},{-1.455261,2.826542,-0.970341},{-1.212039,2.339669,-1.531859},{-1.319963,3.269129,-0.835619},{-1.544625,3.56244,-0.335727},{-1.56345,3.922148,0.157138},{-1.048495,2.818532,-1.310695},{-0.604338,2.346312,-1.819051},{-1.487939,3.942182,-0.303039},{-1.471458,4.340656,0.141502},{-1.257342,3.594876,-0.777848},{-0.936153,3.282484,-1.1289},{-0.522714,2.822068,-1.555753},{0,2.365431,-1.934184},{-0.4669,3.28751,-1.324548},{-0.886383,3.625479,-1.047724},{0,2.826535,-1.62254},{-1.188959,3.97756,-0.717982},{0.522714,2.822068,-1.555753},{0.604338,2.346312,-1.819051},{0,3.296004,-1.415774},{1.048495,2.818533,-1.310695},{1.212039,2.339669,-1.531859},{0.4669,3.28751,-1.324548},{-0.435671,3.643661,-1.21989},{1.455261,2.826542,-0.970341},{1.670302,2.345091,-1.14341},{-0.819218,4.004247,-0.959534},{1.762581,2.821433,-0.44805},{2.018533,2.337144,-0.551825},{2.159506,2.326319,0.14139},{1.872359,2.80644,0.153081},{1.319963,3.269129,-0.835619},{1.614823,3.239854,-0.371201},{1.705783,3.214289,0.162704},{1.637698,3.535187,0.164369},{1.544625,3.56244,-0.335727},{1.56345,3.922148,0.157138},{0.936153,3.282484,-1.1289},{1.257342,3.594876,-0.777848},{1.487939,3.942182,-0.303039},{1.471458,4.340656,0.141502},{0.886383,3.625479,-1.047724},{1.188959,3.97756,-0.717982},{1.385338,4.35856,-0.269049},{1.373197,4.729558,0.111379},{0.435671,3.643661,-1.21989},{0.819218,4.004247,-0.959534},{1.103196,4.377924,-0.651283},{1.269353,4.738025,-0.271112},{1.332924,4.914042,0.080062},{1.240808,4.937271,-0.282175},{1.033381,4.747596,-0.622113},{0.767173,4.392457,-0.854672},{0.993376,5.083908,-0.627514},{1.075377,5.159711,-0.554753},{0.962129,5.475008,-0.695803},{0.725615,4.761498,-0.798049},{0.68947,5.124954,-0.782621},{0.408289,4.023571,-1.11099},{0.38408,4.414367,-0.995735},{0,3.652381,-1.288618},{0,4.039579,-1.182342},{-0.408289,4.023571,-1.11099},{0,4.423906,-1.054252},{-0.38408,4.414367,-0.995735},{-0.767173,4.392457,-0.854672},{0.374912,4.777698,-0.922626},{-0.374912,4.777698,-0.922626},{0,4.784053,-0.980061},{0.37151,5.155028,-0.917764},{-0.725615,4.761498,-0.798049},{-0.37151,5.155028,-0.917764},{-0.68947,5.124954,-0.782621},{-1.033381,4.747596,-0.622113},{0,5.155148,-0.975485},{-0.993376,5.083908,-0.627514},{-0.680416,5.462085,-0.813203},{-0.962129,5.475008,-0.695803},{-1.075377,5.159711,-0.554753},{-1.240808,4.937271,-0.282175},{-0.930696,5.760539,-0.646432},{-1.269353,4.738025,-0.271112},{-1.332924,4.914042,0.080062},{-1.373197,4.729558,0.111379},{-1.103196,4.377924,-0.651283},{-1.385338,4.35856,-0.269049},{-0.651783,5.825484,-0.734238},{-0.930471,5.998862,-0.443205},{-0.361712,5.4668,-0.905895},{-0.794034,6.136291,-0.134475},{-0.939382,6.0562,-0.135853},{0,5.470546,-0.92837},{-0.725922,6.119171,-0.34173},{-0.642616,6.210325,-0.137734},{-0.601048,6.07512,-0.525851},{-0.597662,6.211453,-0.29572},{-0.503707,6.324553,-0.144968},{-0.486066,6.325374,-0.259612},{-0.49625,6.212581,-0.448685},{-0.407361,6.325766,-0.407795},{-0.308473,6.087342,-0.672626},{-0.287564,6.211925,-0.587815},{-0.259096,6.322865,-0.518013},{0,6.210794,-0.636559},{0,6.320888,-0.572078},{0.259096,6.322865,-0.518013},{-0.338048,5.855863,-0.816744},{0,5.854053,-0.833112},{0,6.083829,-0.709048},{0.287564,6.211925,-0.587815},{0.407361,6.325766,-0.407795},{0.308473,6.087342,-0.672626},{0.49625,6.212581,-0.448685},{0.486066,6.325374,-0.259612},{0.338048,5.855863,-0.816744},{0.597662,6.211453,-0.29572},{0.503707,6.324553,-0.144968},{0.642616,6.210325,-0.137734},{0.601048,6.07512,-0.525851},{0.725922,6.119171,-0.34173},{0.794033,6.136291,-0.134475},{0.930471,5.998862,-0.443205},{0.939382,6.0562,-0.135853},{0.651783,5.825484,-0.734238},{0.930696,5.760539,-0.646432},{0.361712,5.4668,-0.905895},{0.680416,5.462085,-0.813203},{-3.583391,5.020997,0.034287},{-3.513424,4.901556,0.046983},{-3.583391,5.085363,0.276901},{-3.514332,4.988789,0.347609},{-3.583391,5.233537,0.447609},{-3.433706,5.000238,0.338518},{-3.431847,4.914713,0.04629},{-3.513954,5.181659,0.555032},{-3.279924,5.07714,0.28312},{-3.278921,5.004144,0.042294},{-2.978677,4.975372,0.046235},{-3.434939,5.188071,0.539655},{-3.513576,5.475357,0.611357},{-3.583391,5.47218,0.485401},{-3.280172,5.233515,0.446131},{-3.433405,5.475759,0.596577},{-3.513705,5.772533,0.494638},{-3.583391,5.6995,0.394976},{-3.279292,5.47408,0.49853},{-3.513521,5.939702,0.284512},{-3.583391,5.827788,0.2302},{-3.583391,5.883281,-0.000323},{-3.432877,5.76712,0.481247},{-3.5137,6.007549,-0.017024},{-3.583391,5.828621,-0.211742},{-3.431997,5.930179,0.274311},{-3.513521,5.934549,-0.294501},{-3.583391,5.667173,-0.369164},{-3.431212,5.996494,-0.020653},{-3.279431,5.719265,0.400643},{-3.279326,5.855567,0.225228},{-3.430705,5.924983,-0.292425},{-3.513705,5.729939,-0.47545},{-3.583391,5.450839,-0.43071},{-3.279193,5.912041,-0.022089},{-3.430037,5.724873,-0.469973},{-3.278908,5.852014,-0.251288},{-2.964653,5.888564,0.222693},{-2.963488,5.95066,-0.042697},{-2.965859,5.743626,0.416051},{-2.630544,5.90562,0.210532},{-2.966627,5.478168,0.524649},{-2.631316,5.75773,0.414806},{-2.631827,5.481905,0.530291},{-2.975038,5.220714,0.458254},{-2.639762,5.217084,0.451796},{-2.975632,5.055962,0.295155},{-2.643871,4.964468,0.04857},{-2.640581,5.050196,0.295633},{-2.49813,4.957095,0.049781},{-2.493809,5.2142,0.451473},{-2.494721,5.045484,0.29741},{-2.363183,4.950617,0.052284},{-2.486018,5.483618,0.535565},{-2.358831,5.211077,0.450487},{-2.359703,5.041356,0.299438},{-1.95809,4.942268,0.057991},{-2.485614,5.765384,0.416507},{-2.350954,5.484008,0.540592},{-1.95544,5.207263,0.437275},{-1.954994,5.038131,0.298449},{-1.562712,4.939864,0.062233},{-1.559553,5.03967,0.293617},{-1.382122,4.939574,0.070014},{-1.560236,5.20641,0.419045},{-1.337368,5.033644,0.295211},{-1.332924,4.914042,0.080062},{-1.280507,4.982406,0.327454},{-1.945572,5.484898,0.543462},{-1.281631,5.205937,0.434096},{-1.550211,5.485654,0.539754},{-2.35059,5.770772,0.418041},{-1.945432,5.78054,0.413038},{-2.485022,5.915348,0.206452},{-2.350117,5.922208,0.202382},{-2.630343,5.970881,-0.062711},{-2.485218,5.982321,-0.071646},{-2.961804,5.886101,-0.29152},{-2.629673,5.904065,-0.321502},{-3.279023,5.684231,-0.402342},{-2.959625,5.706163,-0.458411},{-3.278863,5.457986,-0.467923},{-3.430218,5.455499,-0.549032},{-2.960225,5.463171,-0.526984},{-3.513576,5.454138,-0.556666},{-2.628529,5.718766,-0.497496},{-3.513954,5.167591,-0.488899},{-3.583391,5.220318,-0.382889},{-3.431808,5.175696,-0.481801},{-3.279275,5.224058,-0.408462},{-3.432575,4.983982,-0.260748},{-3.514332,4.971987,-0.264416},{-3.583391,5.075617,-0.212703},{-3.583391,5.020997,0.034287},{-3.513424,4.901556,0.046983},{-3.431847,4.914713,0.04629},{-3.278921,5.004144,0.042294},{-3.279675,5.062766,-0.219891},{-2.978677,4.975372,0.046235},{-2.979565,5.039556,-0.245668},{-2.643871,4.964468,0.04857},{-2.975405,5.213812,-0.455328},{-2.645259,5.032082,-0.263752},{-2.49813,4.957095,0.049781},{-2.642574,5.213303,-0.487112},{-2.499737,5.026543,-0.272966},{-2.363183,4.950617,0.052284},{-2.62896,5.46856,-0.566448},{-2.497648,5.211728,-0.503401},{-2.364907,5.021677,-0.280677},{-1.95809,4.942268,0.057991},{-2.484608,5.470906,-0.58646},{-1.959878,5.016644,-0.298534},{-1.562712,4.939864,0.062233},{-2.363177,5.210104,-0.518071},{-1.564771,5.016666,-0.313341},{-1.382122,4.939574,0.070014},{-1.957473,5.210784,-0.551921},{-1.240808,4.937271,-0.282175},{-1.332924,4.914042,0.080062},{-1.310735,4.999001,-0.30016},{-1.563301,5.214269,-0.579399},{-2.35045,5.472088,-0.605234},{-1.943293,5.475644,-0.649906},{-1.235179,5.216277,-0.561584},{-1.146129,5.197708,-0.555224},{-1.075377,5.159711,-0.554753},{-1.550211,5.479053,-0.686536},{-1.183808,5.479695,-0.672235},{-1.077902,5.474045,-0.684696},{-0.962129,5.475008,-0.695803},{-1.550211,5.744709,-0.618567},{-1.047721,5.745585,-0.621242},{-0.930696,5.760539,-0.646432},{-1.16236,5.745771,-0.611377},{-1.050094,5.957135,-0.425406},{-0.930471,5.998862,-0.443205},{-0.939382,6.0562,-0.135853},{-1.055756,6.022912,-0.126795},{-0.925094,6.034736,0.060211},{-1.158908,5.937614,-0.414483},{-1.550211,5.941173,-0.414367},{-1.171315,5.999749,-0.121206},{-1.044717,5.970186,0.164137},{-0.932782,5.977345,0.299356},{-1.943155,5.739093,-0.580658},{-1.057846,5.821541,0.437418},{-0.940462,5.8347,0.472469},{-1.016814,5.494626,0.604128},{-2.350131,5.730304,-0.535431},{-1.944022,5.934024,-0.384435},{-1.550211,6.012984,-0.127275},{-2.484246,5.725569,-0.516967},{-2.35051,5.921511,-0.349816},{-2.484965,5.914175,-0.336116},{-2.350499,5.990725,-0.080029},{-1.944659,6.004925,-0.104272},{-1.945074,5.933175,0.18515},{-1.550211,5.93891,0.165779},{-1.550211,5.786753,0.403087},{-1.170793,5.930904,0.162449},{-1.175432,5.79637,0.39549},{-1.209057,5.487426,0.52465},{-1.112594,5.48735,0.560318},{-1.168974,5.173043,0.541581},{-1.225302,5.18949,0.487839},{3.513424,4.901555,0.046983},{3.583391,5.020996,0.034287},{3.583391,5.085362,0.276901},{3.514332,4.988788,0.347609},{3.583391,5.233536,0.447609},{3.433706,5.000237,0.338518},{3.431847,4.914712,0.04629},{3.513954,5.181658,0.555032},{3.279924,5.077139,0.28312},{3.278921,5.004143,0.042294},{2.978677,4.975371,0.046235},{3.434939,5.18807,0.539655},{3.513576,5.475356,0.611357},{3.583391,5.472179,0.485401},{3.280171,5.233514,0.446131},{3.433405,5.475758,0.596577},{3.513705,5.772532,0.494638},{3.583391,5.699499,0.394976},{3.279292,5.474079,0.49853},{3.513521,5.939701,0.284512},{3.583391,5.827787,0.2302},{3.432877,5.767119,0.481247},{3.583391,5.88328,-0.000323},{3.5137,6.007548,-0.017024},{3.583391,5.82862,-0.211742},{3.431997,5.930178,0.274311},{3.513521,5.934548,-0.294501},{3.583391,5.667172,-0.369164},{3.431212,5.996493,-0.020653},{3.279431,5.719264,0.400643},{3.279326,5.855566,0.225228},{3.430705,5.924982,-0.292425},{3.513705,5.729938,-0.47545},{3.583391,5.450838,-0.43071},{3.279193,5.91204,-0.022089},{3.430037,5.724872,-0.469973},{3.278908,5.852013,-0.251288},{2.964653,5.888563,0.222693},{2.963488,5.950659,-0.042697},{2.965859,5.743625,0.416051},{2.630544,5.905619,0.210532},{2.966627,5.478168,0.524649},{2.631316,5.757729,0.414806},{2.631827,5.481904,0.530292},{2.975038,5.220712,0.458254},{2.639762,5.217083,0.451797},{2.975632,5.055961,0.295155},{2.643871,4.964467,0.04857},{2.640581,5.050195,0.295633},{2.49813,4.957095,0.049781},{2.493809,5.214199,0.451473},{2.494721,5.045483,0.29741},{2.363183,4.950616,0.052284},{2.486018,5.483617,0.535565},{2.35883,5.211076,0.450487},{2.359703,5.041355,0.299438},{1.95809,4.942268,0.057991},{2.485614,5.765384,0.416507},{2.350954,5.484008,0.540592},{1.95544,5.207262,0.437275},{1.954994,5.03813,0.298449},{1.562712,4.939864,0.062233},{1.945572,5.484897,0.543462},{1.559553,5.03967,0.293617},{1.382122,4.939574,0.070014},{1.560236,5.206409,0.419045},{1.337368,5.033644,0.295211},{1.332924,4.914042,0.080062},{1.280507,4.982406,0.327454},{1.281631,5.205937,0.434096},{1.550211,5.485653,0.539754},{1.225302,5.18949,0.487838},{1.168974,5.173043,0.541581},{1.209057,5.487425,0.52465},{1.112594,5.48735,0.560318},{1.016814,5.494626,0.604128},{1.550211,5.786752,0.403087},{1.057846,5.821541,0.437418},{0.940462,5.8347,0.472469},{1.175432,5.796369,0.39549},{0.932782,5.977345,0.299356},{1.170793,5.930904,0.162449},{1.044717,5.970185,0.164137},{0.925094,6.034736,0.060211},{1.550211,5.93891,0.165779},{1.171315,5.999749,-0.121206},{1.055756,6.022911,-0.126795},{0.939382,6.0562,-0.135853},{1.050094,5.957134,-0.425406},{0.930471,5.998862,-0.443205},{0.930696,5.760539,-0.646432},{1.158907,5.937614,-0.414483},{1.047721,5.745585,-0.621242},{0.962129,5.475008,-0.695803},{1.16236,5.745771,-0.611377},{1.077902,5.474045,-0.684696},{1.075377,5.159711,-0.554753},{1.550211,5.941173,-0.414367},{1.146128,5.197708,-0.555224},{1.240808,4.937271,-0.282175},{1.183807,5.479694,-0.672235},{1.382122,4.939574,0.070014},{1.332924,4.914042,0.080062},{1.310735,4.999001,-0.30016},{1.235179,5.216276,-0.561584},{1.550211,5.744709,-0.618567},{1.550211,5.479052,-0.686536},{1.5633,5.214268,-0.579399},{1.564771,5.016665,-0.313341},{1.562712,4.939864,0.062233},{1.943293,5.475643,-0.649906},{1.957472,5.210784,-0.551921},{1.959877,5.016643,-0.298534},{1.95809,4.942268,0.057991},{1.943154,5.739093,-0.580658},{2.364907,5.021676,-0.280677},{2.363183,4.950616,0.052284},{2.363177,5.210104,-0.518071},{2.35045,5.472087,-0.605234},{2.499737,5.026542,-0.272966},{2.49813,4.957095,0.049781},{2.497648,5.211728,-0.503401},{2.484608,5.470906,-0.586461},{2.645259,5.032081,-0.263752},{2.643871,4.964467,0.04857},{2.642574,5.213302,-0.487112},{2.979565,5.039555,-0.245668},{2.978677,4.975371,0.046235},{2.975405,5.213811,-0.455328},{2.62896,5.468559,-0.566448},{3.279675,5.062765,-0.219891},{3.278921,5.004143,0.042294},{3.279275,5.224057,-0.408462},{3.432575,4.983981,-0.260748},{3.431847,4.914712,0.04629},{2.960225,5.46317,-0.526984},{3.514332,4.971986,-0.264416},{3.513424,4.901555,0.046983},{3.583391,5.020996,0.034287},{3.583391,5.075616,-0.212703},{3.583391,5.220317,-0.382889},{3.513954,5.16759,-0.488899},{3.431808,5.175695,-0.481801},{3.513576,5.454137,-0.556666},{3.430218,5.455498,-0.549032},{3.278863,5.457985,-0.467923},{3.279023,5.68423,-0.402342},{2.959625,5.706162,-0.458411},{2.961804,5.8861,-0.29152},{2.628529,5.718765,-0.497496},{2.629673,5.904064,-0.321502},{2.630343,5.970881,-0.062711},{2.484246,5.725568,-0.516967},{2.484965,5.914175,-0.336116},{2.485218,5.98232,-0.071646},{2.485022,5.915347,0.206452},{2.350499,5.990725,-0.080029},{2.35059,5.770771,0.418041},{2.350117,5.922207,0.202382},{1.945432,5.78054,0.413038},{1.945074,5.933175,0.18515},{1.944659,6.004924,-0.104272},{2.35051,5.92151,-0.349816},{1.550211,6.012984,-0.127275},{1.944021,5.934024,-0.384435},{2.350131,5.730304,-0.535431}},normals={{-0.9496,0.2448,0.1957},{-0.9622,0.2337,0.1393},{-0.9587,0.238,0.1558},{-0.918,0.2691,0.2911},{-0.9603,0.2449,0.1338},{-0.8826,0.2774,0.3795},{-0.9234,0.2546,0.2871},{-0.9707,0.2016,0.1304},{-0.8012,0.2834,0.527},{-0.7919,0.3133,0.5242},{-0.7403,0.3831,0.5524},{-0.9351,0.1793,0.3055},{-0.9688,0.1859,0.1637},{-0.5758,0.4538,0.68},{-0.5724,0.6026,0.556},{-0.5943,0.3574,0.7204},{-0.7975,0.2398,0.5535},{-0.5875,0.2919,0.7547},{-0.8045,0.1619,0.5715},{-0.5704,0.2145,0.7928},{-0.8054,0.1475,0.574},{-0.5669,0.1522,0.8096},{-0.5678,0.1408,0.811},{-0.9298,0.1666,0.3281},{-0.7742,0.2736,0.5707},{-0.9022,0.2916,0.3178},{-0.9417,0.2889,0.1723},{-0.8824,0.4417,0.1618},{-0.8405,0.4465,0.3068},{-0.8481,0.5066,0.1552},{-0.8083,0.5074,0.2986},{-0.7132,0.4248,0.5576},{-0.6741,0.4915,0.5513},{-0.5028,0.4436,0.7418},{-0.5468,0.2482,0.7996},{-0.5182,0.3864,0.763},{-0.2561,0.4277,0.8669},{-0.3078,0.1342,0.9419},{-0.2967,0.2449,0.923},{-0.2699,0.381,0.8843},{0,0.4052,0.9142},{0,0.3528,0.9357},{0,0.2312,0.9729},{0.2699,0.381,0.8843},{0.2561,0.4277,0.8669},{0.2967,0.2449,0.923},{0.5182,0.3864,0.763},{0.5028,0.4436,0.7418},{0.3078,0.1342,0.9419},{0.7132,0.4248,0.5576},{0.6741,0.4915,0.5513},{0.8083,0.5074,0.2986},{0.5468,0.2482,0.7996},{0.8405,0.4465,0.3068},{0.8481,0.5066,0.1552},{0.8824,0.4417,0.1618},{0.7742,0.2736,0.5707},{0.9022,0.2916,0.3178},{0.9417,0.2889,0.1723},{0.9688,0.1859,0.1637},{0.9298,0.1666,0.3281},{0.5678,0.1408,0.811},{0.8054,0.1475,0.574},{0.9351,0.1793,0.3055},{0.9707,0.2016,0.1304},{0.8045,0.1619,0.5715},{0.9234,0.2546,0.2871},{0.9603,0.2449,0.1338},{0.5669,0.1522,0.8096},{0.7975,0.2398,0.5535},{0.918,0.2691,0.2911},{0.9587,0.238,0.1558},{0.9622,0.2337,0.1393},{0.9496,0.2448,0.1957},{0.8826,0.2774,0.3795},{0.8012,0.2834,0.527},{0.7919,0.3133,0.5242},{0.7403,0.3831,0.5524},{0.5875,0.2919,0.7547},{0.5758,0.4538,0.68},{0.5943,0.3574,0.7204},{0.5724,0.6026,0.556},{0.5704,0.2145,0.7928},{0.3122,0.3663,0.8766},{0.3006,0.1419,0.9431},{0.2972,0.2746,0.9145},{0.296,0.2025,0.9334},{0,0.1392,0.9902},{0,0.1505,0.9886},{-0.3006,0.1419,0.9431},{0,0.2115,0.9774},{-0.296,0.2025,0.9334},{0,0.2852,0.9584},{-0.2972,0.2746,0.9145},{0,0.3669,0.9302},{-0.3122,0.3663,0.8766},{0,0.4741,0.8804},{-0.3249,0.4761,0.8171},{0.3249,0.4761,0.8171},{0,0.6339,0.7734},{-0.3222,0.6178,0.7173},{0.3222,0.6178,0.7173},{-0.5077,0.5965,0.6216},{0,0.7719,0.6357},{-0.2785,0.7364,0.6166},{-0.4693,0.7279,0.4999},{0.5077,0.5965,0.6216},{0.2785,0.7364,0.6166},{0,0.7736,0.6336},{0.4693,0.7279,0.4999},{-0.2664,0.7656,0.5856},{0.2664,0.7656,0.5856},{0,0.7322,0.6811},{-0.2968,0.7511,0.5897},{0.2968,0.7511,0.5897},{-0.4957,0.7655,0.4102},{-0.5557,0.7418,0.3754},{0.4957,0.7655,0.4102},{0.5557,0.7418,0.3754},{0.5121,0.7891,0.3391},{0.4222,0.8173,0.392},{0.4721,0.8625,0.1819},{0.578,0.7987,0.1674},{0.6439,0.7539,0.1306},{0.5055,0.842,0.1883},{0.483,0.8708,0.0921},{0.4794,0.8679,0.1299},{0.5512,0.8342,0.0173},{0.6355,0.7719,-0.0147},{-0.578,0.7987,0.1674},{-0.6439,0.7539,0.1306},{-0.6355,0.7719,-0.0147},{-0.5512,0.8342,0.0173},{-0.483,0.8708,0.0921},{-0.5121,0.7891,0.3391},{-0.4222,0.8173,0.392},{-0.4721,0.8625,0.1819},{-0.4794,0.8679,0.1299},{-0.5055,0.842,0.1883},{-0.8448,0.5093,-0.1639},{-0.8859,0.4381,-0.1523},{-0.8128,0.5002,-0.2986},{-0.8444,0.4371,-0.3097},{-0.6647,0.497,-0.5578},{-0.8927,0.3056,-0.3311},{-0.9435,0.2971,-0.1465},{-0.9662,0.1989,-0.1642},{-0.6797,0.4501,-0.5791},{-0.4707,0.4954,-0.73},{-0.7089,0.3272,-0.6248},{-0.9143,0.2065,-0.3483},{-0.9694,0.1888,-0.1569},{-0.4682,0.4622,-0.7531},{-0.2772,0.4997,-0.8206},{-0.9095,0.2092,-0.3593},{-0.9574,0.2269,-0.1783},{-0.7122,0.238,-0.6604},{-0.4734,0.3441,-0.8108},{-0.2617,0.4804,-0.8371},{0,0.5336,-0.8458},{-0.277,0.3701,-0.8867},{-0.4693,0.2691,-0.841},{0,0.4862,-0.8738},{-0.6847,0.2495,-0.6848},{0.2617,0.4804,-0.8371},{0.2772,0.4997,-0.8206},{0,0.3785,-0.9256},{0.4682,0.4622,-0.7531},{0.4707,0.4954,-0.73},{0.277,0.3701,-0.8867},{-0.258,0.2917,-0.921},{0.6797,0.4501,-0.5791},{0.6647,0.497,-0.5578},{-0.4396,0.2793,-0.8536},{0.8444,0.4371,-0.3097},{0.8128,0.5002,-0.2986},{0.8448,0.5093,-0.1639},{0.8859,0.4381,-0.1523},{0.7089,0.3272,-0.6248},{0.8927,0.3056,-0.3311},{0.9435,0.2971,-0.1465},{0.9662,0.1989,-0.1642},{0.9143,0.2065,-0.3483},{0.9694,0.1888,-0.1569},{0.4734,0.3441,-0.8108},{0.7122,0.238,-0.6604},{0.9095,0.2092,-0.3593},{0.9574,0.2269,-0.1783},{0.4693,0.2691,-0.841},{0.6847,0.2495,-0.6848},{0.8873,0.2534,-0.3854},{0.9481,0.2152,-0.234},{0.258,0.2917,-0.921},{0.4396,0.2793,-0.8536},{0.6715,0.2339,-0.7031},{0.8939,0.1858,-0.408},{0.956,0.1534,-0.2499},{0.8905,0.0811,-0.4477},{0.6808,0.1318,-0.7205},{0.429,0.2345,-0.8723},{0.6313,-0.0351,-0.7747},{0.7282,-0.1447,-0.6699},{0.4274,0.0361,-0.9033},{0.4162,0.1286,-0.9001},{0.4066,-0.0142,-0.9134},{0.2578,0.2832,-0.9238},{0.2522,0.2446,-0.9362},{0,0.3063,-0.9519},{0,0.2844,-0.9587},{-0.2578,0.2832,-0.9238},{0,0.2598,-0.9656},{-0.2522,0.2446,-0.9362},{-0.429,0.2345,-0.8723},{0.2543,0.1141,-0.9604},{-0.2543,0.1141,-0.9604},{0,0.108,-0.9941},{0.2591,0.0136,-0.9657},{-0.4162,0.1286,-0.9001},{-0.2591,0.0136,-0.9657},{-0.4066,-0.0142,-0.9134},{-0.6808,0.1318,-0.7205},{0,0.0564,-0.9984},{-0.6313,-0.0351,-0.7747},{-0.3415,0.0849,-0.936},{-0.4274,0.0361,-0.9033},{-0.7282,-0.1447,-0.6699},{-0.8905,0.0811,-0.4477},{-0.3669,0.405,-0.8374},{-0.8939,0.1858,-0.408},{-0.956,0.1534,-0.2499},{-0.9481,0.2152,-0.234},{-0.6715,0.2339,-0.7031},{-0.8873,0.2534,-0.3854},{-0.3257,0.4353,-0.8393},{-0.3793,0.7831,-0.4928},{-0.1836,0.148,-0.9718},{-0.4425,0.8741,-0.2003},{-0.4739,0.863,-0.1747},{0,0.1906,-0.9816},{-0.4056,0.8576,-0.3162},{-0.5443,0.8187,-0.1828},{-0.3857,0.7035,-0.5968},{-0.575,0.7669,-0.2848},{-0.664,0.7349,-0.1375},{-0.6674,0.7046,-0.2408},{-0.5297,0.66,-0.5326},{-0.5645,0.6247,-0.5395},{-0.2331,0.5672,-0.7899},{-0.3104,0.5701,-0.7607},{-0.3276,0.5548,-0.7647},{0,0.5206,-0.8538},{0,0.5054,-0.8629},{0.3276,0.5548,-0.7647},{-0.1589,0.3909,-0.9066},{0,0.3731,-0.9278},{0,0.485,-0.8745},{0.3104,0.5701,-0.7607},{0.5645,0.6247,-0.5395},{0.2331,0.5672,-0.7899},{0.5297,0.66,-0.5326},{0.6674,0.7046,-0.2408},{0.1589,0.3909,-0.9066},{0.575,0.7669,-0.2848},{0.664,0.7349,-0.1375},{0.5443,0.8187,-0.1828},{0.3857,0.7035,-0.5968},{0.4056,0.8576,-0.3162},{0.4425,0.8741,-0.2003},{0.3793,0.7831,-0.4928},{0.4739,0.863,-0.1747},{0.3257,0.4353,-0.8393},{0.3669,0.405,-0.8374},{0.1836,0.148,-0.9718},{0.3415,0.0849,-0.936},{-0.8615,-0.4908,0.1302},{-0.3984,-0.8818,0.2524},{-0.8649,-0.4466,0.2292},{-0.3888,-0.7997,0.4575},{-0.8686,-0.2449,0.4307},{0.3478,-0.813,0.4669},{0.3233,-0.907,0.2697},{-0.3686,-0.4456,0.8158},{0.2437,-0.8368,0.4902},{0.2183,-0.9337,0.2839},{-0.0594,-0.9508,0.3039},{0.3735,-0.4507,0.8107},{-0.3888,0.0811,0.9177},{-0.874,0.0603,0.4821},{0.2775,-0.47,0.8379},{0.3561,0.0808,0.9309},{-0.3956,0.543,0.7406},{-0.8716,0.2934,0.3925},{0.2581,0.0774,0.963},{-0.4052,0.8224,0.3992},{-0.8719,0.4413,0.2123},{-0.873,0.4876,0.0028},{0.3413,0.5611,0.7541},{-0.4167,0.9089,-0.0152},{-0.8851,0.4081,-0.2235},{0.3261,0.854,0.4053},{-0.4282,0.7715,-0.4705},{-0.8739,0.2345,-0.4257},{0.3063,0.9517,-0.0191},{0.2404,0.5851,0.7745},{0.2219,0.8827,0.4143},{0.2924,0.8134,-0.5029},{-0.4382,0.437,-0.7855},{-0.8724,0.0149,-0.4886},{0.2012,0.9795,-0.0112},{0.274,0.4657,-0.8414},{0.1833,0.841,-0.5091},{-0.0635,0.9053,0.4199},{-0.091,0.9958,-0.012},{-0.0532,0.6098,0.7907},{-0.0418,0.9087,0.4154},{-0.0446,0.0631,0.997},{-0.0311,0.6202,0.7838},{-0.0238,0.0509,0.9984},{-0.0293,-0.4919,0.8701},{-0.0055,-0.496,0.8683},{-0.0466,-0.8477,0.5285},{-0.037,-0.9454,0.3238},{-0.024,-0.8362,0.5478},{-0.0483,-0.9415,0.3335},{-0.0105,-0.4971,0.8676},{-0.0331,-0.8301,0.5565},{-0.0352,-0.9391,0.3419},{-0.0338,0.0463,0.9984},{0.0047,-0.4989,0.8666},{-0.0184,-0.8231,0.5676},{-0.0113,-0.9307,0.3657},{-0.0375,0.625,0.7797},{-0.0158,0.037,0.9992},{0.022,-0.5014,0.8649},{0.0038,-0.8037,0.595},{-0.0081,-0.9202,0.3913},{-0.0067,-0.7863,0.6177},{-0.2339,-0.8786,0.4163},{-0.0098,-0.5055,0.8627},{-0.4115,-0.6757,0.6116},{-0.5313,-0.745,0.4032},{-0.7177,-0.4491,0.5321},{0.0079,0.0191,0.9998},{-0.4067,-0.3587,0.8402},{0.0158,0.0188,0.9997},{-0.0199,0.6294,0.7768},{0.0027,0.6419,0.7667},{-0.043,0.9097,0.413},{-0.0233,0.9117,0.4102},{-0.07,0.9975,-0.0086},{-0.0706,0.9975,-0.0074},{-0.1246,0.8509,-0.5103},{-0.1029,0.8567,-0.5053},{0.1568,0.4819,-0.8621},{-0.1492,0.4854,-0.8614},{0.1638,0.0144,-0.9864},{0.2799,0.0219,-0.9597},{-0.1469,-0.0018,-0.9891},{-0.4338,0.0216,-0.9008},{-0.1287,0.4892,-0.8626},{-0.4053,-0.4723,-0.7827},{-0.8629,-0.2624,-0.4319},{0.3058,-0.4921,-0.815},{0.2002,-0.5194,-0.8307},{0.3216,-0.844,-0.4292},{-0.3966,-0.8205,-0.4116},{-0.8589,-0.4587,-0.2277},{-0.852,-0.5112,-0.1131},{-0.3666,-0.9077,-0.2042},{0.3179,-0.9246,-0.2096},{0.2184,-0.9521,-0.214},{0.2193,-0.8745,-0.4326},{-0.0607,-0.9747,-0.2149},{-0.0762,-0.895,-0.4396},{-0.0399,-0.9764,-0.212},{-0.1144,-0.539,-0.8345},{-0.0539,-0.8998,-0.4329},{-0.0456,-0.9765,-0.2104},{-0.0913,-0.5551,-0.8267},{-0.0598,-0.9008,-0.4299},{-0.0304,-0.9774,-0.2091},{-0.1269,-0.0154,-0.9918},{-0.0979,-0.561,-0.822},{-0.0438,-0.9033,-0.4266},{-0.0115,-0.9786,-0.2051},{-0.1363,-0.0207,-0.9904},{-0.0241,-0.9082,-0.4177},{0.0008,-0.9795,-0.2012},{-0.0813,-0.5694,-0.818},{-0.0261,-0.911,-0.4115},{-0.2387,-0.9527,-0.1882},{-0.0605,-0.5898,-0.8052},{-0.5017,-0.7266,-0.4693},{-0.4274,-0.8887,-0.1657},{-0.2586,-0.8309,-0.4927},{-0.0124,-0.5983,-0.8011},{-0.1199,-0.03,-0.9923},{-0.0971,-0.0502,-0.994},{-0.0112,-0.5798,-0.8147},{-0.1812,-0.5331,-0.8264},{-0.2556,-0.5101,-0.8212},{-0.023,-0.0671,-0.9975},{-0.0423,-0.0816,-0.9958},{-0.1092,-0.0863,-0.9902},{-0.1156,-0.0306,-0.9928},{-0.0337,0.4978,-0.8666},{-0.1551,0.4552,-0.8768},{-0.2544,0.4458,-0.8582},{-0.0416,0.4876,-0.872},{-0.2635,0.8366,-0.4801},{-0.3523,0.8099,-0.4689},{-0.2864,0.957,-0.0451},{-0.2459,0.969,-0.0234},{-0.3202,0.9304,0.1782},{-0.1015,0.8764,-0.4707},{-0.0194,0.8735,-0.4865},{-0.0949,0.9955,0.0044},{-0.3293,0.8988,0.2892},{-0.4277,0.8161,0.3885},{-0.0955,0.4991,-0.8612},{-0.3571,0.6152,0.7028},{-0.2905,0.5949,0.7494},{-0.4059,0.2467,0.88},{-0.1185,0.4931,-0.8618},{-0.0625,0.8679,-0.4928},{0.0066,0.9999,-0.0048},{-0.1361,0.4906,-0.8607},{-0.084,0.8616,-0.5006},{-0.1047,0.8586,-0.5018},{-0.0485,0.9988,-0.0062},{-0.0276,0.9996,-0.0023},{-0.0034,0.9155,0.4024},{0.0098,0.9209,0.3896},{0.0102,0.6496,0.7602},{-0.1394,0.9205,0.3649},{-0.1973,0.6578,0.7268},{-0.1923,0.1167,0.9744},{-0.4007,0.183,0.8977},{-0.6733,-0.0605,0.7368},{-0.6902,-0.1569,0.7064},{0.3984,-0.8818,0.2524},{0.8615,-0.4908,0.1302},{0.8649,-0.4466,0.2292},{0.3888,-0.7997,0.4575},{0.8686,-0.2449,0.4307},{-0.3478,-0.813,0.4669},{-0.3233,-0.907,0.2697},{0.3686,-0.4456,0.8158},{-0.2437,-0.8368,0.4902},{-0.2183,-0.9337,0.2839},{0.0594,-0.9508,0.3039},{-0.3735,-0.4507,0.8107},{0.3888,0.0811,0.9177},{0.874,0.0603,0.4821},{-0.2775,-0.47,0.8379},{-0.3561,0.0808,0.9309},{0.3956,0.543,0.7406},{0.8716,0.2934,0.3925},{-0.2581,0.0774,0.963},{0.4052,0.8224,0.3992},{0.8719,0.4413,0.2123},{-0.3413,0.5611,0.7541},{0.873,0.4876,0.0028},{0.4167,0.9089,-0.0152},{0.8851,0.4081,-0.2235},{-0.3261,0.854,0.4053},{0.4282,0.7715,-0.4705},{0.8739,0.2345,-0.4257},{-0.3063,0.9517,-0.0191},{-0.2404,0.5851,0.7745},{-0.2219,0.8827,0.4143},{-0.2924,0.8134,-0.5029},{0.4382,0.437,-0.7855},{0.8724,0.0149,-0.4886},{-0.2012,0.9795,-0.0112},{-0.274,0.4657,-0.8414},{-0.1833,0.841,-0.5091},{0.0635,0.9053,0.4199},{0.091,0.9958,-0.012},{0.0532,0.6098,0.7907},{0.0418,0.9087,0.4154},{0.0446,0.0631,0.997},{0.0311,0.6202,0.7838},{0.0238,0.0509,0.9984},{0.0293,-0.4919,0.8701},{0.0055,-0.496,0.8683},{0.0466,-0.8477,0.5285},{0.037,-0.9454,0.3238},{0.024,-0.8362,0.5478},{0.0483,-0.9415,0.3335},{0.0105,-0.4971,0.8676},{0.0331,-0.8301,0.5565},{0.0352,-0.9391,0.3419},{0.0338,0.0463,0.9984},{-0.0047,-0.4989,0.8666},{0.0184,-0.8231,0.5676},{0.0113,-0.9307,0.3657},{0.0375,0.625,0.7797},{0.0158,0.037,0.9992},{-0.022,-0.5014,0.8649},{-0.0038,-0.8037,0.595},{0.0081,-0.9202,0.3913},{-0.0079,0.0191,0.9998},{0.0067,-0.7863,0.6177},{0.2339,-0.8786,0.4163},{0.0098,-0.5056,0.8627},{0.4115,-0.6757,0.6116},{0.5313,-0.745,0.4032},{0.7177,-0.4491,0.5321},{0.4067,-0.3587,0.8402},{-0.0158,0.0188,0.9997},{0.6902,-0.1569,0.7064},{0.6733,-0.0605,0.7368},{0.1923,0.1167,0.9744},{0.4007,0.183,0.8977},{0.4059,0.2467,0.88},{-0.0102,0.6496,0.7602},{0.3571,0.6152,0.7028},{0.2905,0.5949,0.7494},{0.1973,0.6578,0.7268},{0.4277,0.8161,0.3885},{0.1394,0.9205,0.3649},{0.3293,0.8988,0.2892},{0.3203,0.9304,0.1782},{-0.0098,0.9209,0.3896},{0.0949,0.9955,0.0044},{0.2459,0.969,-0.0234},{0.2864,0.957,-0.0451},{0.2635,0.8366,-0.4801},{0.3523,0.8099,-0.4689},{0.2544,0.4458,-0.8582},{0.1015,0.8764,-0.4707},{0.1551,0.4552,-0.8768},{0.1156,-0.0306,-0.9928},{0.0416,0.4876,-0.872},{0.1092,-0.0863,-0.9902},{0.2556,-0.5101,-0.8212},{0.0194,0.8735,-0.4865},{0.1812,-0.5331,-0.8264},{0.5017,-0.7266,-0.4693},{0.0423,-0.0816,-0.9958},{0.2387,-0.9527,-0.1882},{0.4274,-0.8887,-0.1657},{0.2586,-0.8309,-0.4927},{0.0112,-0.5798,-0.8147},{0.0337,0.4978,-0.8666},{0.023,-0.0671,-0.9975},{0.0124,-0.5983,-0.8011},{0.0261,-0.911,-0.4115},{-0.0008,-0.9795,-0.2012},{0.0971,-0.0502,-0.994},{0.0605,-0.5898,-0.8052},{0.0241,-0.9082,-0.4177},{0.0115,-0.9786,-0.2051},{0.0955,0.4991,-0.8612},{0.0438,-0.9033,-0.4266},{0.0304,-0.9774,-0.2091},{0.0813,-0.5694,-0.818},{0.1199,-0.03,-0.9923},{0.0598,-0.9008,-0.4299},{0.0456,-0.9765,-0.2104},{0.0979,-0.561,-0.822},{0.1363,-0.0207,-0.9904},{0.0539,-0.8998,-0.4329},{0.0399,-0.9764,-0.212},{0.0913,-0.5551,-0.8267},{0.0762,-0.895,-0.4396},{0.0607,-0.9747,-0.2149},{0.1144,-0.539,-0.8345},{0.1269,-0.0154,-0.9918},{-0.2193,-0.8745,-0.4326},{-0.2184,-0.9521,-0.214},{-0.2002,-0.5194,-0.8307},{-0.3216,-0.844,-0.4292},{-0.3179,-0.9246,-0.2096},{0.1469,-0.0018,-0.9891},{0.3966,-0.8205,-0.4116},{0.3666,-0.9077,-0.2042},{0.852,-0.5112,-0.1131},{0.8589,-0.4587,-0.2277},{0.8629,-0.2624,-0.4319},{0.4053,-0.4723,-0.7827},{-0.3058,-0.4921,-0.815},{0.4338,0.0216,-0.9008},{-0.2799,0.0219,-0.9597},{-0.1638,0.0144,-0.9864},{-0.1568,0.4819,-0.8621},{0.1492,0.4854,-0.8614},{0.1246,0.8509,-0.5103},{0.1287,0.4892,-0.8626},{0.1029,0.8567,-0.5053},{0.07,0.9975,-0.0086},{0.1361,0.4906,-0.8607},{0.1047,0.8586,-0.5018},{0.0706,0.9975,-0.0074},{0.043,0.9097,0.413},{0.0485,0.9988,-0.0062},{0.0199,0.6294,0.7768},{0.0233,0.9117,0.4102},{-0.0027,0.6419,0.7667},{0.0034,0.9155,0.4024},{0.0276,0.9996,-0.0023},{0.084,0.8616,-0.5006},{-0.0066,0.9999,-0.0048},{0.0625,0.8679,-0.4928},{0.1185,0.4931,-0.8618}},name="Dress_Long_Sleeve",faces={{{1,1,1},{2,2,2},{3,3,3}},{{4,4,4},{1,1,1},{3,3,3}},{{4,4,4},{3,3,3},{5,5,5}},{{4,4,4},{6,6,6},{1,1,1}},{{7,7,7},{4,4,4},{5,5,5}},{{7,7,7},{5,5,5},{8,8,8}},{{6,6,6},{4,4,4},{9,9,9}},{{4,4,4},{7,7,7},{9,9,9}},{{10,10,10},{6,6,6},{9,9,9}},{{6,6,6},{10,10,10},{11,11,11}},{{12,12,12},{7,7,7},{8,8,8}},{{8,8,8},{13,13,13},{12,12,12}},{{11,11,11},{10,10,10},{14,14,14}},{{14,14,14},{15,15,15},{11,11,11}},{{16,16,16},{10,10,10},{9,9,9}},{{10,10,10},{16,16,16},{14,14,14}},{{7,7,7},{17,17,17},{9,9,9}},{{18,18,18},{16,16,16},{9,9,9}},{{18,18,18},{9,9,9},{17,17,17}},{{17,17,17},{7,7,7},{19,19,19}},{{7,7,7},{12,12,12},{19,19,19}},{{20,20,20},{18,18,18},{17,17,17}},{{21,21,21},{19,19,19},{12,12,12}},{{17,17,17},{19,19,19},{22,22,22}},{{20,20,20},{17,17,17},{22,22,22}},{{19,19,19},{21,21,21},{23,23,23}},{{22,22,22},{19,19,19},{23,23,23}},{{24,24,24},{21,21,21},{12,12,12}},{{13,13,13},{24,24,24},{12,12,12}},{{21,25,21},{24,26,24},{25,27,25}},{{23,28,23},{21,25,21},{25,27,25}},{{24,26,24},{13,29,13},{26,30,26}},{{24,26,24},{26,30,26},{25,27,25}},{{13,29,13},{27,31,27},{26,30,26}},{{26,30,26},{27,31,27},{28,32,28}},{{29,33,29},{26,30,26},{28,32,28}},{{25,27,25},{26,30,26},{29,33,29}},{{29,33,29},{28,32,28},{30,34,30}},{{31,35,31},{29,33,29},{30,34,30}},{{32,36,32},{29,33,29},{31,35,31}},{{32,36,32},{25,27,25},{29,33,29}},{{33,37,33},{32,36,32},{31,35,31}},{{32,36,32},{33,37,33},{34,38,34}},{{35,39,35},{25,27,25},{32,36,32}},{{35,39,35},{23,28,23},{25,27,25}},{{36,40,36},{32,36,32},{34,38,34}},{{36,40,36},{35,39,35},{32,36,32}},{{34,38,34},{37,41,37},{36,40,36}},{{38,42,38},{23,28,23},{35,39,35}},{{23,23,23},{38,43,38},{22,22,22}},{{39,44,39},{35,39,35},{36,40,36}},{{39,44,39},{38,42,38},{35,39,35}},{{37,41,37},{40,45,40},{36,40,36}},{{40,45,40},{39,44,39},{36,40,36}},{{37,41,37},{41,46,41},{40,45,40}},{{40,45,40},{42,47,42},{39,44,39}},{{41,46,41},{42,47,42},{40,45,40}},{{38,42,38},{39,44,39},{43,48,43}},{{42,47,42},{43,48,43},{39,44,39}},{{42,47,42},{41,46,41},{44,49,44}},{{41,46,41},{45,50,45},{44,49,44}},{{43,48,43},{42,47,42},{46,51,46}},{{42,47,42},{44,49,44},{46,51,46}},{{47,52,47},{44,49,44},{45,50,45}},{{44,49,44},{47,52,47},{46,51,46}},{{48,53,48},{47,52,47},{45,50,45}},{{43,48,43},{46,51,46},{49,54,49}},{{50,55,50},{47,52,47},{48,53,48}},{{51,56,51},{50,55,50},{48,53,48}},{{50,55,50},{51,56,51},{52,57,52}},{{47,52,47},{53,58,53},{46,51,46}},{{47,52,47},{50,55,50},{53,58,53}},{{46,51,46},{53,58,53},{49,54,49}},{{54,59,54},{50,55,50},{52,57,52}},{{52,57,52},{55,60,55},{54,59,54}},{{55,60,55},{56,61,56},{54,59,54}},{{50,55,50},{57,62,57},{53,58,53}},{{57,62,57},{50,55,50},{54,59,54}},{{54,59,54},{56,61,56},{58,63,58}},{{58,63,58},{57,62,57},{54,59,54}},{{56,61,56},{59,64,59},{58,63,58}},{{59,64,59},{60,65,60},{58,63,58}},{{58,63,58},{61,66,61},{57,62,57}},{{60,65,60},{61,66,61},{58,63,58}},{{53,58,53},{57,62,57},{62,67,62}},{{53,58,53},{62,67,62},{49,54,49}},{{61,66,61},{63,68,63},{57,62,57}},{{57,62,57},{63,68,63},{62,67,62}},{{61,69,61},{60,70,60},{64,71,64}},{{63,72,63},{61,69,61},{64,71,64}},{{60,70,60},{65,73,65},{64,71,64}},{{62,74,62},{63,72,63},{66,75,66}},{{66,75,66},{63,72,63},{64,71,64}},{{64,71,64},{65,73,65},{67,76,67}},{{64,71,64},{67,76,67},{66,75,66}},{{65,73,65},{68,77,68},{67,76,67}},{{69,78,69},{62,74,62},{66,75,66}},{{49,79,49},{62,74,62},{69,78,69}},{{67,76,67},{70,80,70},{66,75,66}},{{66,75,66},{70,80,70},{69,78,69}},{{67,76,67},{68,77,68},{71,81,71}},{{68,77,68},{72,82,72},{71,81,71}},{{72,82,72},{73,83,73},{74,84,74}},{{71,81,71},{72,82,72},{74,84,74}},{{71,81,71},{74,84,74},{75,85,75}},{{71,81,71},{76,86,76},{67,76,67}},{{76,86,76},{71,81,71},{75,85,75}},{{76,86,76},{70,80,70},{67,76,67}},{{77,87,77},{76,86,76},{75,85,75}},{{75,85,75},{78,88,78},{77,87,77}},{{70,80,70},{76,86,76},{79,89,79}},{{78,88,78},{80,90,80},{77,87,77}},{{76,86,76},{77,87,77},{81,91,81}},{{80,90,80},{81,91,81},{77,87,77}},{{79,89,79},{76,86,76},{81,91,81}},{{80,90,80},{78,88,78},{82,92,82}},{{83,93,83},{70,80,70},{79,89,79}},{{70,80,70},{83,93,83},{69,78,69}},{{79,89,79},{81,91,81},{84,94,84}},{{69,78,69},{83,93,83},{85,95,85}},{{85,95,85},{49,79,49},{69,78,69}},{{79,89,79},{86,96,86},{83,93,83}},{{86,96,86},{79,89,79},{84,94,84}},{{83,93,83},{87,97,87},{85,95,85}},{{86,96,86},{87,97,87},{83,93,83}},{{49,79,49},{85,95,85},{88,98,88}},{{88,99,88},{43,48,43},{49,54,49}},{{88,99,88},{38,42,38},{43,48,43}},{{85,95,85},{89,100,89},{88,98,88}},{{38,43,38},{88,98,88},{90,101,90}},{{88,98,88},{89,100,89},{90,101,90}},{{38,43,38},{90,101,90},{22,22,22}},{{20,20,20},{22,22,22},{90,101,90}},{{91,102,91},{89,100,89},{85,95,85}},{{90,101,90},{89,100,89},{91,102,91}},{{87,97,87},{91,102,91},{85,95,85}},{{92,103,92},{20,20,20},{90,101,90}},{{92,103,92},{90,101,90},{91,102,91}},{{93,104,93},{91,102,91},{87,97,87}},{{92,103,92},{91,102,91},{93,104,93}},{{86,96,86},{93,104,93},{87,97,87}},{{20,20,20},{92,103,92},{94,105,94}},{{94,105,94},{92,103,92},{93,104,93}},{{18,18,18},{20,20,20},{94,105,94}},{{93,104,93},{86,96,86},{95,106,95}},{{94,105,94},{93,104,93},{95,106,95}},{{86,96,86},{84,94,84},{95,106,95}},{{18,18,18},{94,105,94},{96,107,96}},{{96,107,96},{94,105,94},{95,106,95}},{{16,16,16},{18,18,18},{96,107,96}},{{97,108,97},{95,106,95},{84,94,84}},{{96,107,96},{95,106,95},{97,108,97}},{{16,16,16},{96,107,96},{98,109,98}},{{98,109,98},{96,107,96},{97,108,97}},{{14,14,14},{16,16,16},{98,109,98}},{{99,110,99},{97,108,97},{84,94,84}},{{99,110,99},{84,94,84},{81,91,81}},{{80,90,80},{99,110,99},{81,91,81}},{{97,108,97},{100,111,100},{98,109,98}},{{97,108,97},{99,110,99},{100,111,100}},{{14,14,14},{98,109,98},{101,112,101}},{{100,111,100},{101,112,101},{98,109,98}},{{99,110,99},{80,90,80},{102,113,102}},{{99,110,99},{102,113,102},{100,111,100}},{{103,114,103},{14,14,14},{101,112,101}},{{103,114,103},{15,15,15},{14,14,14}},{{100,111,100},{104,115,104},{101,112,101}},{{100,111,100},{102,113,102},{104,115,104}},{{101,112,101},{105,116,105},{103,114,103}},{{104,115,104},{105,116,105},{101,112,101}},{{15,15,15},{103,114,103},{106,117,106}},{{105,116,105},{106,117,106},{103,114,103}},{{80,90,80},{107,118,107},{102,113,102}},{{107,118,107},{80,90,80},{82,92,82}},{{102,113,102},{108,119,108},{104,115,104}},{{108,119,108},{102,113,102},{107,118,107}},{{104,115,104},{109,120,109},{105,116,105}},{{104,115,104},{108,119,108},{109,120,109}},{{107,118,107},{82,92,82},{110,121,110}},{{110,121,110},{108,119,108},{107,118,107}},{{109,120,109},{111,122,111},{105,116,105}},{{105,116,105},{111,122,111},{106,117,106}},{{108,119,108},{112,123,112},{109,120,109}},{{112,123,112},{108,119,108},{110,121,110}},{{109,120,109},{113,124,113},{111,122,111}},{{113,124,113},{109,120,109},{112,123,112}},{{113,124,113},{114,125,114},{111,122,111}},{{115,126,115},{113,124,113},{112,123,112}},{{111,122,111},{114,125,114},{116,127,116}},{{111,122,111},{116,127,116},{106,117,106}},{{114,125,114},{117,128,117},{116,127,116}},{{115,126,115},{112,123,112},{118,129,118}},{{118,129,118},{112,123,112},{110,121,110}},{{119,130,119},{115,126,115},{118,129,118}},{{120,131,120},{118,129,118},{110,121,110}},{{82,92,82},{120,131,120},{110,121,110}},{{120,131,120},{82,92,82},{121,132,121}},{{120,131,120},{121,132,121},{122,133,122}},{{119,130,119},{118,129,118},{123,134,123}},{{120,131,120},{123,134,123},{118,129,118}},{{124,135,124},{119,130,119},{123,134,123}},{{122,133,122},{125,136,125},{120,131,120}},{{120,131,120},{125,136,125},{123,134,123}},{{126,137,126},{125,136,125},{122,133,122}},{{123,134,123},{125,136,125},{126,137,126}},{{126,137,126},{122,133,122},{127,138,127}},{{123,134,123},{126,137,126},{128,139,128}},{{124,135,124},{123,134,123},{128,139,128}},{{129,140,129},{124,135,124},{128,139,128}},{{116,127,116},{117,128,117},{130,141,130}},{{117,128,117},{131,142,131},{130,141,130}},{{131,142,131},{132,143,132},{133,144,133}},{{130,141,130},{131,142,131},{133,144,133}},{{130,141,130},{133,144,133},{134,145,134}},{{135,146,135},{116,127,116},{130,141,130}},{{135,146,135},{106,117,106},{116,127,116}},{{135,146,135},{15,15,15},{106,117,106}},{{135,146,135},{136,147,136},{15,15,15}},{{135,146,135},{137,148,137},{136,147,136}},{{134,145,134},{138,149,138},{137,148,137}},{{135,146,135},{130,141,130},{139,150,139}},{{130,141,130},{134,145,134},{139,150,139}},{{137,148,137},{135,146,135},{139,150,139}},{{134,145,134},{137,148,137},{139,150,139}},{{140,151,140},{141,152,141},{142,153,142}},{{141,152,141},{143,154,143},{142,153,142}},{{142,153,142},{143,154,143},{144,155,144}},{{143,154,143},{141,152,141},{145,156,145}},{{141,152,141},{146,157,146},{145,156,145}},{{146,157,146},{147,158,147},{145,156,145}},{{143,154,143},{148,159,148},{144,155,144}},{{144,155,144},{148,159,148},{149,160,149}},{{143,154,143},{145,156,145},{150,161,150}},{{148,159,148},{143,154,143},{150,161,150}},{{147,158,147},{151,162,151},{145,156,145}},{{145,156,145},{151,162,151},{150,161,150}},{{151,163,151},{147,164,147},{152,165,152}},{{148,159,148},{153,166,153},{149,160,149}},{{148,159,148},{150,161,150},{153,166,153}},{{149,160,149},{153,166,153},{154,167,154}},{{155,168,155},{151,163,151},{152,165,152}},{{152,165,152},{156,169,156},{155,168,155}},{{151,162,151},{157,170,157},{150,161,150}},{{157,171,157},{151,163,151},{155,168,155}},{{150,161,150},{158,172,158},{153,166,153}},{{150,161,150},{157,170,157},{158,172,158}},{{153,166,153},{159,173,159},{154,167,154}},{{160,174,160},{154,167,154},{159,173,159}},{{153,166,153},{158,172,158},{161,175,161}},{{159,173,159},{153,166,153},{161,175,161}},{{157,170,157},{162,176,162},{158,172,158}},{{158,172,158},{162,176,162},{161,175,161}},{{163,177,163},{160,174,160},{159,173,159}},{{162,178,162},{157,171,157},{164,179,164}},{{164,179,164},{157,171,157},{155,168,155}},{{160,174,160},{163,177,163},{165,180,165}},{{166,181,166},{160,174,160},{165,180,165}},{{167,182,167},{163,177,163},{159,173,159}},{{165,180,165},{163,177,163},{167,182,167}},{{161,175,161},{167,182,167},{159,173,159}},{{166,181,166},{165,180,165},{168,183,168}},{{169,184,169},{166,181,166},{168,183,168}},{{170,185,170},{165,180,165},{167,182,167}},{{165,180,165},{170,185,170},{168,183,168}},{{161,175,161},{171,186,171},{167,182,167}},{{162,176,162},{171,186,171},{161,175,161}},{{168,183,168},{172,187,172},{169,184,169}},{{172,187,172},{173,188,173},{169,184,169}},{{171,189,171},{162,178,162},{174,190,174}},{{174,190,174},{162,178,162},{164,179,164}},{{173,188,173},{172,187,172},{175,191,175}},{{176,192,176},{173,188,173},{175,191,175}},{{177,193,177},{176,192,176},{178,194,178}},{{176,192,176},{175,191,175},{178,194,178}},{{172,187,172},{179,195,179},{175,191,175}},{{172,187,172},{168,183,168},{179,195,179}},{{175,191,175},{180,196,180},{178,194,178}},{{179,195,179},{180,196,180},{175,191,175}},{{180,196,180},{181,197,181},{178,194,178}},{{181,197,181},{180,196,180},{182,198,182}},{{180,196,180},{183,199,183},{182,198,182}},{{180,196,180},{179,195,179},{183,199,183}},{{182,200,182},{183,201,183},{184,202,184}},{{168,183,168},{185,203,185},{179,195,179}},{{170,185,170},{185,203,185},{168,183,168}},{{179,195,179},{186,204,186},{183,199,183}},{{179,195,179},{185,203,185},{186,204,186}},{{183,201,183},{187,205,187},{184,202,184}},{{183,201,183},{186,206,186},{187,205,187}},{{184,202,184},{187,205,187},{188,207,188}},{{185,203,185},{189,208,189},{186,204,186}},{{185,203,185},{170,185,170},{189,208,189}},{{186,206,186},{190,209,190},{187,205,187}},{{190,209,190},{186,206,186},{189,210,189}},{{187,205,187},{191,211,191},{188,207,188}},{{187,205,187},{190,209,190},{191,211,191}},{{188,207,188},{191,211,191},{192,212,192}},{{170,185,170},{193,213,193},{189,208,189}},{{170,185,170},{167,182,167},{193,213,193}},{{194,214,194},{190,209,190},{189,210,189}},{{189,210,189},{193,215,193},{194,214,194}},{{190,209,190},{195,216,195},{191,211,191}},{{190,209,190},{194,214,194},{195,216,195}},{{191,211,191},{196,217,196},{192,212,192}},{{191,211,191},{195,216,195},{196,217,196}},{{192,212,192},{196,217,196},{197,218,197}},{{196,217,196},{198,219,198},{197,218,197}},{{195,216,195},{199,220,199},{196,217,196}},{{196,217,196},{199,220,199},{198,219,198}},{{194,214,194},{200,221,200},{195,216,195}},{{199,220,199},{195,216,195},{200,221,200}},{{199,220,199},{201,222,201},{198,219,198}},{{201,222,201},{202,223,202},{198,219,198}},{{203,224,203},{202,223,202},{201,222,201}},{{199,220,199},{204,225,204},{201,222,201}},{{204,225,204},{199,220,199},{200,221,200}},{{203,224,203},{201,222,201},{205,226,205}},{{204,225,204},{205,226,205},{201,222,201}},{{194,214,194},{206,227,206},{200,221,200}},{{193,215,193},{206,227,206},{194,214,194}},{{200,221,200},{207,228,207},{204,225,204}},{{206,227,206},{207,228,207},{200,221,200}},{{193,215,193},{208,229,208},{206,227,206}},{{167,182,167},{208,230,208},{193,213,193}},{{171,186,171},{208,230,208},{167,182,167}},{{208,229,208},{209,231,209},{206,227,206}},{{206,227,206},{209,231,209},{207,228,207}},{{171,189,171},{210,232,210},{208,229,208}},{{210,232,210},{209,231,209},{208,229,208}},{{210,232,210},{171,189,171},{174,190,174}},{{209,231,209},{211,233,211},{207,228,207}},{{210,232,210},{212,234,212},{209,231,209}},{{212,234,212},{211,233,211},{209,231,209}},{{174,190,174},{213,235,213},{210,232,210}},{{213,235,213},{212,234,212},{210,232,210}},{{207,228,207},{211,233,211},{214,236,214}},{{207,228,207},{214,236,214},{204,225,204}},{{204,225,204},{214,236,214},{205,226,205}},{{212,234,212},{215,237,215},{211,233,211}},{{211,233,211},{216,238,216},{214,236,214}},{{215,237,215},{216,238,216},{211,233,211}},{{214,236,214},{217,239,217},{205,226,205}},{{214,236,214},{216,238,216},{217,239,217}},{{218,240,218},{215,237,215},{212,234,212}},{{213,235,213},{218,240,218},{212,234,212}},{{215,237,215},{219,241,219},{216,238,216}},{{218,240,218},{220,242,220},{215,237,215}},{{220,242,220},{219,241,219},{215,237,215}},{{218,240,218},{213,235,213},{221,243,221}},{{219,241,219},{222,244,222},{216,238,216}},{{216,238,216},{222,244,222},{217,239,217}},{{220,242,220},{218,240,218},{223,245,223}},{{218,240,218},{221,243,221},{223,245,223}},{{219,241,219},{220,242,220},{224,246,224}},{{220,242,220},{223,245,223},{225,247,225}},{{224,246,224},{220,242,220},{225,247,225}},{{225,247,225},{223,245,223},{226,248,226}},{{223,245,223},{227,249,227},{226,248,226}},{{227,249,227},{223,245,223},{221,243,221}},{{228,250,228},{224,246,224},{225,247,225}},{{229,251,229},{227,249,227},{221,243,221}},{{230,252,230},{227,249,227},{229,251,229}},{{231,253,231},{230,252,230},{229,251,229}},{{229,251,229},{221,243,221},{232,254,232}},{{213,235,213},{232,254,232},{221,243,221}},{{232,254,232},{213,235,213},{174,190,174}},{{164,179,164},{232,254,232},{174,190,174}},{{231,253,231},{229,251,229},{233,255,233}},{{233,255,233},{229,251,229},{232,254,232}},{{233,255,233},{232,254,232},{164,179,164}},{{156,169,156},{231,253,231},{233,255,233}},{{155,168,155},{233,255,233},{164,179,164}},{{156,169,156},{233,255,233},{155,168,155}},{{234,256,234},{224,246,224},{228,250,228}},{{235,257,235},{234,256,234},{228,250,228}},{{236,258,236},{219,241,219},{224,246,224}},{{236,258,236},{224,246,224},{234,256,234}},{{222,244,222},{219,241,219},{236,258,236}},{{237,259,237},{235,257,235},{238,260,238}},{{239,261,239},{222,244,222},{236,258,236}},{{237,259,237},{240,262,240},{235,257,235}},{{240,262,240},{237,259,237},{241,263,241}},{{235,257,235},{240,262,240},{242,264,242}},{{242,264,242},{234,256,234},{235,257,235}},{{243,265,243},{240,262,240},{241,263,241}},{{240,262,240},{243,265,243},{242,264,242}},{{243,265,243},{241,263,241},{244,266,244}},{{245,267,245},{243,265,243},{244,266,244}},{{243,265,243},{245,267,245},{246,268,246}},{{243,265,243},{246,268,246},{242,264,242}},{{245,267,245},{247,269,247},{246,268,246}},{{242,264,242},{248,270,248},{234,256,234}},{{242,264,242},{246,268,246},{248,270,248}},{{246,268,246},{247,269,247},{249,271,249}},{{246,268,246},{249,271,249},{248,270,248}},{{247,269,247},{250,272,250},{249,271,249}},{{249,271,249},{250,272,250},{251,273,251}},{{249,271,249},{251,273,251},{248,270,248}},{{250,272,250},{252,274,252},{251,273,251}},{{252,274,252},{253,275,253},{251,273,251}},{{234,256,234},{248,270,248},{254,276,254}},{{254,276,254},{236,258,236},{234,256,234}},{{239,261,239},{236,258,236},{254,276,254}},{{254,276,254},{248,270,248},{255,277,255}},{{255,277,255},{239,261,239},{254,276,254}},{{251,273,251},{256,278,256},{248,270,248}},{{248,270,248},{256,278,256},{255,277,255}},{{253,275,253},{257,279,257},{251,273,251}},{{253,275,253},{258,280,258},{257,279,257}},{{256,278,256},{251,273,251},{259,281,259}},{{251,273,251},{257,279,257},{259,281,259}},{{256,278,256},{259,281,259},{255,277,255}},{{258,280,258},{260,282,260},{257,279,257}},{{259,281,259},{257,279,257},{260,282,260}},{{258,280,258},{261,283,261},{260,282,260}},{{259,281,259},{262,284,262},{255,277,255}},{{239,261,239},{255,277,255},{262,284,262}},{{261,283,261},{263,285,263},{260,282,260}},{{261,283,261},{264,286,264},{263,285,263}},{{264,286,264},{265,287,265},{263,285,263}},{{266,288,266},{259,281,259},{260,282,260}},{{260,282,260},{263,285,263},{266,288,266}},{{263,285,263},{265,287,265},{267,289,267}},{{263,285,263},{267,289,267},{266,288,266}},{{265,287,265},{268,290,268},{267,289,267}},{{268,290,268},{269,291,269},{267,289,267}},{{269,291,269},{266,288,266},{267,289,267}},{{268,290,268},{270,292,270},{269,291,269}},{{266,288,266},{271,293,271},{259,281,259}},{{266,288,266},{269,291,269},{271,293,271}},{{271,293,271},{262,284,262},{259,281,259}},{{269,291,269},{272,294,272},{271,293,271}},{{262,284,262},{271,293,271},{273,295,273}},{{273,295,273},{239,261,239},{262,284,262}},{{239,261,239},{273,295,273},{222,244,222}},{{273,295,273},{217,239,217},{222,244,222}},{{271,293,271},{272,294,272},{274,296,274}},{{271,293,271},{274,296,274},{273,295,273}},{{273,295,273},{274,296,274},{217,239,217}},{{272,294,272},{203,224,203},{274,296,274}},{{274,296,274},{205,226,205},{217,239,217}},{{274,296,274},{203,224,203},{205,226,205}},{{275,297,275},{276,298,276},{277,299,277}},{{276,298,276},{278,300,278},{277,299,277}},{{279,301,279},{277,299,277},{278,300,278}},{{280,302,280},{278,300,278},{276,298,276}},{{281,303,281},{280,302,280},{276,298,276}},{{282,304,282},{279,301,279},{278,300,278}},{{280,302,280},{281,303,281},{283,305,283}},{{281,303,281},{284,306,284},{283,305,283}},{{284,306,284},{285,307,285},{283,305,283}},{{280,302,280},{286,308,286},{278,300,278}},{{286,308,286},{282,304,282},{278,300,278}},{{282,304,282},{287,309,287},{279,301,279}},{{282,304,282},{286,308,286},{287,309,287}},{{287,309,287},{288,310,288},{279,301,279}},{{286,308,286},{280,302,280},{289,311,289}},{{280,302,280},{283,305,283},{289,311,289}},{{286,308,286},{290,312,290},{287,309,287}},{{286,308,286},{289,311,289},{290,312,290}},{{287,313,287},{291,314,291},{288,315,288}},{{287,313,287},{290,316,290},{291,314,291}},{{291,314,291},{292,317,292},{288,315,288}},{{289,311,289},{293,318,293},{290,312,290}},{{291,314,291},{294,319,294},{292,317,292}},{{294,319,294},{295,320,295},{292,317,292}},{{295,320,295},{294,319,294},{296,321,296}},{{290,316,290},{297,322,297},{291,314,291}},{{291,314,291},{297,322,297},{294,319,294}},{{290,316,290},{293,323,293},{297,322,297}},{{294,319,294},{298,324,298},{296,321,296}},{{299,325,299},{296,321,296},{298,324,298}},{{297,322,297},{300,326,300},{294,319,294}},{{294,319,294},{300,326,300},{298,324,298}},{{301,327,301},{299,325,299},{298,324,298}},{{299,325,299},{301,327,301},{302,328,302}},{{300,326,300},{303,329,303},{298,324,298}},{{298,324,298},{303,329,303},{301,327,301}},{{297,322,297},{304,330,304},{300,326,300}},{{293,323,293},{304,330,304},{297,322,297}},{{300,326,300},{305,331,305},{303,329,303}},{{304,330,304},{305,331,305},{300,326,300}},{{303,329,303},{306,332,306},{301,327,301}},{{301,327,301},{307,333,307},{302,328,302}},{{301,327,301},{306,332,306},{307,333,307}},{{302,328,302},{307,333,307},{308,334,308}},{{303,329,303},{309,335,309},{306,332,306}},{{305,331,305},{309,335,309},{303,329,303}},{{306,332,306},{310,336,310},{307,333,307}},{{309,335,309},{311,337,311},{306,332,306}},{{306,332,306},{311,337,311},{310,336,310}},{{305,331,305},{312,338,312},{309,335,309}},{{309,335,309},{313,339,313},{311,337,311}},{{312,338,312},{313,339,313},{309,335,309}},{{314,340,314},{312,338,312},{305,331,305}},{{304,330,304},{314,340,314},{305,331,305}},{{312,338,312},{315,341,315},{313,339,313}},{{316,342,316},{314,340,314},{304,330,304}},{{293,323,293},{316,342,316},{304,330,304}},{{314,340,314},{317,343,317},{312,338,312}},{{317,343,317},{315,341,315},{312,338,312}},{{316,342,316},{318,344,318},{314,340,314}},{{318,344,318},{317,343,317},{314,340,314}},{{319,345,319},{316,346,316},{293,318,293}},{{289,311,289},{319,345,319},{293,318,293}},{{289,311,289},{283,305,283},{319,345,319}},{{319,345,319},{320,347,320},{316,346,316}},{{320,347,320},{318,348,318},{316,346,316}},{{283,305,283},{321,349,321},{319,345,319}},{{319,345,319},{321,349,321},{320,347,320}},{{285,307,285},{321,349,321},{283,305,283}},{{285,307,285},{322,350,322},{321,349,321}},{{322,350,322},{323,351,323},{321,349,321}},{{321,349,321},{323,351,323},{320,347,320}},{{322,350,322},{324,352,324},{323,351,323}},{{320,347,320},{325,353,325},{318,348,318}},{{320,347,320},{323,351,323},{325,353,325}},{{324,352,324},{326,354,326},{323,351,323}},{{323,351,323},{326,354,326},{325,353,325}},{{324,352,324},{327,355,327},{326,354,326}},{{325,353,325},{328,356,328},{318,348,318}},{{318,344,318},{328,357,328},{317,343,317}},{{325,353,325},{326,354,326},{329,358,329}},{{325,353,325},{329,358,329},{328,356,328}},{{327,355,327},{330,359,330},{326,354,326}},{{326,354,326},{330,359,330},{329,358,329}},{{327,355,327},{331,360,331},{330,359,330}},{{328,357,328},{332,361,332},{317,343,317}},{{317,343,317},{332,361,332},{315,341,315}},{{329,358,329},{333,362,333},{328,356,328}},{{328,357,328},{333,363,333},{332,361,332}},{{329,358,329},{330,359,330},{334,364,334}},{{329,358,329},{334,364,334},{333,362,333}},{{331,360,331},{335,365,335},{330,359,330}},{{330,359,330},{335,365,335},{334,364,334}},{{331,360,331},{336,366,336},{335,365,335}},{{336,366,336},{337,367,337},{335,365,335}},{{336,366,336},{338,368,338},{337,367,337}},{{334,364,334},{335,365,335},{339,369,339}},{{335,365,335},{337,367,337},{339,369,339}},{{338,368,338},{340,370,340},{337,367,337}},{{339,369,339},{337,367,337},{340,370,340}},{{338,368,338},{341,371,341},{340,370,340}},{{341,371,341},{342,372,342},{340,370,340}},{{334,364,334},{339,369,339},{343,373,343}},{{334,364,334},{343,373,343},{333,362,333}},{{344,374,344},{339,369,339},{340,370,340}},{{340,370,340},{342,372,342},{344,374,344}},{{339,369,339},{345,375,345},{343,373,343}},{{345,375,345},{339,369,339},{344,374,344}},{{333,363,333},{343,376,343},{346,377,346}},{{333,363,333},{346,377,346},{332,361,332}},{{343,376,343},{345,378,345},{347,379,347}},{{343,376,343},{347,379,347},{346,377,346}},{{332,361,332},{346,377,346},{348,380,348}},{{332,361,332},{348,380,348},{315,341,315}},{{346,377,346},{347,379,347},{349,381,349}},{{346,377,346},{349,381,349},{348,380,348}},{{315,341,315},{348,380,348},{350,382,350}},{{315,341,315},{350,382,350},{313,339,313}},{{348,380,348},{349,381,349},{351,383,351}},{{348,380,348},{351,383,351},{350,382,350}},{{313,339,313},{350,382,350},{352,384,352}},{{313,339,313},{352,384,352},{311,337,311}},{{350,382,350},{351,383,351},{353,385,353}},{{350,382,350},{353,385,353},{352,384,352}},{{311,337,311},{352,384,352},{354,386,354}},{{311,337,311},{354,386,354},{310,336,310}},{{352,384,352},{355,387,355},{354,386,354}},{{352,384,352},{353,385,353},{355,387,355}},{{310,336,310},{354,386,354},{356,388,356}},{{354,386,354},{355,387,355},{356,388,356}},{{357,389,357},{310,336,310},{356,388,356}},{{310,336,310},{357,389,357},{307,333,307}},{{355,387,355},{358,390,358},{356,388,356}},{{357,389,357},{359,391,359},{307,333,307}},{{307,333,307},{359,391,359},{308,334,308}},{{353,385,353},{360,392,360},{355,387,355}},{{355,387,355},{360,392,360},{358,390,358}},{{308,393,308},{359,394,359},{361,395,361}},{{362,396,362},{308,393,308},{361,395,361}},{{357,397,357},{363,398,363},{359,394,359}},{{363,398,363},{361,395,361},{359,394,359}},{{363,398,363},{357,397,357},{364,399,364}},{{357,397,357},{356,400,356},{364,399,364}},{{363,398,363},{365,401,365},{361,395,361}},{{363,398,363},{364,399,364},{365,401,365}},{{362,396,362},{361,395,361},{366,402,366}},{{365,401,365},{366,402,366},{361,395,361}},{{367,403,367},{362,396,362},{366,402,366}},{{367,403,367},{366,402,366},{368,404,368}},{{366,402,366},{369,405,369},{368,404,368}},{{370,406,370},{369,405,369},{366,402,366}},{{365,401,365},{370,406,370},{366,402,366}},{{370,406,370},{365,401,365},{371,407,371}},{{365,401,365},{372,408,372},{371,407,371}},{{364,399,364},{372,408,372},{365,401,365}},{{371,407,371},{372,408,372},{373,409,373}},{{372,408,372},{374,410,374},{373,409,373}},{{372,408,372},{364,399,364},{374,410,374}},{{373,409,373},{374,410,374},{375,411,375}},{{364,399,364},{376,412,376},{374,410,374}},{{364,399,364},{356,400,356},{376,412,376}},{{356,400,356},{358,413,358},{376,412,376}},{{374,410,374},{377,414,377},{375,411,375}},{{374,410,374},{376,412,376},{377,414,377}},{{375,411,375},{377,414,377},{378,415,378}},{{376,412,376},{358,413,358},{379,416,379}},{{376,412,376},{379,416,379},{377,414,377}},{{377,414,377},{380,417,380},{378,415,378}},{{377,414,377},{379,416,379},{380,417,380}},{{378,415,378},{380,417,380},{381,418,381}},{{358,413,358},{382,419,382},{379,416,379}},{{360,392,360},{382,420,382},{358,390,358}},{{379,416,379},{383,421,383},{380,417,380}},{{379,416,379},{382,419,382},{383,421,383}},{{380,417,380},{384,422,384},{381,418,381}},{{380,417,380},{383,421,383},{384,422,384}},{{381,418,381},{384,422,384},{385,423,385}},{{382,419,382},{386,424,386},{383,421,383}},{{384,422,384},{387,425,387},{385,423,385}},{{385,423,385},{387,425,387},{388,426,388}},{{383,421,383},{389,427,389},{384,422,384}},{{384,422,384},{389,427,389},{387,425,387}},{{383,421,383},{386,424,386},{389,427,389}},{{387,425,387},{390,428,390},{388,426,388}},{{388,426,388},{390,428,390},{391,429,391}},{{389,427,389},{392,430,392},{387,425,387}},{{387,425,387},{392,430,392},{390,428,390}},{{393,431,393},{394,432,394},{391,429,391}},{{390,428,390},{395,433,395},{391,429,391}},{{395,433,395},{393,431,393},{391,429,391}},{{392,430,392},{396,434,396},{390,428,390}},{{390,428,390},{396,434,396},{395,433,395}},{{389,427,389},{397,435,397},{392,430,392}},{{386,424,386},{397,435,397},{389,427,389}},{{392,430,392},{398,436,398},{396,434,396}},{{397,435,397},{398,436,398},{392,430,392}},{{396,434,396},{399,437,399},{395,433,395}},{{393,431,393},{395,433,395},{400,438,400}},{{395,433,395},{399,437,399},{400,438,400}},{{393,431,393},{400,438,400},{401,439,401}},{{396,434,396},{402,440,402},{399,437,399}},{{398,436,398},{402,440,402},{396,434,396}},{{399,437,399},{403,441,403},{400,438,400}},{{402,440,402},{403,441,403},{399,437,399}},{{400,438,400},{404,442,404},{401,439,401}},{{403,441,403},{404,442,404},{400,438,400}},{{404,442,404},{405,443,405},{401,439,401}},{{402,444,402},{406,445,406},{403,446,403}},{{406,445,406},{402,444,402},{398,447,398}},{{405,448,405},{404,449,404},{407,450,407}},{{408,451,408},{405,448,405},{407,450,407}},{{403,446,403},{409,452,409},{404,449,404}},{{409,452,409},{407,450,407},{404,449,404}},{{406,445,406},{409,452,409},{403,446,403}},{{407,450,407},{410,453,410},{408,451,408}},{{407,450,407},{409,452,409},{410,453,410}},{{410,453,410},{411,454,411},{408,451,408}},{{411,454,411},{410,453,410},{412,455,412}},{{410,453,410},{413,456,413},{412,455,412}},{{412,455,412},{413,456,413},{414,457,414}},{{409,452,409},{415,458,415},{410,453,410}},{{410,453,410},{415,458,415},{413,456,413}},{{416,459,416},{415,458,415},{409,452,409}},{{406,445,406},{416,459,416},{409,452,409}},{{415,458,415},{417,460,417},{413,456,413}},{{415,458,415},{416,459,416},{417,460,417}},{{413,456,413},{418,461,418},{414,457,414}},{{413,456,413},{417,460,417},{418,461,418}},{{418,461,418},{419,462,419},{414,457,414}},{{416,459,416},{406,445,406},{420,463,420}},{{420,463,420},{406,445,406},{398,447,398}},{{420,463,420},{398,447,398},{397,464,397}},{{419,462,419},{418,461,418},{421,465,421}},{{422,466,422},{419,462,419},{421,465,421}},{{422,466,422},{421,465,421},{423,467,423}},{{424,468,424},{420,463,420},{397,464,397}},{{424,468,424},{397,464,397},{386,469,386}},{{425,470,425},{416,459,416},{420,463,420}},{{425,470,425},{420,463,420},{424,468,424}},{{426,471,426},{416,459,416},{425,470,425}},{{416,459,416},{426,471,426},{417,460,417}},{{427,472,427},{424,468,424},{386,469,386}},{{427,472,427},{386,469,386},{382,420,382}},{{360,392,360},{427,472,427},{382,420,382}},{{428,473,428},{425,470,425},{424,468,424}},{{428,473,428},{424,468,424},{427,472,427}},{{429,474,429},{427,472,427},{360,392,360}},{{429,474,429},{428,473,428},{427,472,427}},{{353,385,353},{429,474,429},{360,392,360}},{{351,383,351},{429,474,429},{353,385,353}},{{351,383,351},{430,475,430},{429,474,429}},{{430,475,430},{428,473,428},{429,474,429}},{{349,381,349},{430,475,430},{351,383,351}},{{431,476,431},{425,470,425},{428,473,428}},{{430,475,430},{431,476,431},{428,473,428}},{{431,476,431},{426,471,426},{425,470,425}},{{349,381,349},{432,477,432},{430,475,430}},{{432,477,432},{431,476,431},{430,475,430}},{{347,379,347},{432,477,432},{349,381,349}},{{433,478,433},{426,471,426},{431,476,431}},{{432,477,432},{433,478,433},{431,476,431}},{{426,471,426},{433,478,433},{417,460,417}},{{347,379,347},{434,479,434},{432,477,432}},{{434,479,434},{433,478,433},{432,477,432}},{{345,378,345},{434,479,434},{347,379,347}},{{433,478,433},{435,480,435},{417,460,417}},{{417,460,417},{435,480,435},{418,461,418}},{{418,461,418},{435,480,435},{421,465,421}},{{435,480,435},{433,478,433},{436,481,436}},{{435,480,435},{436,481,436},{421,465,421}},{{433,478,433},{434,479,434},{436,481,436}},{{434,479,434},{345,378,345},{437,482,437}},{{436,481,436},{434,479,434},{437,482,437}},{{437,483,437},{345,375,345},{344,374,344}},{{421,465,421},{436,481,436},{438,484,438}},{{436,481,436},{437,482,437},{438,484,438}},{{421,465,421},{438,484,438},{423,467,423}},{{439,485,439},{423,486,423},{438,487,438}},{{344,374,344},{440,488,440},{437,483,437}},{{440,488,440},{438,487,438},{437,483,437}},{{440,488,440},{439,485,439},{438,487,438}},{{342,372,342},{440,488,440},{344,374,344}},{{342,372,342},{439,485,439},{440,488,440}},{{441,489,441},{442,490,442},{443,491,443}},{{444,492,444},{441,489,441},{443,491,443}},{{443,491,443},{445,493,445},{444,492,444}},{{444,492,444},{446,494,446},{441,489,441}},{{446,494,446},{447,495,447},{441,489,441}},{{445,493,445},{448,496,448},{444,492,444}},{{446,494,446},{449,497,449},{447,495,447}},{{449,497,449},{450,498,450},{447,495,447}},{{450,498,450},{449,497,449},{451,499,451}},{{452,500,452},{446,494,446},{444,492,444}},{{448,496,448},{452,500,452},{444,492,444}},{{448,496,448},{445,493,445},{453,501,453}},{{448,496,448},{453,501,453},{452,500,452}},{{445,493,445},{454,502,454},{453,501,453}},{{452,500,452},{455,503,455},{446,494,446}},{{455,503,455},{449,497,449},{446,494,446}},{{453,501,453},{456,504,456},{452,500,452}},{{452,500,452},{456,504,456},{455,503,455}},{{453,505,453},{454,506,454},{457,507,457}},{{453,505,453},{457,507,457},{456,508,456}},{{454,506,454},{458,509,458},{457,507,457}},{{456,504,456},{459,510,459},{455,503,455}},{{457,507,457},{458,509,458},{460,511,460}},{{458,509,458},{461,512,461},{460,511,460}},{{457,507,457},{462,513,462},{456,508,456}},{{457,507,457},{460,511,460},{462,513,462}},{{456,508,456},{462,513,462},{459,514,459}},{{460,511,460},{461,512,461},{463,515,463}},{{464,516,464},{460,511,460},{463,515,463}},{{463,515,463},{465,517,465},{464,516,464}},{{460,511,460},{466,518,466},{462,513,462}},{{460,511,460},{464,516,464},{466,518,466}},{{465,517,465},{467,519,467},{464,516,464}},{{467,519,467},{465,517,465},{468,520,468}},{{464,516,464},{469,521,469},{466,518,466}},{{464,516,464},{467,519,467},{469,521,469}},{{462,513,462},{466,518,466},{470,522,470}},{{462,513,462},{470,522,470},{459,514,459}},{{466,518,466},{469,521,469},{471,523,471}},{{466,518,466},{471,523,471},{470,522,470}},{{467,519,467},{472,524,472},{469,521,469}},{{473,525,473},{467,519,467},{468,520,468}},{{467,519,467},{473,525,473},{472,524,472}},{{473,525,473},{468,520,468},{474,526,474}},{{469,521,469},{472,524,472},{475,527,475}},{{469,521,469},{475,527,475},{471,523,471}},{{473,525,473},{476,528,476},{472,524,472}},{{472,524,472},{477,529,477},{475,527,475}},{{472,524,472},{476,528,476},{477,529,477}},{{471,523,471},{475,527,475},{478,530,478}},{{475,527,475},{477,529,477},{479,531,479}},{{475,527,475},{479,531,479},{478,530,478}},{{471,523,471},{478,530,478},{480,532,480}},{{470,522,470},{471,523,471},{480,532,480}},{{478,530,478},{479,531,479},{481,533,481}},{{470,522,470},{480,532,480},{482,534,482}},{{459,514,459},{470,522,470},{482,534,482}},{{480,532,480},{478,530,478},{483,535,483}},{{478,530,478},{481,533,481},{483,535,483}},{{482,534,482},{480,532,480},{484,536,484}},{{480,532,480},{483,535,483},{484,536,484}},{{459,510,459},{482,537,482},{485,538,485}},{{455,503,455},{459,510,459},{485,538,485}},{{455,503,455},{485,538,485},{449,497,449}},{{485,538,485},{482,537,482},{486,539,486}},{{482,537,482},{484,540,484},{486,539,486}},{{485,538,485},{487,541,487},{449,497,449}},{{485,538,485},{486,539,486},{487,541,487}},{{449,497,449},{487,541,487},{451,499,451}},{{451,499,451},{487,541,487},{488,542,488}},{{487,541,487},{489,543,489},{488,542,488}},{{486,539,486},{489,543,489},{487,541,487}},{{488,542,488},{489,543,489},{490,544,490}},{{486,539,486},{491,545,491},{489,543,489}},{{486,539,486},{484,540,484},{491,545,491}},{{489,543,489},{492,546,492},{490,544,490}},{{491,545,491},{492,546,492},{489,543,489}},{{490,544,490},{492,546,492},{493,547,493}},{{484,540,484},{494,548,494},{491,545,491}},{{484,536,484},{483,535,483},{494,549,494}},{{491,545,491},{495,550,495},{492,546,492}},{{491,545,491},{494,548,494},{495,550,495}},{{492,546,492},{496,551,496},{493,547,493}},{{495,550,495},{496,551,496},{492,546,492}},{{493,547,493},{496,551,496},{497,552,497}},{{483,535,483},{498,553,498},{494,549,494}},{{483,535,483},{481,533,481},{498,553,498}},{{494,548,494},{499,554,499},{495,550,495}},{{494,549,494},{498,553,498},{499,555,499}},{{495,550,495},{500,556,500},{496,551,496}},{{495,550,495},{499,554,499},{500,556,500}},{{496,551,496},{501,557,501},{497,552,497}},{{500,556,500},{501,557,501},{496,551,496}},{{497,552,497},{501,557,501},{502,558,502}},{{499,554,499},{503,559,503},{500,556,500}},{{501,557,501},{504,560,504},{502,558,502}},{{505,561,505},{502,558,502},{504,560,504}},{{500,556,500},{506,562,506},{501,557,501}},{{506,562,506},{504,560,504},{501,557,501}},{{500,556,500},{503,559,503},{506,562,506}},{{507,563,507},{505,561,505},{504,560,504}},{{507,563,507},{504,560,504},{506,562,506}},{{508,564,508},{505,561,505},{507,563,507}},{{509,565,509},{508,564,508},{507,563,507}},{{510,566,510},{507,563,507},{506,562,506}},{{509,565,509},{507,563,507},{510,566,510}},{{503,559,503},{511,567,511},{506,562,506}},{{510,566,510},{506,562,506},{511,567,511}},{{512,568,512},{509,565,509},{510,566,510}},{{509,565,509},{512,568,512},{513,569,513}},{{510,566,510},{514,570,514},{512,568,512}},{{514,570,514},{510,566,510},{511,567,511}},{{512,568,512},{515,571,515},{513,569,513}},{{514,570,514},{515,571,515},{512,568,512}},{{513,569,513},{515,571,515},{516,572,516}},{{514,573,514},{511,574,511},{517,575,517}},{{516,576,516},{515,577,515},{518,578,518}},{{519,579,519},{516,576,516},{518,578,518}},{{515,577,515},{514,573,514},{520,580,520}},{{518,578,518},{515,577,515},{520,580,520}},{{520,580,520},{514,573,514},{517,575,517}},{{519,579,519},{518,578,518},{521,581,521}},{{518,578,518},{520,580,520},{522,582,522}},{{518,578,518},{523,583,523},{521,581,521}},{{523,583,523},{518,578,518},{522,582,522}},{{523,583,523},{524,584,524},{521,581,521}},{{522,582,522},{520,580,520},{525,585,525}},{{520,580,520},{517,575,517},{525,585,525}},{{523,583,523},{522,582,522},{526,586,526}},{{522,582,522},{525,585,525},{526,586,526}},{{524,584,524},{523,583,523},{527,587,527}},{{527,587,527},{523,583,523},{526,586,526}},{{528,588,528},{524,584,524},{527,587,527}},{{528,588,528},{527,587,527},{529,589,529}},{{530,590,530},{528,588,528},{529,589,529}},{{530,590,530},{529,589,529},{531,591,531}},{{527,587,527},{526,586,526},{532,592,532}},{{529,589,529},{527,587,527},{532,592,532}},{{529,589,529},{533,593,533},{531,591,531}},{{534,594,534},{531,591,531},{533,593,533}},{{529,589,529},{532,592,532},{535,595,535}},{{533,593,533},{529,589,529},{535,595,535}},{{536,596,536},{534,594,534},{533,593,533}},{{533,593,533},{535,595,535},{536,596,536}},{{534,597,534},{536,598,536},{537,599,537}},{{532,592,532},{538,600,538},{535,595,535}},{{532,592,532},{526,586,526},{538,600,538}},{{536,598,536},{539,601,539},{537,599,537}},{{540,602,540},{537,599,537},{539,601,539}},{{535,595,535},{541,603,541},{536,596,536}},{{539,601,539},{536,598,536},{541,604,541}},{{542,605,542},{543,606,543},{540,602,540}},{{540,602,540},{539,601,539},{544,607,544}},{{544,607,544},{542,605,542},{540,602,540}},{{545,608,545},{539,601,539},{541,604,541}},{{539,601,539},{545,608,545},{544,607,544}},{{535,595,535},{546,609,546},{541,603,541}},{{538,600,538},{546,609,546},{535,595,535}},{{545,608,545},{541,604,541},{547,610,547}},{{546,609,546},{547,611,547},{541,603,541}},{{545,608,545},{548,612,548},{544,607,544}},{{548,612,548},{545,608,545},{547,610,547}},{{542,605,542},{544,607,544},{549,613,549}},{{548,612,548},{549,613,549},{544,607,544}},{{550,614,550},{542,605,542},{549,613,549}},{{548,612,548},{547,610,547},{551,615,551}},{{551,616,551},{547,611,547},{546,609,546}},{{549,613,549},{548,612,548},{552,617,552}},{{552,617,552},{548,612,548},{551,615,551}},{{550,614,550},{549,613,549},{553,618,553}},{{553,618,553},{549,613,549},{552,617,552}},{{554,619,554},{550,614,550},{553,618,553}},{{555,620,555},{551,616,551},{546,609,546}},{{555,620,555},{546,609,546},{538,600,538}},{{554,619,554},{553,618,553},{556,621,556}},{{557,622,557},{554,619,554},{556,621,556}},{{553,618,553},{552,617,552},{558,623,558}},{{556,621,556},{553,618,553},{558,623,558}},{{552,617,552},{551,615,551},{559,624,559}},{{558,623,558},{552,617,552},{559,624,559}},{{559,625,559},{551,616,551},{555,620,555}},{{557,622,557},{556,621,556},{560,626,560}},{{561,627,561},{557,622,557},{560,626,560}},{{556,621,556},{558,623,558},{562,628,562}},{{560,626,560},{556,621,556},{562,628,562}},{{558,623,558},{559,624,559},{563,629,563}},{{562,628,562},{558,623,558},{563,629,563}},{{561,627,561},{560,626,560},{564,630,564}},{{565,631,565},{561,627,561},{564,630,564}},{{560,626,560},{562,628,562},{566,632,566}},{{564,630,564},{560,626,560},{566,632,566}},{{565,631,565},{564,630,564},{567,633,567}},{{568,634,568},{565,631,565},{567,633,567}},{{564,630,564},{566,632,566},{569,635,569}},{{567,633,567},{564,630,564},{569,635,569}},{{566,632,566},{562,628,562},{570,636,570}},{{562,628,562},{563,629,563},{570,636,570}},{{568,634,568},{567,633,567},{571,637,571}},{{572,638,572},{568,634,568},{571,637,571}},{{571,637,571},{567,633,567},{573,639,573}},{{567,633,567},{569,635,569},{573,639,573}},{{572,638,572},{571,637,571},{574,640,574}},{{574,640,574},{571,637,571},{573,639,573}},{{575,641,575},{572,638,572},{574,640,574}},{{569,635,569},{566,632,566},{576,642,576}},{{566,632,566},{570,636,570},{576,642,576}},{{575,641,575},{574,640,574},{577,643,577}},{{578,644,578},{575,641,575},{577,643,577}},{{578,644,578},{577,643,577},{579,645,579}},{{577,643,577},{580,646,580},{579,645,579}},{{580,646,580},{577,643,577},{581,647,581}},{{577,643,577},{582,648,582},{581,647,581}},{{577,643,577},{574,640,574},{582,648,582}},{{581,647,581},{582,648,582},{474,649,474}},{{574,640,574},{583,650,583},{582,648,582}},{{583,650,583},{574,640,574},{573,639,573}},{{582,648,582},{584,651,584},{474,649,474}},{{582,648,582},{583,650,583},{584,651,584}},{{584,652,584},{473,525,473},{474,526,474}},{{583,650,583},{585,653,585},{584,651,584}},{{584,652,584},{585,654,585},{473,525,473}},{{583,650,583},{573,639,573},{585,653,585}},{{585,654,585},{476,528,476},{473,525,473}},{{573,639,573},{586,655,586},{585,653,585}},{{585,654,585},{586,656,586},{476,528,476}},{{573,639,573},{569,635,569},{586,655,586}},{{569,635,569},{576,642,576},{586,655,586}},{{586,656,586},{587,657,587},{476,528,476}},{{476,528,476},{587,657,587},{477,529,477}},{{586,656,586},{576,658,576},{588,659,588}},{{587,657,587},{586,656,586},{588,659,588}},{{477,529,477},{587,657,587},{589,660,589}},{{587,657,587},{588,659,588},{589,660,589}},{{477,529,477},{589,660,589},{479,531,479}},{{588,659,588},{576,658,576},{590,661,590}},{{576,658,576},{570,662,570},{590,661,590}},{{589,660,589},{588,659,588},{591,663,591}},{{588,659,588},{590,661,590},{591,663,591}},{{479,531,479},{589,660,589},{592,664,592}},{{589,660,589},{591,663,591},{592,664,592}},{{479,531,479},{592,664,592},{481,533,481}},{{590,661,590},{570,662,570},{593,665,593}},{{570,662,570},{563,666,563},{593,665,593}},{{591,663,591},{590,661,590},{594,667,594}},{{590,661,590},{593,665,593},{594,667,594}},{{592,664,592},{591,663,591},{595,668,595}},{{591,663,591},{594,667,594},{595,668,595}},{{481,533,481},{592,664,592},{596,669,596}},{{592,664,592},{595,668,595},{596,669,596}},{{481,533,481},{596,669,596},{498,553,498}},{{595,668,595},{594,667,594},{597,670,597}},{{498,553,498},{596,669,596},{598,671,598}},{{498,553,498},{598,671,598},{499,555,499}},{{499,555,499},{598,671,598},{503,672,503}},{{596,669,596},{595,668,595},{599,673,599}},{{596,669,596},{599,673,599},{598,671,598}},{{595,668,595},{597,670,597},{599,673,599}},{{598,671,598},{600,674,600},{503,672,503}},{{598,671,598},{599,673,599},{600,674,600}},{{503,672,503},{600,674,600},{511,574,511}},{{600,674,600},{517,575,517},{511,574,511}},{{599,673,599},{601,675,601},{600,674,600}},{{600,674,600},{601,675,601},{517,575,517}},{{599,673,599},{597,670,597},{601,675,601}},{{601,675,601},{525,585,525},{517,575,517}},{{597,670,597},{602,676,602},{601,675,601}},{{601,675,601},{602,676,602},{525,585,525}},{{594,667,594},{603,677,603},{597,670,597}},{{597,670,597},{603,677,603},{602,676,602}},{{594,667,594},{593,665,593},{603,677,603}},{{602,676,602},{604,678,604},{525,585,525}},{{525,585,525},{604,678,604},{526,586,526}},{{526,586,526},{604,678,604},{538,600,538}},{{602,676,602},{605,679,605},{604,678,604}},{{605,679,605},{538,600,538},{604,678,604}},{{603,677,603},{605,679,605},{602,676,602}},{{605,679,605},{555,620,555},{538,600,538}},{{603,677,603},{606,680,606},{605,679,605}},{{606,680,606},{555,620,555},{605,679,605}},{{593,665,593},{606,680,606},{603,677,603}},{{606,680,606},{559,625,559},{555,620,555}},{{593,665,593},{563,666,563},{606,680,606}},{{563,666,563},{559,625,559},{606,680,606}}}}
--[[ --=====================================================================================================-- Script Name: Replace Weapon Projectile (v1.1), for SAPP (PC & CE) Description: This script will allow you to swap weapon projectiles for substitute projectiles NOTE: The replacement projectile will still appear as the original projectile (but function properly). Changes in v1.1: - Added grenades and damage multipliers to the projectile table. - Updated Tag lookup function. Copyright (c) 2019, Jericho Crosby <[email protected]> * Notice: You can use this document subject to the following conditions: https://github.com/Chalwk77/Halo-Scripts-Phasor-V2-/blob/master/LICENSE * Written by Jericho Crosby (Chalwk) --=====================================================================================================-- ]]-- api_version = "1.12.0.0" local projectiles = {} -- Configuration [starts] ------------------------------------------------------ projectiles = { -- ORIGINAL TAG REPLACEMENT TAG DAMAGE MULTIPLIER (normal is 1, max 10) [1] = { "vehicles\\banshee\\banshee bolt", "vehicles\\banshee\\banshee bolt", 1}, [2] = { "vehicles\\banshee\\mp_banshee fuel rod", "vehicles\\banshee\\mp_banshee fuel rod", 1}, [3] = { "vehicles\\c gun turret\\mp gun turret", "vehicles\\c gun turret\\mp gun turret", 1}, [4] = { "vehicles\\ghost\\ghost bolt", "vehicles\\ghost\\ghost bolt", 1}, [5] = { "vehicles\\scorpion\\bullet", "vehicles\\scorpion\\bullet", 1}, [6] = { "vehicles\\scorpion\\tank shell", "vehicles\\scorpion\\tank shell", 1}, [7] = { "vehicles\\warthog\\bullet", "vehicles\\warthog\\bullet", 1}, [8] = { "weapons\\assault rifle\\bullet", "weapons\\assault rifle\\bullet", 1}, [9] = { "weapons\\flamethrower\\flame", "weapons\\flamethrower\\flame", 1}, [10] = { "weapons\\needler\\mp_needle", "weapons\\needler\\mp_needle", 1}, [11] = { "weapons\\pistol\\bullet", "weapons\\pistol\\bullet", 1}, [12] = { "weapons\\plasma pistol\\bolt", "weapons\\plasma pistol\\bolt", 1}, [13] = { "weapons\\plasma rifle\\bolt", "weapons\\plasma rifle\\bolt", 1}, [14] = { "weapons\\plasma rifle\\charged bolt", "weapons\\plasma rifle\\charged bolt", 1}, [15] = { "weapons\\rocket launcher\\rocket", "weapons\\rocket launcher\\rocket", 1}, [16] = { "weapons\\shotgun\\pellet", "weapons\\shotgun\\pellet", 1}, [17] = { "weapons\\sniper rifle\\sniper bullet", "weapons\\sniper rifle\\sniper bullet", 1}, [18] = { "weapons\\plasma_cannon\\plasma_cannon", "weapons\\plasma_cannon\\plasma_cannon", 1}, -- grenades -- [19] = { "weapons\\frag grenade\\frag grenade", "weapons\\frag grenade\\frag grenade", 1}, [20] = { "weapons\\plasma grenade\\plasma grenade", "weapons\\plasma grenade\\plasma grenade", 1}, [21] = { "weapons\\frag grenade\\explosion", "weapons\\frag grenade\\explosion", 1}, [22] = { "weapons\\plasma grenade\\attached", "weapons\\plasma grenade\\attached", 1}, [23] = { "weapons\\plasma grenade\\explosion", "weapons\\plasma grenade\\explosion", 1}, -- See example below to lean how to swap the "sniper bullet" for "tank shell": ------- Change the following ------- -- from: [17] = { "weapons\\sniper rifle\\sniper bullet", "weapons\\sniper rifle\\sniper bullet"}, -- to: [17] = { "weapons\\sniper rifle\\sniper bullet", "vehicles\\scorpion\\tank shell"}, } -- Configuration [ends] -------------------------------------------------------- function OnScriptLoad() register_callback(cb['EVENT_OBJECT_SPAWN'], "OnObjectSpawn") register_callback(cb['EVENT_DAMAGE_APPLICATION'], "OnDamageApplication") end local function getTag(a, b) local tag = lookup_tag(a, b) return tag ~= 0 and read_dword(tag + 0xC) or nil end function OnObjectSpawn(PlayerIndex, MapID, ParentID, ObjectID) if (PlayerIndex) then for i = 1, #projectiles do local original = projectiles[i][1] local replacement = projectiles[i][2] if (MapID == getTag("proj", original)) then return true, getTag("proj", replacement) end end end end function OnDamageApplication(ReceiverIndex, CauserIndex, MetaID, Damage, HitString, Backtap) if tonumber(CauserIndex) > 0 then for i = 1, #projectiles do local repl, mul = projectiles[i][2], projectiles[i][3] if (MetaID == getTag("jpt!", repl)) then return true, Damage * mul end end end end
------------------------------------------------------------------------ -- Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. -- -- Permission is hereby granted, free of charge, to any person obtaining -- a copy of this software and associated documentation files (the -- "Software"), to deal in the Software without restriction, including -- without limitation the rights to use, copy, modify, merge, publish, -- distribute, sublicense, and/or sell copies of the Software, and to -- permit persons to whom the Software is furnished to do so, subject to -- the following conditions: -- -- The above copyright notice and this permission notice shall be -- included in all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------ -- Mathematical Functions http://www.lua.org/manual/5.3/manual.html#6.7 -- This library provides basic mathematical functions. It provides all its functions and constants inside the table math. Functions with the annotation "integer/float" give integer results for integer arguments and float results for float (or mixed) arguments. Rounding functions (math.ceil, math.floor, and math.modf) return an integer when the result fits in the range of an integer, or a float otherwise. math = {} -- The value of π. math.pi = 3.1415 -- An integer with the minimum value for an integer. math.mininteger = nil -- Returns the absolute value of x. (integer/float) function math.abs(x) return 0 end -- Returns the arc cosine of x (in radians). function math.acos(x) return 0 end -- Returns the arc sine of x (in radians). function math.asin(x) return 0 end -- Returns the arc tangent of y/x (in radians), but uses the signs of both arguments to find the quadrant of the result. (It also handles correctly the case of x being zero.) -- The default value for x is 1, so that the call math.atan(y) returns the arc tangent of y. function math.atan(y, x) return 0 end -- Returns the smallest integral value larger than or equal to x. function math.ceil(x) return 0 end -- Returns the cosine of x (assumed to be in radians). function math.cos(x) return 0 end -- Converts the angle x from radians to degrees. function math.deg(x) return 0 end --- Returns the value e^x (where e is the base of natural logarithms). function math.exp(x) end -- Returns the largest integral value smaller than or equal to x. function math.floor(x) end -- Returns the remainder of the division of x by y that rounds the quotient towards zero. (integer/float) function math.fmod(x, y) end -- The float value HUGE_VAL, a value larger than any other numeric value. math.huge = nil -- Returns the logarithm of x in the given base. The default for base is e (so that the function returns the natural logarithm of x). function math.log(x, base) end -- Returns the argument with the maximum value, according to the Lua operator <. (integer/float) function math.max(x, ...) end -- An integer with the maximum value for an integer. math.maxinteger = nil -- Returns the argument with the minimum value, according to the Lua operator <. (integer/float) function math.min(x, ...) end -- Returns the integral part of x and the fractional part of x. Its second result is always a float. function math.modf(x) end -- Converts the angle x from degrees to radians. function math.rad(x) end -- When called without arguments, returns a pseudo-random float with uniform distribution in the range [0,1). When called with two integers m and n, math.random returns a pseudo-random integer with uniform distribution in the range [m, n]. (The value n-m cannot be negative and must fit in a Lua integer.) The call math.random(n) is equivalent to math.random(1,n). -- This function is an interface to the underling pseudo-random generator function provided by C. function math.random(m, n) end -- Sets x as the "seed" for the pseudo-random generator: equal seeds produce equal sequences of numbers. function math.randomseed(x) end -- Returns the sine of x (assumed to be in radians). function math.sin(x) return 0 end -- Returns the square root of x. (You can also use the expression x^0.5 to compute this value.) function math.sqrt(x) return 0 end -- Returns the tangent of x (assumed to be in radians). function math.tan(x) return 0 end -- If the value x is convertible to an integer, returns that integer. Otherwise, returns nil. function math.tointeger(x) end -- Returns "integer" if x is an integer, "float" if it is a float, or nil if x is not a number. function math.type(x) end -- Returns a boolean, true if and only if integer m is below integer n when they are compared as unsigned integers. function math.ult(m, n) end
--------------------------------------------------------------- -- Flyout.lua: Flyout frame --------------------------------------------------------------- -- Adds custom frames to deal with multi-choice spell-casting, -- such as portals/teleports, totems, pets, etc. local _, db = ... if not SpellFlyout then return end local Flyout, Selector, GameTooltip = SpellFlyout, ConsolePortSpellFlyout, GameTooltip local FadeIn = db.UIFrameFadeIn --------------------------------------------------------------- do local Buttons = { Up = 'CP_L_UP', Down = 'CP_L_DOWN', Left = 'CP_L_LEFT', Right = 'CP_L_RIGHT', } ----------------------------------------------------------- Selector:Execute([[ Index = 1 DPAD = newtable() ]]) for name, binding in pairs(Buttons) do Selector:Execute(format('DPAD.%s = \'%s\'', binding, name)) end end --------------------------------------------------------------- Selector.Buttons = {} Selector:SetFrameRef('Flyout', Flyout) Selector:Execute([[ Visible = 0 Spells = newtable() Flyout = self:GetFrameRef('Flyout') Selector = self ]]) Selector:SetAttribute('SelectSpell', [[ local key = ... if key == 'Up' then self:SetAttribute('macrotext', '/click '..Spells[Index]:GetName()) elseif key == 'Down' then local owner = Flyout:GetParent() owner:Hide() owner:Show() return elseif key == 'Left' then Index = Index > 1 and Index - 1 or Index elseif key == 'Right' then Index = Index < Visible and Index + 1 or Index end self:SetAttribute('index', Index) ]]) Selector:SetAttribute('ShowSpells', [[ Spells = newtable(Flyout:GetChildren()) for i, spell in pairs(Spells) do if spell:IsVisible() then Visible = i end end self:SetWidth(Visible * 74) if not Spells[Index]:IsVisible() then Index = 1 self:SetAttribute('index', Index) end ]]) Selector:WrapScript(Flyout, 'OnShow', [[ Selector:SetAttribute('macrotext', nil) Selector:Show() Flyout:ClearAllPoints() for binding, name in pairs(DPAD) do local key = GetBindingKey(binding) if key then Selector:SetBindingClick(true, key, Selector, name) end end Selector:RunAttribute('ShowSpells') local parentName = Flyout:GetParent():GetName() if parentName and parentName:match('CPB') then Flyout:SetScale(0.01) Flyout:SetAlpha(0) end ]]) Selector:WrapScript(Flyout, 'OnHide', [[ Selector:ClearBindings() Selector:Hide() Flyout:SetScale(1) Flyout:SetAlpha(1) ]]) Selector:WrapScript(Selector, 'PreClick', [[ self:SetAttribute('macrotext', nil) if (button == 'LeftButton' or button == 'RightButton') then local x = self:GetMousePosition() local width = self:GetWidth() local newIndex = math.floor(1 + ((x * width) / 74)) if newIndex <= Visible and newIndex >= 1 then Index = newIndex self:SetAttribute('index', Index) self:SetAttribute('macrotext', '/click '..Spells[Index]:GetName()) end else self:RunAttribute('SelectSpell', button) end ]]) local function ShowFlyoutTooltip(self) GameTooltip:SetOwner(self, 'ANCHOR_TOP', 0, 0) GameTooltip:SetSpellByID(self.spellID) end function Selector:SetSelection(index) for i, button in pairs(self.Buttons) do button:UnlockHighlight() FadeIn(button, 0.2, button:GetAlpha(), 1 - (abs(i - index) / #self.Buttons)) end local selected = self.Buttons[index] if selected then selected:LockHighlight() ShowFlyoutTooltip(selected) end end function Selector:OnShow() db.Hint:DisplayMessage(format(db.TOOLTIP.FLYOUT, BINDING_NAME_CP_L_UP, BINDING_NAME_CP_L_DOWN), 4, -200) for i, spell in pairs({Flyout:GetChildren()}) do local button = self.Buttons[i] if spell:IsVisible() then if not button then button = db.Atlas.GetRoundActionButton('$parentFlyoutButton'..i, false, self, nil, nil, true) button:SetButtonState('DISABLED') button:SetID(i) self.Buttons[i] = button end button.icon:SetTexture(spell.icon:GetTexture()) button.spellID = spell.spellID button:SetPoint('LEFT', (i-1) * 74, 0) button:Show() local time, cooldown = GetSpellCooldown(spell.spellName) if time and cooldown then button.cooldown:SetCooldown(time, cooldown) end elseif button and button:IsVisible() then button:Hide() end end self:SetSelection(self:GetAttribute('index') or 1) end function Selector:OnHide() GameTooltip:Hide() end function Selector:OnAttributeChanged(attribute, detail) if attribute == 'index' then self:SetSelection(detail) end end --------------------------------------------------------------- Selector:HookScript('OnShow', Selector.OnShow) Selector:HookScript('OnHide', Selector.OnHide) Selector:HookScript('OnAttributeChanged', Selector.OnAttributeChanged) --------------------------------------------------------------- -- add class colors do local red, green, blue = db.Atlas.GetCC() Selector.BG:SetVertexColor(red, green, blue, 0.25) Selector.TopLine:SetVertexColor(red, green, blue, 1) Selector.BottomLine:SetVertexColor(red, green, blue, 1) end
require "lib.classes.class" local json = require("lib.file.json.json") local DictFile = require("lib.file.DictFile") -------------------------------------------------------------------------------------------------------- -- class: JsonDictFile -- param: path:str -> the path of the file serving as a dictionary -- An object to manage json files that contain dictionaries local JsonDictFile = extend(DictFile, function(self, path) -- Try opening the file if pcall(function() json.decode(love.filesystem.read(path)) end) then -- If the file was opened load the file self.dict = json.decode(love.filesystem.read(self.path)) else -- Create a new file with an empty json dictionary otherwise love.filesystem.write(path, "{}") -- Assign the dictionary to a new empty dictionary self.dict = {} end end, function(path) return DictFile.new(path) end) -- load: None -> None -- loads the dictionary in the file in the local field function JsonDictFile.load(self) self.dict = json.decode(love.filesystem.read(self.path)) end -- save: None -> None -- saves the dictionary field in the file function JsonDictFile.save(self) love.filesystem.write(self.path, json.encode(self.dict)) end return JsonDictFile
if data.raw['resource-category'] then data:extend( { { name = 'mi-advanced', type = 'resource-category' }, { name = 'mi-basic', type = 'resource-category' } } ) end
include("shared.lua") local lib = include("psychedelics/libs/cl/ents_cl.lua") function ENT:Draw() self:DrawModel() end local tipText = "Press 'e' to use or 'e'+'shift' to add for selling" function ENT:DrawTranslucent() self:Draw(flags) if lib.checkTip(tipText, self) then lib.draw3D2DTip(tipText, self) end end
local wibox = require("wibox") local screen = require("awful.screen") local helper = require("utils.helper") local button = require("awful.button") local table = require("gears.table") local widget = require("utils.widget") local modal = {} function modal:init(s) self.screen = s or screen.focused() self.height = screen.focused().geometry.height self.w = wibox({ x = 0, y = 0, visible = false, ontop = true, type = "splash", screen = self.screen }) self.w.bg = M.x.on_surface .. "0A" -- 4% self.w.width = screen.focused().geometry.width self.w.height = self.height return self.w end function modal:add_buttons(f) if type(f) ~= "function" then return end self.w:buttons(table.join( button({}, 2, function() f() end), -- middle click button({}, 3, function() f() end) -- right click )) end -- place a widget at the center of the focused screen function modal:run_center(w) self.w:setup { nil, { { nil, { { widget.centered(w, 'vertical'), margins = 18, widget = wibox.container.margin }, shape = helper.rrect(18), widget = wibox.container.background }, nil, expand = "none", layout = wibox.layout.align.horizontal }, layout = wibox.layout.fixed.vertical }, nil, expand = "none", layout = wibox.layout.align.vertical } end function modal:run_left(w) self.w:setup { nil, { { w, forced_height = self.height, widget = wibox.container.background }, nil, nil, expand = "none", layout = wibox.layout.align.horizontal }, expand = "none", layout = wibox.layout.align.vertical } end return setmetatable({}, { __index = modal })
local perlin_2d_module = require("perlin2d") local perlin2d = perlin_2d_module.perlin2d perlin_2d_module.seed = os.time() for y = 0, 29, 1 do for x = 0, 59, 1 do if (perlin2d(x/30, y/30)) > 0 then io.write(1) else io.write(0) end end io.write("\n") end
local map = require '_.utils.map' local M = {} function M.get_icon(icon_name) local ICONS = { paste = '⍴', spell = '✎', branch = vim.env.PURE_GIT_BRANCH ~= '' and vim.fn.trim( vim.env.PURE_GIT_BRANCH ) or ' ', error = '×', info = '●', warn = '!', hint = '›', lock = '', success = ' ', -- success = ' ' } return ICONS[icon_name] or '' end function M.get_color(synID, what, mode) return vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID(synID)), what, mode) end function M.t(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end function M.urlencode(str) str = string.gsub( str, "([^0-9a-zA-Z !'()*._~-])", -- locale independent function(c) return string.format('%%%02X', string.byte(c)) end ) str = string.gsub(str, ' ', '%%20') return str end function M.plugin_installed(name) local has_packer = pcall(require, 'packer') if not has_packer then return end return has_packer and packer_plugins ~= nil and packer_plugins[name] end function M.plugin_loaded(name) return M.plugin_installed(name) and packer_plugins[name].loaded end function M.notify(msg, level) vim.notify(msg, level or vim.log.levels.INFO, { title = ':: Local ::' }) end function M.plaintext() vim.cmd [[setlocal spell]] vim.cmd [[setlocal linebreak]] vim.cmd [[setlocal nolist]] vim.cmd [[setlocal wrap]] if vim.bo.filetype == 'gitcommit' then -- Git commit messages body are constraied to 72 characters vim.cmd [[setlocal textwidth=72]] else vim.cmd [[setlocal textwidth=0]] vim.cmd [[setlocal wrapmargin=0]] end -- Break undo sequences into chunks (after punctuation); see: `:h i_CTRL-G_u` -- https://twitter.com/vimgifs/status/913390282242232320 map.inoremap('.', '.<c-g>u', { buffer = true }) map.inoremap('?', '?<c-g>u', { buffer = true }) map.inoremap('!', '!<c-g>u', { buffer = true }) map.inoremap(',', ',<c-g>u', { buffer = true }) end return M
------------------------------------------------------------------------------- -- Coroutine safe xpcall and pcall versions -- -- Encapsulates the protected calls with a coroutine based loop, so errors can -- be dealed without the usual Lua 5.x pcall/xpcall issues with coroutines -- yielding inside the call to pcall or xpcall. -- -- Authors: Roberto Ierusalimschy and Andre Carregal -- Contributors: Thomas Harning Jr., Ignacio Burgueño, Fabio Mascarenhas -- -- Copyright 2005 - Kepler Project -- -- $Id: coxpcall.lua,v 1.13 2008/05/19 19:20:02 mascarenhas Exp $ ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Checks if (x)pcall function is coroutine safe ------------------------------------------------------------------------------- local function isCoroutineSafe(func) local co = coroutine.create(function() return func(coroutine.yield, function() end) end) coroutine.resume(co) return coroutine.resume(co) end -- No need to do anything if pcall and xpcall are already safe. local copcall, coxpcall if isCoroutineSafe(pcall) and isCoroutineSafe(xpcall) then copcall = pcall coxpcall = xpcall return { pcall = pcall, xpcall = xpcall, running = coroutine.running } end ------------------------------------------------------------------------------- -- Implements xpcall with coroutines ------------------------------------------------------------------------------- local performResume, handleReturnValue local oldpcall, oldxpcall = pcall, xpcall local pack = table.pack or function(...) return {n = select("#", ...), ...} end local unpack = table.unpack or unpack local running = coroutine.running local coromap = setmetatable({}, { __mode = "k" }) function handleReturnValue(err, co, status, ...) if not status then return false, err(debug.traceback(co, (...)), ...) end if coroutine.status(co) == 'suspended' then return performResume(err, co, coroutine.yield(...)) else return true, ... end end function performResume(err, co, ...) return handleReturnValue(err, co, coroutine.resume(co, ...)) end local function id(trace, ...) return trace end function coxpcall(f, err, ...) local current = running() if not current then if err == id then return oldpcall(f, ...) else if select("#", ...) > 0 then local oldf, params = f, pack(...) f = function() return oldf(unpack(params, 1, params.n)) end end return oldxpcall(f, err) end else local res, co = oldpcall(coroutine.create, f) if not res then local newf = function(...) return f(...) end co = coroutine.create(newf) end coromap[co] = current return performResume(err, co, ...) end end local function corunning(coro) if coro ~= nil then assert(type(coro)=="thread", "Bad argument; expected thread, got: "..type(coro)) else coro = running() end while coromap[coro] do coro = coromap[coro] end if coro == "mainthread" then return nil end return coro end ------------------------------------------------------------------------------- -- Implements pcall with coroutines ------------------------------------------------------------------------------- function copcall(f, ...) return coxpcall(f, id, ...) end return { pcall = copcall, xpcall = coxpcall, running = corunning }
me = game.Players.acb227.Character pcall(function() me.Johnsen:remove() end) mod = Instance.new("Model") mod.Name = "Johnsen" mod.Parent = me part = Instance.new("Part") part.Parent = mod part.Size = Vector3.new(1, 1, 1) part.Position = Vector3.new(1, 1, 1) part.BrickColor = BrickColor.new("Light orange") part:BreakJoints() mesh = Instance.new("SpecialMesh") mesh.Parent = part mesh.MeshType = "Sphere" mesh.Scale = Vector3.new(0.5, 0.5, 0.5) we = Instance.new("Weld") we.Parent = mod we.Part0 = part we.Part1 = me.Torso we.C0 = CFrame.fromEulerAnglesXYZ(0.15, 0, 0) + Vector3.new(0.15, 1.25, 0.75) we.C1 = CFrame.new() part = Instance.new("Part") part.Parent = mod part.Size = Vector3.new(1, 1, 1) part.Position = Vector3.new(1, 1, 1) part.BrickColor = BrickColor.new("Light orange") part:BreakJoints() mesh = Instance.new("SpecialMesh") mesh.Parent = part mesh.MeshType = "Sphere" mesh.Scale = Vector3.new(0.5, 0.5, 0.5) we = Instance.new("Weld") we.Parent = mod we.Part0 = part we.Part1 = me.Torso we.C0 = CFrame.fromEulerAnglesXYZ(0.15, 0, 0) + Vector3.new(-0.15, 1.25, 0.75) we.C1 = CFrame.new() part2 = Instance.new("Part") part2.Parent = mod part2.Size = Vector3.new(1, 6, 1) part2.Position = Vector3.new(1, 1, 1) part2.BrickColor = BrickColor.new("Light orange") part2:BreakJoints() mesh3 = Instance.new("SpecialMesh") mesh3.Parent = part2 mesh3.MeshType = "Head" mesh3.Scale = Vector3.new(0.5, 1, 0.5) we3 = Instance.new("Weld") we3.Parent = mod we3.Part0 = part2 we3.Part1 = me.Torso we3.C0 = CFrame.fromEulerAnglesXYZ(1, 0, 0) + Vector3.new(0, -1.6, 1.25) while true do we3.C1 = CFrame.Angles(0.25, 0, 0) wait(0.25) we3.C1 = CFrame.Angles(0.5, 0, 0) wait(0.25) we3.C1 = CFrame.Angles(0.25, 0, 0) wait(0.25) we3.C1 = CFrame.Angles(0, 0, 0) wait(0.25) we3.C1 = CFrame.Angles(-0.25, 0, 0) wait(0.25) we3.C1 = CFrame.Angles(-0.5, 0, 0) wait(0.25) we3.C1 = CFrame.Angles(-0.25, 0, 0) wait(0.25) we3.C1 = CFrame.Angles(0, 0, 0) wait(0.25) end
--[[Author: chirslotix/Pizzalol Date: 10.01.2015. Deals splash auto attack damage to nearby targets depending on distance]] function Splash( keys ) -- Variables local caster = keys.caster local target = keys.target local ability = keys.ability local radius_small = ability:GetLevelSpecialValueFor("splash_radius", 0) local radius_medium = ability:GetLevelSpecialValueFor("splash_radius", 1) local radius_big = ability:GetLevelSpecialValueFor("splash_radius", 2) local target_exists = false local splash_damage_small = ability:GetLevelSpecialValueFor("splash_damage_percent", 0) / 100 local splash_damage_medium = ability:GetLevelSpecialValueFor("splash_damage_percent", 1) / 100 local splash_damage_big = ability:GetLevelSpecialValueFor("splash_damage_percent", 2) / 100 -- Finding the units for each radius local splash_radius_small = FindUnitsInRadius(caster:GetTeam(), target:GetAbsOrigin() , nil, radius_small , DOTA_UNIT_TARGET_TEAM_ENEMY , DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, 0, 0, false) local splash_radius_medium = FindUnitsInRadius(caster:GetTeam() , target:GetAbsOrigin() , nil, radius_medium, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, 0, 0, false) local splash_radius_big = FindUnitsInRadius(caster:GetTeam(), target:GetAbsOrigin() , nil, radius_big, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, 0, 0, false) -- Initializing the damage table local damage_table = {} damage_table.attacker = caster damage_table.damage_type = DAMAGE_TYPE_PHYSICAL damage_table.damage = caster:GetAttackDamage() * splash_damage_small --loop for doing the splash damage while ignoring the original target for i,v in ipairs(splash_radius_small) do if v ~= target then damage_table.victim = v ApplyDamage(damage_table) end end --loop for doing the medium splash damage for i,v in ipairs(splash_radius_medium) do if v ~= target then --loop for checking if the found target is in the splash_radius_small for c,k in ipairs(splash_radius_small) do if v == k then target_exists = true break end end --if the target isn't in the splash_radius_small then do attack damage * splash_damage_medium if not target_exists then damage_table.damage = caster:GetAttackDamage() * splash_damage_medium damage_table.victim = v ApplyDamage(damage_table) --resets the target check else target_exists = false end end end --loop for doing the damage if targets are found in the splash_damage_big but not in the splash_damage_medium for i,v in ipairs(splash_radius_big) do if v ~= target then --loop for checking if the found target is in the splash_radius_medium for c,k in ipairs(splash_radius_medium) do if v == k then target_exists = true break end end if not target_exists then damage_table.damage = caster:GetAttackDamage() * splash_damage_big damage_table.victim = v ApplyDamage(damage_table) else target_exists = false end end end end --[[Author: Pizzalol Date: 10.01.2015. It transforms the caster into a different dragon depending on the ability level]] function Transform( keys ) local caster = keys.caster local ability = keys.ability local level = ability:GetLevel() local modifier_one = keys.modifier_one local modifier_two = keys.modifier_two local modifier_three = keys.modifier_three -- Deciding the transformation level local modifier if level == 1 then modifier = modifier_one elseif level == 2 then modifier = modifier_two else modifier = modifier_three end ability:ApplyDataDrivenModifier(caster, caster, modifier, {}) end --[[Author: Pizzalol/Noya Date: 12.01.2015. Swaps the auto attack projectile and the caster model]] function ModelSwapStart( keys ) local caster = keys.caster local model = keys.model local projectile_model = keys.projectile_model -- Saves the original model and attack capability if caster.caster_model == nil then caster.caster_model = caster:GetModelName() end caster.caster_attack = caster:GetAttackCapability() -- Sets the new model and projectile caster:SetOriginalModel(model) caster:SetRangedProjectileName(projectile_model) -- Sets the new attack type caster:SetAttackCapability(DOTA_UNIT_CAP_RANGED_ATTACK) end --[[Author: Pizzalol/Noya Date: 12.01.2015. Reverts back to the original model and attack type]] function ModelSwapEnd( keys ) local caster = keys.caster caster:SetModel(caster.caster_model) caster:SetOriginalModel(caster.caster_model) caster:SetAttackCapability(caster.caster_attack) end --[[Author: Noya Used by: Pizzalol Date: 12.01.2015. Hides all dem hats ]] function HideWearables( event ) local hero = event.caster local ability = event.ability local duration = ability:GetLevelSpecialValueFor( "duration", ability:GetLevel() - 1 ) print("Hiding Wearables") --hero:AddNoDraw() -- Doesn't work on classname dota_item_wearable hero.wearableNames = {} -- In here we'll store the wearable names to revert the change hero.hiddenWearables = {} -- Keep every wearable handle in a table, as its way better to iterate than in the MovePeer system local model = hero:FirstMoveChild() while model ~= nil do if model:GetClassname() ~= "" and model:GetClassname() == "dota_item_wearable" then local modelName = model:GetModelName() if string.find(modelName, "invisiblebox") == nil then -- Add the original model name to revert later table.insert(hero.wearableNames,modelName) print("Hidden "..modelName.."") -- Set model invisible model:SetModel("models/development/invisiblebox.vmdl") table.insert(hero.hiddenWearables,model) end end model = model:NextMovePeer() if model ~= nil then print("Next Peer:" .. model:GetModelName()) end end end --[[Author: Noya Used by: Pizzalol Date: 12.01.2015. Shows the hidden hero wearables ]] function ShowWearables( event ) local hero = event.caster print("Showing Wearables on ".. hero:GetModelName()) -- Iterate on both tables to set each item back to their original modelName for i,v in ipairs(hero.hiddenWearables) do for index,modelName in ipairs(hero.wearableNames) do if i==index then print("Changed "..v:GetModelName().. " back to "..modelName) v:SetModel(modelName) end end end end
--[[ Lua Cold Observables MIT License Copyright (c) 2019 Alexis Munsayac Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]] local M = require "LuaObservable.src.M" local Observable = setmetatable({}, M) M.__call = require "LuaObservable.src.new" M.__index = { is = require "LuaObservable.src.is", subscribe = require "LuaObservable.src.subscribe", } local loaded = false Observable.loadExtensions = function () if(not loaded) then local status, err = pcall( function () local extPath = "LuaObservable.src.ext." local function load(moduleName) return require(extPath..moduleName) end --[[ Creating Observables ]] Observable.from = load("from") Observable.of = load("of") Observable.empty = load("empty") Observable.never = load("never") Observable.throw = load("throw") Observable.just = load("just") Observable.range = load("range") Observable.doRepeat = load("doRepeat") Observable.zip = load("zip") Observable.staticForkJoin = load("staticForkJoin") Observable.amb = load("amb") local index = M.__index --[[ Creating Observables ]] index.doWhile = load("doWhile") --[[ Transforming Observables ]] index.buffer = load("buffer") index.concatMap = load("concatMap") index.flatMap = load("flatMap") index.flatMapLatest = load("flatMapLatest") index.flatMapObserver = load("flatMapObserver") index.map = load("map") index.pluck = load("pluck") index.scan = load("scan") --[[ Filtering Observables ]] index.distinct = load("distinct") index.distinctUntilChanged = load("distinctUntilChanged") index.elementAt = load("elementAt") index.filter = load("filter") index.first = load("first") index.single = load("single") index.find = load("find") index.ignore = load("ignore") index.last = load("last") index.skip = load("skip") index.skipLast = load("skipLast") index.skipUntil = load("skipUntil") index.skipWhile = load("skipWhile") index.take = load("take") index.takeLast = load("takeLast") index.takeLastBuffer = load("takeLastBuffer") index.takeUntil = load("takeUntil") index.takeWhile = load("takeWhile") --[[ Combining Observables ]] index.concat = load("concat") index.combineLatest = load("combineLatest") index.withLatestFrom = load("withLatestFrom") index.merge = load("merge") index.startWith = load("startWith") index.forkJoin = load("forkJoin") --[[ Error handling ]] index.catch = load("catch") index.onErrorResumeNext = load("onErrorResumeNext") --[[ Utility ]] index.tap = load("tap") index.tapOnNext = load("tapOnNext") index.tapOnError = load("tapOnError") index.tapOnComplete = load("tapOnComplete") index.finally = load("finally") --[[ Conditional and Boolean ]] index.all = load("all") index.sorted = load("sorted") index.contains = load("contains") index.indexOf = load("indexOf") index.findIndex = load("findIndex") index.isEmpty = load("isEmpty") index.defaultIfEmpty = load("defaultIfEmpty") --[[ Aggregates ]] index.average = load("average") index.count = load("count") index.max = load("max") index.min = load("min") index.sum = load("sum") index.reduce = load("reduce") --[[ Infinite ]] index.linear = load("linear") index.exponential = load("exponential") index.sieve = load("sieve") index.fibonacci = load("fibonacci") index.generator = load("generator") end) if(status) then loaded = true else error(err) end end end return Observable