repo_name stringlengths 6 69 | path stringlengths 6 178 | copies stringclasses 278 values | size stringlengths 4 7 | content stringlengths 671 917k | license stringclasses 15 values |
|---|---|---|---|---|---|
DailyShana/ygopro-scripts | c74860293.lua | 3 | 1458 | --ジャンク・デストロイヤー
function c74860293.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c74860293.tfilter,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74860293,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c74860293.con)
e1:SetTarget(c74860293.tg)
e1:SetOperation(c74860293.op)
c:RegisterEffect(e1)
end
function c74860293.tfilter(c)
return c:IsCode(63977008) or c:IsHasEffect(20932152)
end
function c74860293.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c74860293.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local mc=e:GetHandler():GetMaterialCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,mc-1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c74860293.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(sg,REASON_EFFECT)
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/ship/components/weapon_capacitor/cap_qualdex_conservator_qx3.lua | 3 | 2364 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_ship_components_weapon_capacitor_cap_qualdex_conservator_qx3 = object_tangible_ship_components_weapon_capacitor_shared_cap_qualdex_conservator_qx3:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_components_weapon_capacitor_cap_qualdex_conservator_qx3, "object/tangible/ship/components/weapon_capacitor/cap_qualdex_conservator_qx3.iff")
| agpl-3.0 |
njligames/NJLIGameEngine | cmake.in/ldoc.in/WorldSocket.lua | 4 | 1567 |
----
-- @file WorldSocket
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function WorldSocket:WorldSocket()
end
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function WorldSocket:getClassName()
end
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function WorldSocket:getType()
end
---- Brief description.
-- <#Description#>
-- @param ip <#ip description#>
-- @param port <#port description#>
-- @return <#return value description#>
function WorldSocket:connectJLI(ip, port)
end
---- Brief description.
-- @return <#return value description#>
function WorldSocket:parseMessage()
end
---- Brief description.
-- @return <#return value description#>
function WorldSocket:hasMessage()
end
---- Brief description.
-- @return <#return value description#>
function WorldSocket:popMessage()
end
---- Brief description.
-- @return <#return value description#>
function WorldSocket:sendMessage()
end
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function WorldSocket:disconnectJLI()
end
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function WorldSocket:isConnected()
end
---- Brief description.
-- @return <#return value description#>
function WorldSocket:socketSetOpt()
end
---- Brief description.
-- @return <#return value description#>
function WorldSocket:WorldSocket()
end
---- Brief description.
-- @return <#return value description#>
function WorldSocket:operator=()
end
| mit |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/mobile/faction/rebel/rebel_specforce_captain.lua | 2 | 1878 | rebel_specforce_captain = Creature:new {
objectName = "@mob/creature_names:rebel_specforce_captain",
randomNameType = NAME_GENERIC_TAG,
socialGroup = "rebel",
faction = "rebel",
level = 25,
chanceHit = 0.36,
damageMin = 240,
damageMax = 250,
baseXp = 2637,
baseHAM = 7200,
baseHAMmax = 8800,
armor = 0,
resists = {15,15,40,15,15,15,15,-1,-1},
meatType = "",
meatAmount = 0,
hideType = "",
hideAmount = 0,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0,
ferocity = 0,
pvpBitmask = ATTACKABLE,
creatureBitmask = PACK + KILLER,
optionsBitmask = 136,
diet = HERBIVORE,
templates = {
"object/mobile/dressed_rebel_specforce_captain_human_female_01.iff",
"object/mobile/dressed_rebel_specforce_captain_human_male_01.iff",
"object/mobile/dressed_rebel_specforce_captain_moncal_female_01.iff",
"object/mobile/dressed_rebel_specforce_captain_rodian_female_01.iff",
"object/mobile/dressed_rebel_specforce_captain_trandoshan_male_01.iff",
"object/mobile/dressed_rebel_specforce_captain_zabrak_male_01.iff"},
lootGroups = {
{
groups = {
{group = "color_crystals", chance = 100000},
{group = "junk", chance = 4250000},
{group = "rifles", chance = 1000000},
{group = "pistols", chance = 1000000},
{group = "melee_weapons", chance = 1000000},
{group = "carbines", chance = 1000000},
{group = "clothing_attachments", chance = 100000},
{group = "armor_attachments", chance = 100000},
{group = "rebel_officer_common", chance = 450000},
{group = "wearables_common", chance = 1000000}
}
}
},
weapons = {"rebel_weapons_heavy"},
conversationTemplate = "rebelRecruiterConvoTemplate",
reactionStf = "@npc_reaction/military",
attacks = merge(riflemanmaster,pistoleermaster,carbineermaster,brawlermaster)
}
CreatureTemplates:addCreatureTemplate(rebel_specforce_captain, "rebel_specforce_captain")
| agpl-3.0 |
sjznxd/lc-20130116 | applications/luci-radvd/luasrc/model/cbi/radvd/interface.lua | 78 | 7996 | --[[
LuCI - Lua Configuration Interface
Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
local sid = arg[1]
local utl = require "luci.util"
m = Map("radvd", translatef("Radvd - Interface %q", "?"),
translate("Radvd is a router advertisement daemon for IPv6. " ..
"It listens to router solicitations and sends router advertisements " ..
"as described in RFC 4861."))
m.redirect = luci.dispatcher.build_url("admin/network/radvd")
if m.uci:get("radvd", sid) ~= "interface" then
luci.http.redirect(m.redirect)
return
end
m.uci:foreach("radvd", "interface",
function(s)
if s['.name'] == sid and s.interface then
m.title = translatef("Radvd - Interface %q", s.interface)
return false
end
end)
s = m:section(NamedSection, sid, "interface", translate("Interface Configuration"))
s.addremove = false
s:tab("general", translate("General"))
s:tab("timing", translate("Timing"))
s:tab("mobile", translate("Mobile IPv6"))
--
-- General
--
o = s:taboption("general", Flag, "ignore", translate("Enable"))
o.rmempty = false
function o.cfgvalue(...)
local v = Flag.cfgvalue(...)
return v == "1" and "0" or "1"
end
function o.write(self, section, value)
Flag.write(self, section, value == "1" and "0" or "1")
end
o = s:taboption("general", Value, "interface", translate("Interface"),
translate("Specifies the logical interface name this section belongs to"))
o.template = "cbi/network_netlist"
o.nocreate = true
o.optional = false
function o.formvalue(...)
return Value.formvalue(...) or "-"
end
function o.validate(self, value)
if value == "-" then
return nil, translate("Interface required")
end
return value
end
function o.write(self, section, value)
m.uci:set("radvd", section, "ignore", 0)
m.uci:set("radvd", section, "interface", value)
end
o = s:taboption("general", DynamicList, "client", translate("Clients"),
translate("Restrict communication to specified clients, leave empty to use multicast"))
o.rmempty = true
o.datatype = "ip6addr"
o.placeholder = "any"
function o.cfgvalue(...)
local v = Value.cfgvalue(...)
local l = { }
for v in utl.imatch(v) do
l[#l+1] = v
end
return l
end
o = s:taboption("general", Flag, "AdvSendAdvert", translate("Enable advertisements"),
translate("Enables router advertisements and solicitations"))
o.rmempty = false
function o.write(self, section, value)
if value == "1" then
m.uci:set("radvd", section, "ignore", 0)
m.uci:set("radvd", section, "IgnoreIfMissing", 1)
end
m.uci:set("radvd", section, "AdvSendAdvert", value)
end
o = s:taboption("general", Flag, "UnicastOnly", translate("Unicast only"),
translate("Indicates that the underlying link is not broadcast capable, prevents unsolicited advertisements from being sent"))
o:depends("AdvSendAdvert", "1")
o = s:taboption("general", Flag, "AdvManagedFlag", translate("Managed flag"),
translate("Enables the additional stateful administered autoconfiguration protocol (RFC2462)"))
o:depends("AdvSendAdvert", "1")
o = s:taboption("general", Flag, "AdvOtherConfigFlag", translate("Configuration flag"),
translate("Enables the autoconfiguration of additional, non address information (RFC2462)"))
o:depends("AdvSendAdvert", "1")
o = s:taboption("general", Flag, "AdvSourceLLAddress", translate("Source link-layer address"),
translate("Includes the link-layer address of the outgoing interface in the RA"))
o.rmempty = false
o.default = "1"
o:depends("AdvSendAdvert", "1")
o = s:taboption("general", Value, "AdvLinkMTU", translate("Link MTU"),
translate("Advertises the given link MTU in the RA if specified. 0 disables MTU advertisements"))
o.datatype = "uinteger"
o.placeholder = 0
o:depends("AdvSendAdvert", "1")
o = s:taboption("general", Value, "AdvCurHopLimit", translate("Current hop limit"),
translate("Advertises the default Hop Count value for outgoing unicast packets in the RA. 0 disables hopcount advertisements"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 64
o:depends("AdvSendAdvert", "1")
o = s:taboption("general", ListValue, "AdvDefaultPreference", translate("Default preference"),
translate("Advertises the default router preference"))
o.optional = false
o.default = "medium"
o:value("low", translate("low"))
o:value("medium", translate("medium"))
o:value("high", translate("high"))
o:depends("AdvSendAdvert", "1")
--
-- Timing
--
o = s:taboption("timing", Value, "MinRtrAdvInterval", translate("Minimum advertisement interval"),
translate("The minimum time allowed between sending unsolicited multicast router advertisements from the interface, in seconds"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 198
o:depends("AdvSendAdvert", "1")
o = s:taboption("timing", Value, "MaxRtrAdvInterval", translate("Maximum advertisement interval"),
translate("The maximum time allowed between sending unsolicited multicast router advertisements from the interface, in seconds"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 600
o:depends("AdvSendAdvert", "1")
o = s:taboption("timing", Value, "MinDelayBetweenRAs", translate("Minimum advertisement delay"),
translate("The minimum time allowed between sending multicast router advertisements from the interface, in seconds"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 3
o:depends("AdvSendAdvert", "1")
o = s:taboption("timing", Value, "AdvReachableTime", translate("Reachable time"),
translate("Advertises assumed reachability time in milliseconds of neighbours in the RA if specified. 0 disables reachability advertisements"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 0
o:depends("AdvSendAdvert", "1")
o = s:taboption("timing", Value, "AdvRetransTimer", translate("Retransmit timer"),
translate("Advertises wait time in milliseconds between Neighbor Solicitation messages in the RA if specified. 0 disables retransmit advertisements"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 0
o:depends("AdvSendAdvert", "1")
o = s:taboption("timing", Value, "AdvDefaultLifetime", translate("Default lifetime"),
translate("Advertises the lifetime of the default router in seconds. 0 indicates that the node is no default router"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 1800
o:depends("AdvSendAdvert", "1")
--
-- Mobile
--
o = s:taboption("mobile", Flag, "AdvHomeAgentFlag", translate("Advertise Home Agent flag"),
translate("Advertises Mobile IPv6 Home Agent capability (RFC3775)"))
o:depends("AdvSendAdvert", "1")
o = s:taboption("mobile", Flag, "AdvIntervalOpt", translate("Mobile IPv6 interval option"),
translate("Include Mobile IPv6 Advertisement Interval option to RA"))
o:depends({AdvHomeAgentFlag = "1", AdvSendAdvert = "1"})
o = s:taboption("mobile", Flag, "AdvHomeAgentInfo", translate("Home Agent information"),
translate("Include Home Agent Information in the RA"))
o:depends({AdvHomeAgentFlag = "1", AdvSendAdvert = "1"})
o = s:taboption("mobile", Flag, "AdvMobRtrSupportFlag", translate("Mobile IPv6 router registration"),
translate("Advertises Mobile Router registration capability (NEMO Basic)"))
o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})
o = s:taboption("mobile", Value, "HomeAgentLifetime", translate("Home Agent lifetime"),
translate("Advertises the time in seconds the router is offering Mobile IPv6 Home Agent services"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 1800
o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})
o = s:taboption("mobile", Value, "HomeAgentPreference", translate("Home Agent preference"),
translate("The preference for the Home Agent sending this RA"))
o.datatype = "uinteger"
o.optional = false
o.placeholder = 0
o:depends({AdvHomeAgentInfo = "1", AdvSendAdvert = "1"})
return m
| apache-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/space/chassis/z95_body.lua | 3 | 2240 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_space_chassis_z95_body = object_draft_schematic_space_chassis_shared_z95_body:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_space_chassis_z95_body, "object/draft_schematic/space/chassis/z95_body.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/static/structure/naboo/arch_bronze_naboo_theed.lua | 3 | 2272 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_structure_naboo_arch_bronze_naboo_theed = object_static_structure_naboo_shared_arch_bronze_naboo_theed:new {
}
ObjectTemplates:addTemplate(object_static_structure_naboo_arch_bronze_naboo_theed, "object/static/structure/naboo/arch_bronze_naboo_theed.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/structure/component/weapon_mount_heavy_stabilization_unit.lua | 3 | 2380 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_structure_component_weapon_mount_heavy_stabilization_unit = object_draft_schematic_structure_component_shared_weapon_mount_heavy_stabilization_unit:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_structure_component_weapon_mount_heavy_stabilization_unit, "object/draft_schematic/structure/component/weapon_mount_heavy_stabilization_unit.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/mobile/conversations/tutorial/banker_conv.lua | 2 | 6496 | tutorialBankerConvoTemplate = ConvoTemplate:new {
initialScreen = "",
templateType = "Lua",
luaClassHandler = "tutorialBankerConvoHandler",
screens = {}
}
intro = ConvoScreen:new {
id = "intro",
leftDialog = "@newbie_tutorial/newbie_convo:banker_1_start", -- Well it seems your ship wasn't carrying contraband after all. Pity we didn't discover that sooner...
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_1_reply_1", "suspected_smuggling" }, -- What did you do to my ship?
{ "@newbie_tutorial/newbie_convo:banker_1_reply_2", "explain_terminals" }, -- What is this terminal for?
}
}
tutorialBankerConvoTemplate:addScreen(intro);
suspected_smuggling = ConvoScreen:new {
id = "suspected_smuggling",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_start", -- Well we suspected you were smuggling, so we boarded the transport you were travelling aboard, of course. Don't worry, we've cleared you of all charges.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_2_reply_1", "afraid_not" }, -- Can I get back on board the transport now?
}
}
tutorialBankerConvoTemplate:addScreen(suspected_smuggling);
afraid_not = ConvoScreen:new {
id = "afraid_not",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_more", -- I'm afraid not. It seems your ship was badly damaged and most of your possessions were destroyed.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_2_reply_2", "dont_worry" }, -- What am I supposed to do now?
}
}
tutorialBankerConvoTemplate:addScreen(afraid_not);
dont_worry = ConvoScreen:new {
id = "dont_worry",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_explain", -- Don't worry! We've taken care of everything. We've given you more than enough credits to reimburse you for your loss. You can deposit them at this banking terminal.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_2_reply_3", "buy_what_you_need" }, -- What about my supplies and equipment?
}
}
tutorialBankerConvoTemplate:addScreen(dont_worry);
buy_what_you_need = ConvoScreen:new {
id = "buy_what_you_need",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_explain_2", -- When you get to a planet, look for a commodities market and buy anything you might possibly need.
stopConversation = "true",
options = {}
}
tutorialBankerConvoTemplate:addScreen(buy_what_you_need);
explain_terminals = ConvoScreen:new {
id = "explain_terminals",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_explain_terminals", -- For your convenience, we'll allow you to access this starport's bank terminal.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_1_reply_3", "explain_bank" }, -- Bank?
{ "@newbie_tutorial/newbie_convo:banker_1_reply_4", "explain_bazaar" }, -- Item dispenser?
}
}
tutorialBankerConvoTemplate:addScreen(explain_terminals);
explain_bank = ConvoScreen:new {
id = "explain_bank",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_explain_bank", -- Once we realized you were innocent, we reimbursed you with a generous number of credits for the destruction of your gear. You can deposit them in this bank terminal.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_bank_reply_1", "explain_why_bank" }, -- Why should I bank?
}
}
tutorialBankerConvoTemplate:addScreen(explain_bank);
explain_why_bank = ConvoScreen:new {
id = "explain_why_bank",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_more_bank", -- You should definitely use the bank's safety deposit feature to keep your items safe from harm. It's also a good idea to deposit your credits into your bank accout before shopping at the commodities market since the market deducts credits from your bank account for all purchases.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_2_bank_question", "explain_bank_deduction" }, -- What if I want to buy something?
}
}
tutorialBankerConvoTemplate:addScreen(explain_why_bank);
explain_bank_deduction = ConvoScreen:new {
id = "explain_bank_deduction",
leftDialog = "@newbie_tutorial/newbie_convo:banker_2_bank_answer", -- You don't need cash on hand to buy things. You can purchase items from the commodities market on any planet, and the credits will be deducted from your bank automatically.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_bank_question_2", "explain_bank_store" }, -- Can I store items in the bank?
}
}
tutorialBankerConvoTemplate:addScreen(explain_bank_deduction);
explain_bank_store = ConvoScreen:new {
id = "explain_bank_store",
leftDialog = "@newbie_tutorial/newbie_convo:banker_bank_answer_2", -- Any items you store in this bank will be transferred to your new bank. Once you get to your planet, join any bank there and we'll send these items along.
stopConversation = "true",
options = {}
}
tutorialBankerConvoTemplate:addScreen(explain_bank_store);
explain_bazaar = ConvoScreen:new {
id = "explain_bazaar",
leftDialog = "@newbie_tutorial/newbie_convo:banker_bazaar_1", -- Once you've deposited your money at the bank terminal, browse the Item Dispenser to see if there is any equipment you'd like to purchase.
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_bazaar_reply_1", "more_than_generous" }, -- You didn't give me very much money.
}
}
tutorialBankerConvoTemplate:addScreen(explain_bazaar);
more_than_generous = ConvoScreen:new {
id = "more_than_generous",
leftDialog = "@newbie_tutorial/newbie_convo:banker_bazaar_2", -- I think The Empire is being more than generous. Do you know how much it cost us to capture the transport you were on, kill the crew, search for secret cargo holds... not to mention pulling you out of the fire!
stopConversation = "false",
options = {
{ "@newbie_tutorial/newbie_convo:banker_bazaar_reply_2", "how_should_we_know" }, -- But that transport wasn't smuggling anything!
}
}
tutorialBankerConvoTemplate:addScreen(more_than_generous);
how_should_we_know = ConvoScreen:new {
id = "how_should_we_know",
leftDialog = "@newbie_tutorial/newbie_convo:banker_bazaar_3", -- Ah, but now, how were we supposed to know that without capturing the transport first?
stopConversation = "true",
options = {}
}
tutorialBankerConvoTemplate:addScreen(how_should_we_know);
addConversationTemplate("tutorialBankerConvoTemplate", tutorialBankerConvoTemplate);
| agpl-3.0 |
DailyShana/ygopro-scripts | c24432029.lua | 9 | 1075 | --ジェネクス・ブラスト
function c24432029.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24432029,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c24432029.target)
e1:SetOperation(c24432029.operation)
c:RegisterEffect(e1)
end
function c24432029.filter(c)
return c:IsSetCard(0x2) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function c24432029.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24432029.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c24432029.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c24432029.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/static/item/item_container_weapons.lua | 3 | 2224 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_item_item_container_weapons = object_static_item_shared_item_container_weapons:new {
}
ObjectTemplates:addTemplate(object_static_item_item_container_weapons, "object/static/item/item_container_weapons.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c97000273.lua | 6 | 1978 | --スクラップ・コング
function c97000273.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97000273,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c97000273.destg)
e1:SetOperation(c97000273.desop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(97000273,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCondition(c97000273.thcon)
e2:SetTarget(c97000273.thtg)
e2:SetOperation(c97000273.thop)
c:RegisterEffect(e2)
end
function c97000273.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c97000273.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function c97000273.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(c:GetReason(),0x41)==0x41 and re:GetOwner():IsSetCard(0x24)
end
function c97000273.filter(c)
return c:IsSetCard(0x24) and c:IsType(TYPE_MONSTER) and c:GetCode()~=97000273 and c:IsAbleToHand()
end
function c97000273.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c97000273.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97000273.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c97000273.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c97000273.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
| gpl-2.0 |
JustAPerson/LuaIRC | src/irc/channel.lua | 3 | 12352 | ---
-- Implementation of the Channel class
-- initialization {{{
local base = _G
local irc = require 'irc'
local misc = require 'irc.misc'
local socket = require 'socket'
local table = require 'table'
-- }}}
---
-- This module implements a channel object representing a single channel we
-- have joined.
module 'irc.channel'
-- object metatable {{{
-- TODO: this <br /> shouldn't be necessary - bug in luadoc
---
-- An object of the Channel class represents a single joined channel. It has
-- several table fields, and can be used in string contexts (returning the
-- channel name).<br />
-- @class table
-- @name Channel
-- @field name Name of the channel (read only)
-- @field topic Channel topic, if set (read/write, writing to this sends a
-- topic change request to the server for this channel)
-- @field chanmode Channel mode (public/private/secret) (read only)
-- @field members Array of all members of this channel
local mt = {
-- __index() {{{
__index = function(self, key)
if key == "name" then
return self._name
elseif key == "topic" then
return self._topic
elseif key == "chanmode" then
return self._chanmode
else
return _M[key]
end
end,
-- }}}
-- __newindex() {{{
__newindex = function(self, key, value)
if key == "name" then
return
elseif key == "topic" then
irc.send("TOPIC", self._name, value)
elseif key == "chanmode" then
return
else
base.rawset(self, key, value)
end
end,
-- }}}
-- __concat() {{{
__concat = function(first, second)
local first_str, second_str
if base.type(first) == "table" then
first_str = first._name
else
first_str = first
end
if base.type(second) == "table" then
second_str = second._name
else
second_str = second
end
return first_str .. second_str
end,
-- }}}
-- __tostring() {{{
__tostring = function(self)
return self._name
end
-- }}}
}
-- }}}
-- private methods {{{
-- set_basic_mode {{{
--
-- Sets a no-arg mode on a channel.
-- @name chan:set_basic_mode
-- @param self Channel object
-- @param set True to set the mode, false to unset it
-- @param letter Letter of the mode
local function set_basic_mode(self, set, letter)
if set then
irc.send("MODE", self.name, "+" .. letter)
else
irc.send("MODE", self.name, "-" .. letter)
end
end
-- }}}
-- }}}
-- internal methods {{{
-- TODO: is there a better way to do this? also, storing op/voice as initial
-- substrings of the username is just ugly
-- _add_user {{{
--
-- Add a user to the channel's internal user list.
-- @param self Channel object
-- @param user Nick of the user to add
-- @param mode Mode (op/voice) of the user, in symbolic form (@/+)
function _add_user(self, user, mode)
mode = mode or ''
self._members[user] = mode .. user
end
-- }}}
-- _remove_user {{{
--
-- Remove a user from the channel's internal user list.
-- @param self Channel object
-- @param user Nick of the user to remove
function _remove_user(self, user)
self._members[user] = nil
end
-- }}}
-- _change_status {{{
--
-- Change the op/voice status of a user in the channel's internal user list.
-- @param self Channel object
-- @param user Nick of the user to affect
-- @param on True if the mode is being set, false if it's being unset
-- @param mode 'o' for op, 'v' for voice
function _change_status(self, user, on, mode)
if on then
if mode == 'o' then
self._members[user] = '@' .. user
elseif mode == 'v' then
self._members[user] = '+' .. user
end
else
if (mode == 'o' and self._members[user]:sub(1, 1) == '@') or
(mode == 'v' and self._members[user]:sub(1, 1) == '+') then
self._members[user] = user
end
end
end
-- }}}
-- _change_nick {{{
--
-- Change the nick of a user in the channel's internal user list.
-- @param self Channel object
-- @param old_nick User's old nick
-- @param new_nick User's new nick
function _change_nick(self, old_nick, new_nick)
for member in self:each_member() do
local member_nick = member:gsub('@+', '')
if member_nick == old_nick then
local mode = self._members[old_nick]:sub(1, 1)
if mode ~= '@' and mode ~= '+' then mode = "" end
self._members[old_nick] = nil
self._members[new_nick] = mode .. new_nick
break
end
end
end
-- }}}
-- }}}
-- constructor {{{
---
-- Creates a new Channel object.
-- @param chan Name of the new channel
-- @return The new channel instance
function new(chan)
return base.setmetatable({_name = chan, _topic = {}, _chanmode = "",
_members = {}}, mt)
end
-- }}}
-- public methods {{{
-- iterators {{{
-- each_op {{{
---
-- Iterator over the ops in the channel
-- @param self Channel object
function each_op(self)
return function(state, arg)
return misc._value_iter(state, arg,
function(v)
return v:sub(1, 1) == "@"
end)
end,
self._members,
nil
end
-- }}}
-- each_voice {{{
---
-- Iterator over the voiced users in the channel
-- @param self Channel object
function each_voice(self)
return function(state, arg)
return misc._value_iter(state, arg,
function(v)
return v:sub(1, 1) == "+"
end)
end,
self._members,
nil
end
-- }}}
-- each_user {{{
---
-- Iterator over the normal users in the channel
-- @param self Channel object
function each_user(self)
return function(state, arg)
return misc._value_iter(state, arg,
function(v)
return v:sub(1, 1) ~= "@" and
v:sub(1, 1) ~= "+"
end)
end,
self._members,
nil
end
-- }}}
-- each_member {{{
---
-- Iterator over all users in the channel
-- @param self Channel object
function each_member(self)
return misc._value_iter, self._members, nil
end
-- }}}
-- }}}
-- return tables of users {{{
-- ops {{{
---
-- Gets an array of all the ops in the channel.
-- @param self Channel object
-- @return Array of channel ops
function ops(self)
local ret = {}
for nick in self:each_op() do
table.insert(ret, nick)
end
return ret
end
-- }}}
-- voices {{{
---
-- Gets an array of all the voiced users in the channel.
-- @param self Channel object
-- @return Array of channel voiced users
function voices(self)
local ret = {}
for nick in self:each_voice() do
table.insert(ret, nick)
end
return ret
end
-- }}}
-- users {{{
---
-- Gets an array of all the normal users in the channel.
-- @param self Channel object
-- @return Array of channel normal users
function users(self)
local ret = {}
for nick in self:each_user() do
table.insert(ret, nick)
end
return ret
end
-- }}}
-- members {{{
---
-- Gets an array of all the users in the channel.
-- @param self Channel object
-- @return Array of channel users
function members(self)
local ret = {}
-- not just returning self._members, since the return value shouldn't be
-- modifiable
for nick in self:each_member() do
table.insert(ret, nick)
end
return ret
end
-- }}}
-- }}}
-- setting modes {{{
-- ban {{{
-- TODO: hmmm, this probably needs an appropriate mask, rather than a nick
---
-- Ban a user from a channel.
-- @param self Channel object
-- @param name User to ban
function ban(self, name)
irc.send("MODE", self.name, "+b", name)
end
-- }}}
-- unban {{{
-- TODO: same here
---
-- Remove a ban on a user.
-- @param self Channel object
-- @param name User to unban
function unban(self, name)
irc.send("MODE", self.name, "-b", name)
end
-- }}}
-- voice {{{
---
-- Give a user voice on a channel.
-- @param self Channel object
-- @param name User to give voice to
function voice(self, name)
irc.send("MODE", self.name, "+v", name)
end
-- }}}
-- devoice {{{
---
-- Remove voice from a user.
-- @param self Channel object
-- @param name User to remove voice from
function devoice(self, name)
irc.send("MODE", self.name, "-v", name)
end
-- }}}
-- op {{{
---
-- Give a user ops on a channel.
-- @param self Channel object
-- @param name User to op
function op(self, name)
irc.send("MODE", self.name, "+o", name)
end
-- }}}
-- deop {{{
---
-- Remove ops from a user.
-- @param self Channel object
-- @param name User to remove ops from
function deop(self, name)
irc.send("MODE", self.name, "-o", name)
end
-- }}}
-- set_limit {{{
---
-- Set a channel limit.
-- @param self Channel object
-- @param new_limit New value for the channel limit (optional; limit is unset
-- if this argument isn't passed)
function set_limit(self, new_limit)
if new_limit then
irc.send("MODE", self.name, "+l", new_limit)
else
irc.send("MODE", self.name, "-l")
end
end
-- }}}
-- set_key {{{
---
-- Set a channel password.
-- @param self Channel object
-- @param key New channel password (optional; password is unset if this
-- argument isn't passed)
function set_key(self, key)
if key then
irc.send("MODE", self.name, "+k", key)
else
irc.send("MODE", self.name, "-k")
end
end
-- }}}
-- set_private {{{
---
-- Set the private state of a channel.
-- @param self Channel object
-- @param set True to set the channel as private, false to unset it
function set_private(self, set)
set_basic_mode(self, set, "p")
end
-- }}}
-- set_secret {{{
---
-- Set the secret state of a channel.
-- @param self Channel object
-- @param set True to set the channel as secret, false to unset it
function set_secret(self, set)
set_basic_mode(self, set, "s")
end
-- }}}
-- set_invite_only {{{
---
-- Set whether joining the channel requires an invite.
-- @param self Channel object
-- @param set True to set the channel invite only, false to unset it
function set_invite_only(self, set)
set_basic_mode(self, set, "i")
end
-- }}}
-- set_topic_lock {{{
---
-- If true, the topic can only be changed by an op.
-- @param self Channel object
-- @param set True to lock the topic, false to unlock it
function set_topic_lock(self, set)
set_basic_mode(self, set, "t")
end
-- }}}
-- set_no_outside_messages {{{
---
-- If true, users must be in the channel to send messages to it.
-- @param self Channel object
-- @param set True to require users to be in the channel to send messages to
-- it, false to remove this restriction
function set_no_outside_messages(self, set)
set_basic_mode(self, set, "n")
end
-- }}}
-- set moderated {{{
---
-- Set whether voice is required to speak.
-- @param self Channel object
-- @param set True to set the channel as moderated, false to unset it
function set_moderated(self, set)
set_basic_mode(self, set, "m")
end
-- }}}
-- }}}
-- accessors {{{
-- contains {{{
---
-- Test if a user is in the channel.
-- @param self Channel object
-- @param nick Nick to search for
-- @return True if the nick is in the channel, false otherwise
function contains(self, nick)
for member in self:each_member() do
local member_nick = member:gsub('@+', '')
if member_nick == nick then
return true
end
end
return false
end
-- }}}
-- }}}
-- }}}
| mit |
DailyShana/ygopro-scripts | c93108839.lua | 3 | 4125 | --No.58 炎圧鬼バーナー・バイサー
function c93108839.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93108839,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c93108839.eqtg)
e1:SetOperation(c93108839.eqop)
c:RegisterEffect(e1)
--direct
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(93108839,2))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c93108839.damcon)
e3:SetCost(c93108839.damcost)
e3:SetTarget(c93108839.damtg)
e3:SetOperation(c93108839.damop)
c:RegisterEffect(e3)
end
c93108839.xyz_number=58
function c93108839.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c93108839.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c93108839.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():GetFlagEffect(93108839)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c93108839.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c93108839.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
e:GetHandler():RegisterFlagEffect(93108839,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c93108839.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not tc:IsRelateToEffect(e) or tc:IsFacedown() or tc:IsControler(1-tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
--unequip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93108839,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetTarget(c93108839.sptg)
e1:SetOperation(c93108839.spop)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
--eqlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(c93108839.eqlimit)
e4:SetReset(RESET_EVENT+0x1fe0000)
e4:SetLabelObject(tc)
c:RegisterEffect(e4)
end
function c93108839.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c93108839.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(93108839)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
e:GetHandler():RegisterFlagEffect(93108839,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function c93108839.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
end
end
function c93108839.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function c93108839.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c93108839.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c93108839.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/static/structure/naboo/nboo_imprv_pillar_pillar_s02.lua | 3 | 2292 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_structure_naboo_nboo_imprv_pillar_pillar_s02 = object_static_structure_naboo_shared_nboo_imprv_pillar_pillar_s02:new {
}
ObjectTemplates:addTemplate(object_static_structure_naboo_nboo_imprv_pillar_pillar_s02, "object/static/structure/naboo/nboo_imprv_pillar_pillar_s02.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c96148285.lua | 9 | 1373 | --誘発召喚
function c96148285.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c96148285.condition)
e1:SetOperation(c96148285.activate)
c:RegisterEffect(e1)
end
function c96148285.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c96148285.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96148285.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c96148285.filter,tp,LOCATION_HAND,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(96148285,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,1-tp)>0 then
local g=Duel.GetMatchingGroup(c96148285.filter,1-tp,LOCATION_HAND,0,nil,e,1-tp)
if g:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(96148285,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local tc=g:Select(1-tp,1,1,nil):GetFirst()
Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
| gpl-2.0 |
KingRaptor/Zero-K | effects/unused_chloe.lua | 25 | 1910 | -- chloe
return {
["chloe"] = {
glow = {
air = true,
class = [[CSimpleParticleSystem]],
count = 20,
ground = true,
water = true,
properties = {
airdrag = 1,
colormap = [[1 0.5 0 1 1 1 0.5 1 0.3 0.3 0.3 0 0 0 0 0.01 ]],
directional = true,
emitrot = 0,
emitrotspread = 90,
emitvector = [[0, 1, 0]],
gravity = [[0, 0.0005, 0]],
numparticles = 1,
particlelife = [[5 i5]],
particlelifespread = 10,
particlesize = 3,
particlesizespread = 0,
particlespeed = 0.1,
particlespeedspread = 0.1,
pos = [[0, 0, 0]],
sizegrowth = [[3 i-0.04]],
sizemod = 1.0,
texture = [[ksquareblur]],
},
},
meteors = {
air = true,
class = [[CSimpleParticleSystem]],
count = 20,
ground = true,
water = true,
properties = {
airdrag = 1,
colormap = [[1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0.01 ]],
directional = true,
emitrot = 0,
emitrotspread = 90,
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 1,
particlelife = 40,
particlelifespread = 1,
particlesize = 2,
particlesizespread = 2,
particlespeed = 2,
particlespeedspread = 0,
pos = [[0, 0, 0]],
sizegrowth = 0,
sizemod = 1.0,
texture = [[kthinmeteor]],
},
},
},
}
| gpl-2.0 |
OpenPrograms/Jomik-Programs | robot/build.lua | 1 | 4329 | local VERSION = "0.1a"
local BUILD_LIB_DIR = "build/"
local filesystem = require("filesystem")
local location = require("location")
local robot = require("robot")
local shell = require("shell")
local vector = require("vector")
local args, opts = shell.parse(...)
local charge_pos, chest_pos = vector(0, -1, 0), vector(0,1,0)
local root_path = filesystem.path(filesystem.path(os.getenv("_")), "..")
local lib_dir = filesystem.concat(root_path, "lib", BUILD_LIB_DIR)
local usage = [[
Usage:
build --shape=<shape> [-d|--dry] [shape args]
build --shape=<shape> [-i|--info]
build -l | --list
build -h | --help
Options:
-h --help Show this screen.
-v | --version Show version.
-l --list Lists all possible shapes.
--shape=<shape> Shape to build.
--charge=<vector> Position of the charger.
--chest=<vector> Position of the chest.
-i --info Show info about the shape.
]]
if opts.v or opts.version then
print("robot-build v" .. VERSION)
return
elseif opts.l or opts.list then
if filesystem.isDirectory(lib_dir) then
print("Available shapes for robot-build:")
for f in filesystem.list(lib_dir) do
if not filesystem.isDirectory(f) and string.match(f, "[%a%d]+.lua") then
print(select(3, string.find(f, "([%a%d]+).lua")))
end
end
else
print("build library directory not found (" .. lib_dir .. ")")
end
return
elseif opts.charge then
charge_pos = vector(opts.charge)
elseif opts.chest then
chest_pos = vector(opts.chest)
elseif not opts.shape or opts.h or opts.help then
print(usage)
return
end
local shape_file = filesystem.concat(lib_dir, opts.shape .. ".lua")
assert(filesystem.exists(shape_file)
and not filesystem.isDirectory(shape_file)
and not filesystem.isLink(shape_file),
"build file not found (" .. opts.shape .. ")")
local shape_lib = require(filesystem.concat(BUILD_LIB_DIR, opts.shape))
if opts.i or opts.info then
shape_lib.info()
return
elseif opts.d or opts.dry then
shape_lib.dry(table.unpack(args))
return
end
local shape = shape_lib.fromargs(table.unpack(args))
local function move_back()
if robot.back() then
return true
end
robot.turnAround()
robot.swing()
robot.turnAround()
return robot.back()
end
local function next_block()
local position, orientation = location.get()
local right = vector(-orientation.z, orientation.y, orientation.x)
if shape:is_shell(position - orientation) then
-- Go forward, place block behind
if move_back() then
robot.place()
return true
else
return false
end
elseif shape:is_shell(position + right) then
-- turn right, go forward, place block behind
robot.turnLeft()
if move_back() then
robot.place()
return true
else
return false
end
elseif shape:is_shell(position - right) then
-- turn left, go forward, place block behind
robot.turnRight()
if move_back() then
robot.place()
return true
else
return false
end
elseif shape:is_shell(position - orientation + right) then
-- turn right, go forward, place block behind, turn left, go forward
if move_back() then
robot.place()
robot.turnLeft()
if move_back() then
robot.turnRight()
return true
else
return false
end
end
elseif shape:is_shell(position - orientation - right) then
-- turn right, go forward, place block behind, turn left, go forward
robot.turnRight()
if move_back() then
robot.place()
robot.turnLeft()
return move_back()
end
else
error("Couldn't find the next block in the shape.")
end
end
-- find edge
local position, orientation = location.get()
while shape:contains(position + orientation) do
robot.forward()
position, orientation = location.get()
end
robot.turnLeft()
local running = true
while running do
running = next_block()
end
--[[
We need a special case for the top and bottom.
if (Should there be a block straight ahead?)
Go forward, place block behind
else if (Should there be a block to the right?)
turn right, go forward, place block behind
else if (Should there be a block to the left?)
turn left, go forward, place block behind
else
turn right, go forward, place block behind, turn left, go forward
--]] | mit |
KingRaptor/Zero-K | effects/cannons_misc.lua | 12 | 2473 | return {
["heavy_cannon_muzzle"] = {
muzzle = {
air = true,
class = [[CExpGenSpawner]],
count = 1,
ground = true,
water = true,
properties = {
delay = 0,
explosiongenerator = [[custom:RAIDMUZZLE]],
pos = [[0, 0, 0]],
dir = [[dir]],
},
},
muzzle2 = {
air = true,
class = [[CExpGenSpawner]],
count = 1,
ground = true,
water = true,
properties = {
delay = 0,
explosiongenerator = [[custom:LEVLRMUZZLE]],
pos = [[0, 0, 0]],
dir = [[dir]],
},
},
},
["heavy_cannon_muzzle_shell"] = {
muzzle = {
air = true,
class = [[CExpGenSpawner]],
count = 1,
ground = true,
water = true,
properties = {
delay = 0,
explosiongenerator = [[custom:RAIDMUZZLE]],
pos = [[0, 0, 0]],
dir = [[dir]],
},
},
muzzle2 = {
air = true,
class = [[CExpGenSpawner]],
count = 1,
ground = true,
water = true,
properties = {
delay = 0,
explosiongenerator = [[custom:LEVLRMUZZLE]],
pos = [[0, 0, 0]],
dir = [[dir]],
},
},
shell = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = true,
properties = {
airdrag = 0.97,
colormap = [[0.75 0 0 1 0.75 0 0 1]],
directional = true,
emitrot = 0,
emitrotspread = 10,
emitvector = [[dir]],
gravity = [[0, -0.5, 0]],
numparticles = 1,
particlelife = 15,
particlelifespread = 0,
particlesize = 6.0,
particlesizespread = 0,
particlespeed = 3,
particlespeedspread = 0,
pos = [[0, 0, 0]],
sizegrowth = 0,
sizemod = 1.0,
texture = [[shell]],
},
},
},
} | gpl-2.0 |
DailyShana/ygopro-scripts | c41517968.lua | 3 | 1943 | --E・HERO ダーク・ブライトマン
function c41517968.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,20721928,89252153,true,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e2)
--to defence
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetCondition(c41517968.poscon)
e3:SetOperation(c41517968.posop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(41517968,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_DESTROYED)
e4:SetTarget(c41517968.destg)
e4:SetOperation(c41517968.desop)
c:RegisterEffect(e4)
end
function c41517968.poscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle()
end
function c41517968.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
function c41517968.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c41517968.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
| gpl-2.0 |
njligames/NJLIGameEngine | projects/ELIA/gameplay_scripts/yappybirds_game/scripts/YAPPYBIRDS/SCENES/GAMEPLAY/STATES/Lose.lua | 8 | 4729 | local BaseClass = require "NJLI.STATEMACHINE.SceneEntityState"
local Lose = {}
Lose.__index = Lose
--#############################################################################
--DO NOT EDIT ABOVE
--#############################################################################
--#############################################################################
--Begin Custom Code
--Required local functions:
-- __ctor()
-- __dtor()
-- __load()
-- __unLoad()
--#############################################################################
local __ctor = function(self, init)
--TODO: construct this Entity
end
local __dtor = function(self)
--TODO: destruct this Entity
end
local __load = function(self)
--TODO: load this Entity
end
local __unLoad = function(self)
--TODO: unload this Entity
end
--#############################################################################
function Lose:enter()
BaseClass.enter(self)
end
function Lose:update(timeStep)
BaseClass.update(self, timeStep)
end
function Lose:exit()
BaseClass.exit(self)
end
function Lose:onMessage(message)
BaseClass.onMessage(self, message)
end
function Lose:renderHUD()
BaseClass.renderHUD(self)
end
function Lose:touchesDown(touches)
BaseClass.touchesDown(self, touches)
end
function Lose:touchesUp(touches)
BaseClass.touchesUp(self, touches)
end
function Lose:touchesMove(touches)
BaseClass.touchesMove(self, touches)
end
function Lose:touchesCancelled(touches)
BaseClass.touchesCancelled(self, touches)
end
function Lose:touchDown(touches)
BaseClass.touchDown(self, touches)
end
function Lose:touchUp(touches)
BaseClass.touchUp(self, touches)
end
function Lose:touchMove(touches)
BaseClass.touchMove(self, touches)
end
function Lose:touchCancelled(touches)
BaseClass.touchCancelled(self, touches)
end
function Lose:mouseDown(mouse)
BaseClass.mouseDown(self, mouse)
end
function Lose:mouseUp(mouse)
BaseClass.mouseUp(self, mouse)
end
function Lose:mouseMove(mouse)
BaseClass.mouseMove(self, mouse)
end
function Lose:pause()
BaseClass.pause(self)
end
function Lose:unPause()
BaseClass.unPause(self)
end
function Lose:keyboardShow()
BaseClass.keyboardShow(self)
end
function Lose:keyboardCancel()
BaseClass.keyboardCancel(self)
end
function Lose:keyboardReturn(text)
BaseClass.keyboardReturn(self, text)
end
function Lose:willResignActive()
BaseClass.willResignActive(self)
end
function Lose:didBecomeActive()
BaseClass.didBecomeActive(self)
end
function Lose:didEnterBackground()
BaseClass.didEnterBackground(self)
end
function Lose:willEnterForeground()
BaseClass.willEnterForeground(self)
end
function Lose:willTerminate()
BaseClass.willTerminate(self)
end
function Lose:interrupt()
BaseClass.interrupt(self)
end
function Lose:resumeInterrupt()
BaseClass.resumeInterrupt(self)
end
function Lose:receivedMemoryWarning()
BaseClass.receivedMemoryWarning(self)
end
--#############################################################################
--End Custom Code
--#############################################################################
--#############################################################################
--DO NOT EDIT BELOW
--#############################################################################
setmetatable(Lose, {
__index = BaseClass,
__call = function (cls, ...)
local self = setmetatable({}, cls)
--Create the base first
BaseClass._create(self, ...)
self:_create(...)
return self
end,
})
function Lose:className()
return "Lose"
end
function Lose:class()
return self
end
function Lose:superClass()
return BaseClass
end
function Lose:__gc()
--Destroy derived class first
Lose._destroy(self)
--Destroy base class after derived class
BaseClass._destroy(self)
end
function Lose:__tostring()
local ret = self:className() .. " =\n{\n"
for pos,val in pairs(self) do
ret = ret .. "\t" .. "["..pos.."]" .. " => " .. type(val) .. " = " .. tostring(val) .. "\n"
end
ret = ret .. "\n\t" .. tostring_r(BaseClass) .. "\n}"
return ret .. "\n\t" .. tostring_r(getmetatable(self)) .. "\n}"
end
function Lose:_destroy()
assert(not self.__LoseCalledLoad, "Must unload before you destroy")
__dtor(self)
end
function Lose:_create(init)
self.__LoseCalledLoad = false
__ctor(self, init)
end
function Lose:load()
--load base first
BaseClass.load(self)
--load derived last...
__load(self)
self.__LoseCalledLoad = true
end
function Lose:unLoad()
assert(self.__LoseCalledLoad, "Must load before unLose")
--unload derived first...
__unLoad(self)
self.__LoseCalledLoad = false
--unload base last...
BaseClass.unLoad(self)
end
return Lose
| mit |
njligames/NJLIGameEngine | projects/YappyBirds_macOS_Xcode/build/Debug/NJLIGameEngine.app/Contents/Resources/assets/scripts/YAPPYBIRDS/SCENES/GAMEPLAY/STATES/Lose.lua | 8 | 4729 | local BaseClass = require "NJLI.STATEMACHINE.SceneEntityState"
local Lose = {}
Lose.__index = Lose
--#############################################################################
--DO NOT EDIT ABOVE
--#############################################################################
--#############################################################################
--Begin Custom Code
--Required local functions:
-- __ctor()
-- __dtor()
-- __load()
-- __unLoad()
--#############################################################################
local __ctor = function(self, init)
--TODO: construct this Entity
end
local __dtor = function(self)
--TODO: destruct this Entity
end
local __load = function(self)
--TODO: load this Entity
end
local __unLoad = function(self)
--TODO: unload this Entity
end
--#############################################################################
function Lose:enter()
BaseClass.enter(self)
end
function Lose:update(timeStep)
BaseClass.update(self, timeStep)
end
function Lose:exit()
BaseClass.exit(self)
end
function Lose:onMessage(message)
BaseClass.onMessage(self, message)
end
function Lose:renderHUD()
BaseClass.renderHUD(self)
end
function Lose:touchesDown(touches)
BaseClass.touchesDown(self, touches)
end
function Lose:touchesUp(touches)
BaseClass.touchesUp(self, touches)
end
function Lose:touchesMove(touches)
BaseClass.touchesMove(self, touches)
end
function Lose:touchesCancelled(touches)
BaseClass.touchesCancelled(self, touches)
end
function Lose:touchDown(touches)
BaseClass.touchDown(self, touches)
end
function Lose:touchUp(touches)
BaseClass.touchUp(self, touches)
end
function Lose:touchMove(touches)
BaseClass.touchMove(self, touches)
end
function Lose:touchCancelled(touches)
BaseClass.touchCancelled(self, touches)
end
function Lose:mouseDown(mouse)
BaseClass.mouseDown(self, mouse)
end
function Lose:mouseUp(mouse)
BaseClass.mouseUp(self, mouse)
end
function Lose:mouseMove(mouse)
BaseClass.mouseMove(self, mouse)
end
function Lose:pause()
BaseClass.pause(self)
end
function Lose:unPause()
BaseClass.unPause(self)
end
function Lose:keyboardShow()
BaseClass.keyboardShow(self)
end
function Lose:keyboardCancel()
BaseClass.keyboardCancel(self)
end
function Lose:keyboardReturn(text)
BaseClass.keyboardReturn(self, text)
end
function Lose:willResignActive()
BaseClass.willResignActive(self)
end
function Lose:didBecomeActive()
BaseClass.didBecomeActive(self)
end
function Lose:didEnterBackground()
BaseClass.didEnterBackground(self)
end
function Lose:willEnterForeground()
BaseClass.willEnterForeground(self)
end
function Lose:willTerminate()
BaseClass.willTerminate(self)
end
function Lose:interrupt()
BaseClass.interrupt(self)
end
function Lose:resumeInterrupt()
BaseClass.resumeInterrupt(self)
end
function Lose:receivedMemoryWarning()
BaseClass.receivedMemoryWarning(self)
end
--#############################################################################
--End Custom Code
--#############################################################################
--#############################################################################
--DO NOT EDIT BELOW
--#############################################################################
setmetatable(Lose, {
__index = BaseClass,
__call = function (cls, ...)
local self = setmetatable({}, cls)
--Create the base first
BaseClass._create(self, ...)
self:_create(...)
return self
end,
})
function Lose:className()
return "Lose"
end
function Lose:class()
return self
end
function Lose:superClass()
return BaseClass
end
function Lose:__gc()
--Destroy derived class first
Lose._destroy(self)
--Destroy base class after derived class
BaseClass._destroy(self)
end
function Lose:__tostring()
local ret = self:className() .. " =\n{\n"
for pos,val in pairs(self) do
ret = ret .. "\t" .. "["..pos.."]" .. " => " .. type(val) .. " = " .. tostring(val) .. "\n"
end
ret = ret .. "\n\t" .. tostring_r(BaseClass) .. "\n}"
return ret .. "\n\t" .. tostring_r(getmetatable(self)) .. "\n}"
end
function Lose:_destroy()
assert(not self.__LoseCalledLoad, "Must unload before you destroy")
__dtor(self)
end
function Lose:_create(init)
self.__LoseCalledLoad = false
__ctor(self, init)
end
function Lose:load()
--load base first
BaseClass.load(self)
--load derived last...
__load(self)
self.__LoseCalledLoad = true
end
function Lose:unLoad()
assert(self.__LoseCalledLoad, "Must load before unLose")
--unload derived first...
__unLoad(self)
self.__LoseCalledLoad = false
--unload base last...
BaseClass.unLoad(self)
end
return Lose
| mit |
Zefiros-Software/premake-core | modules/gmake2/gmake2_cpp.lua | 1 | 22270 | --
-- gmake2_cpp.lua
-- Generate a C/C++ project makefile.
-- (c) 2016-2017 Jason Perkins, Blizzard Entertainment and the Premake project
--
local p = premake
local gmake2 = p.modules.gmake2
gmake2.cpp = {}
local cpp = gmake2.cpp
local project = p.project
local config = p.config
local fileconfig = p.fileconfig
---
-- Add namespace for element definition lists for premake.callarray()
---
cpp.elements = {}
--
-- Generate a GNU make C++ project makefile, with support for the new platforms API.
--
cpp.elements.makefile = function(prj)
return {
gmake2.header,
gmake2.phonyRules,
gmake2.shellType,
cpp.createRuleTable,
cpp.outputConfigurationSection,
cpp.outputPerFileConfigurationSection,
cpp.createFileTable,
cpp.outputFilesSection,
cpp.outputRulesSection,
cpp.outputFileRuleSection,
cpp.dependencies,
}
end
function cpp.generate(prj)
p.eol("\n")
p.callArray(cpp.elements.makefile, prj)
-- allow the garbage collector to clean things up.
for cfg in project.eachconfig(prj) do
cfg._gmake = nil
end
prj._gmake = nil
end
function cpp.initialize()
rule 'cpp'
fileExtension { ".cc", ".cpp", ".cxx", ".mm" }
buildoutputs { "$(OBJDIR)/%{premake.modules.gmake2.cpp.makeUnique(cfg, file.objname)}.o" }
buildmessage '$(notdir $<)'
buildcommands {'$(CXX) %{premake.modules.gmake2.cpp.fileFlags(cfg, file)} $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"'}
rule 'cc'
fileExtension {".c", ".s", ".m"}
buildoutputs { "$(OBJDIR)/%{premake.modules.gmake2.cpp.makeUnique(cfg, file.objname)}.o" }
buildmessage '$(notdir $<)'
buildcommands {'$(CC) %{premake.modules.gmake2.cpp.fileFlags(cfg, file)} $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"'}
rule 'resource'
fileExtension ".rc"
buildoutputs { "$(OBJDIR)/%{premake.modules.gmake2.cpp.makeUnique(cfg, file.objname)}.res" }
buildmessage '$(notdir $<)'
buildcommands {'$(RESCOMP) $< -O coff -o "$@" $(ALL_RESFLAGS)'}
global(nil)
end
function cpp.createRuleTable(prj)
local rules = {}
local function addRule(extension, rule)
if type(extension) == 'table' then
for _, value in ipairs(extension) do
addRule(value, rule)
end
else
rules[extension] = rule
end
end
-- add all rules.
local usedRules = table.join({'cpp', 'cc', 'resource'}, prj.rules)
for _, name in ipairs(usedRules) do
local rule = p.global.getRule(name)
addRule(rule.fileExtension, rule)
end
-- create fileset categories.
local filesets = {
['.o'] = 'OBJECTS',
['.obj'] = 'OBJECTS',
['.cc'] = 'SOURCES',
['.cpp'] = 'SOURCES',
['.cxx'] = 'SOURCES',
['.mm'] = 'SOURCES',
['.c'] = 'SOURCES',
['.s'] = 'SOURCES',
['.m'] = 'SOURCES',
['.rc'] = 'RESOURCES',
}
-- cache the result.
prj._gmake = prj._gmake or {}
prj._gmake.rules = rules
prj._gmake.filesets = filesets
end
function cpp.createFileTable(prj)
for cfg in project.eachconfig(prj) do
cfg._gmake = cfg._gmake or {}
cfg._gmake.filesets = {}
cfg._gmake.fileRules = {}
cfg._gmake.bases = {}
local files = table.shallowcopy(prj._.files)
table.foreachi(files, function(node)
cpp.addFile(cfg, node)
end)
for _, f in pairs(cfg._gmake.filesets) do
table.sort(f)
end
cfg._gmake.kinds = table.keys(cfg._gmake.filesets)
table.sort(cfg._gmake.kinds)
prj._gmake.kinds = table.join(prj._gmake.kinds or {}, cfg._gmake.kinds)
end
-- we need to reassign object sequences if we generated any files.
if prj.hasGeneratedFiles and p.project.iscpp(prj) then
p.oven.assignObjectSequences(prj)
end
prj._gmake.kinds = table.unique(prj._gmake.kinds)
table.sort(prj._gmake.kinds)
end
function cpp.addFile(cfg, node)
local filecfg = fileconfig.getconfig(node, cfg)
if not filecfg or filecfg.flags.ExcludeFromBuild then
return
end
-- skip generated files, since we try to figure it out manually below.
if node.generated then
return
end
-- process custom build commands.
if fileconfig.hasCustomBuildRule(filecfg) then
local env = table.shallowcopy(filecfg.environ)
env.PathVars = {
["file.basename"] = { absolute = false, token = node.basename },
["file.abspath"] = { absolute = true, token = node.abspath },
["file.relpath"] = { absolute = false, token = node.relpath },
["file.name"] = { absolute = false, token = node.name },
["file.objname"] = { absolute = false, token = node.objname },
["file.path"] = { absolute = true, token = node.path },
["file.directory"] = { absolute = true, token = path.getdirectory(node.abspath) },
["file.reldirectory"] = { absolute = false, token = path.getdirectory(node.relpath) },
}
local shadowContext = p.context.extent(filecfg, env)
local buildoutputs = p.project.getrelative(cfg.project, shadowContext.buildoutputs)
if buildoutputs and #buildoutputs > 0 then
local file = {
buildoutputs = buildoutputs,
source = node.relpath,
buildmessage = shadowContext.buildmessage,
buildcommands = shadowContext.buildcommands,
buildinputs = p.project.getrelative(cfg.project, shadowContext.buildinputs)
}
table.insert(cfg._gmake.fileRules, file)
for _, output in ipairs(buildoutputs) do
cpp.addGeneratedFile(cfg, node, output)
end
end
else
cpp.addRuleFile(cfg, node)
end
end
function cpp.determineFiletype(cfg, node)
-- determine which filetype to use
local filecfg = fileconfig.getconfig(node, cfg)
local fileext = path.getextension(node.abspath):lower()
if filecfg and filecfg.compileas then
if p.languages.isc(filecfg.compileas) then
fileext = ".c"
elseif p.languages.iscpp(filecfg.compileas) then
fileext = ".cpp"
end
end
return fileext;
end
function cpp.addGeneratedFile(cfg, source, filename)
-- mark that we have generated files.
cfg.project.hasGeneratedFiles = true
-- add generated file to the project.
local files = cfg.project._.files
local node = files[filename]
if not node then
node = fileconfig.new(filename, cfg.project)
files[filename] = node
table.insert(files, node)
end
-- always overwrite the dependency information.
node.dependsOn = source
node.generated = true
-- add to config if not already added.
if not fileconfig.getconfig(node, cfg) then
fileconfig.addconfig(node, cfg)
end
-- determine which filetype to use
local fileext = cpp.determineFiletype(cfg, node)
-- add file to the fileset.
local filesets = cfg.project._gmake.filesets
local kind = filesets[fileext] or "CUSTOM"
-- don't link generated object files automatically if it's explicitly
-- disabled.
if path.isobjectfile(filename) and source.linkbuildoutputs == false then
kind = "CUSTOM"
end
local fileset = cfg._gmake.filesets[kind] or {}
table.insert(fileset, filename)
cfg._gmake.filesets[kind] = fileset
-- recursively setup rules.
cpp.addRuleFile(cfg, node)
end
function cpp.prepareEnvironment(rule, environ, cfg)
for _, prop in ipairs(rule.propertydefinition) do
local fld = p.rule.getPropertyField(rule, prop)
local value = cfg[fld.name]
if value ~= nil then
if fld.kind == "path" then
value = gmake2.path(cfg, value)
elseif fld.kind == "list:path" then
value = gmake2.path(cfg, value)
end
value = p.rule.expandString(rule, prop, value)
if value ~= nil and #value > 0 then
environ[prop.name] = p.esc(value)
end
end
end
end
function cpp.addRuleFile(cfg, node)
local rules = cfg.project._gmake.rules
local fileext = cpp.determineFiletype(cfg, node)
local rule = rules[fileext]
if rule then
local filecfg = fileconfig.getconfig(node, cfg)
local environ = table.shallowcopy(filecfg.environ)
if rule.propertydefinition then
cpp.prepareEnvironment(rule, environ, cfg)
cpp.prepareEnvironment(rule, environ, filecfg)
end
local shadowContext = p.context.extent(rule, environ)
local buildoutputs = shadowContext.buildoutputs
local buildmessage = shadowContext.buildmessage
local buildcommands = shadowContext.buildcommands
local buildinputs = shadowContext.buildinputs
buildoutputs = p.project.getrelative(cfg.project, buildoutputs)
if buildoutputs and #buildoutputs > 0 then
local file = {
buildoutputs = buildoutputs,
source = node.relpath,
buildmessage = buildmessage,
buildcommands = buildcommands,
buildinputs = buildinputs
}
table.insert(cfg._gmake.fileRules, file)
for _, output in ipairs(buildoutputs) do
cpp.addGeneratedFile(cfg, node, output)
end
end
end
end
--
-- Write out the settings for a particular configuration.
--
cpp.elements.configuration = function(cfg)
return {
cpp.tools,
gmake2.target,
gmake2.objdir,
cpp.pch,
cpp.defines,
cpp.includes,
cpp.forceInclude,
cpp.cppFlags,
cpp.cFlags,
cpp.cxxFlags,
cpp.resFlags,
cpp.libs,
cpp.ldDeps,
cpp.ldFlags,
cpp.linkCmd,
cpp.bindirs,
cpp.exepaths,
gmake2.settings,
gmake2.preBuildCmds,
gmake2.preLinkCmds,
gmake2.postBuildCmds,
}
end
function cpp.outputConfigurationSection(prj)
_p('# Configurations')
_p('# #############################################')
_p('')
gmake2.outputSection(prj, cpp.elements.configuration)
end
function cpp.tools(cfg, toolset)
local tool = toolset.gettoolname(cfg, "cc")
if tool then
_p('ifeq ($(origin CC), default)')
_p(' CC = %s', tool)
_p('endif' )
end
tool = toolset.gettoolname(cfg, "cxx")
if tool then
_p('ifeq ($(origin CXX), default)')
_p(' CXX = %s', tool)
_p('endif' )
end
tool = toolset.gettoolname(cfg, "ar")
if tool then
_p('ifeq ($(origin AR), default)')
_p(' AR = %s', tool)
_p('endif' )
end
tool = toolset.gettoolname(cfg, "rc")
if tool then
_p('RESCOMP = %s', tool)
end
end
function cpp.pch(cfg, toolset)
-- If there is no header, or if PCH has been disabled, I can early out
if not cfg.pchheader or cfg.flags.NoPCH then
return
end
-- Visual Studio requires the PCH header to be specified in the same way
-- it appears in the #include statements used in the source code; the PCH
-- source actual handles the compilation of the header. GCC compiles the
-- header file directly, and needs the file's actual file system path in
-- order to locate it.
-- To maximize the compatibility between the two approaches, see if I can
-- locate the specified PCH header on one of the include file search paths
-- and, if so, adjust the path automatically so the user doesn't have
-- add a conditional configuration to the project script.
local pch = cfg.pchheader
local found = false
-- test locally in the project folder first (this is the most likely location)
local testname = path.join(cfg.project.basedir, pch)
if os.isfile(testname) then
pch = project.getrelative(cfg.project, testname)
found = true
else
-- else scan in all include dirs.
for _, incdir in ipairs(cfg.includedirs) do
testname = path.join(incdir, pch)
if os.isfile(testname) then
pch = project.getrelative(cfg.project, testname)
found = true
break
end
end
end
if not found then
pch = project.getrelative(cfg.project, path.getabsolute(pch))
end
p.outln('PCH = ' .. pch)
p.outln('PCH_PLACEHOLDER = $(OBJDIR)/$(notdir $(PCH))')
p.outln('GCH = $(PCH_PLACEHOLDER).gch')
end
function cpp.defines(cfg, toolset)
p.outln('DEFINES +=' .. gmake2.list(table.join(toolset.getdefines(cfg.defines, cfg), toolset.getundefines(cfg.undefines))))
end
function cpp.includes(cfg, toolset)
local includes = toolset.getincludedirs(cfg, cfg.includedirs, cfg.sysincludedirs)
p.outln('INCLUDES +=' .. gmake2.list(includes))
end
function cpp.forceInclude(cfg, toolset)
local includes = toolset.getforceincludes(cfg)
p.outln('FORCE_INCLUDE +=' .. gmake2.list(includes))
end
function cpp.cppFlags(cfg, toolset)
local flags = gmake2.list(toolset.getcppflags(cfg))
p.outln('ALL_CPPFLAGS += $(CPPFLAGS)' .. flags .. ' $(DEFINES) $(INCLUDES)')
end
function cpp.cFlags(cfg, toolset)
local flags = gmake2.list(table.join(toolset.getcflags(cfg), cfg.buildoptions))
p.outln('ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)' .. flags)
end
function cpp.cxxFlags(cfg, toolset)
local flags = gmake2.list(table.join(toolset.getcxxflags(cfg), cfg.buildoptions))
p.outln('ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)' .. flags)
end
function cpp.resFlags(cfg, toolset)
local resflags = table.join(toolset.getdefines(cfg.resdefines), toolset.getincludedirs(cfg, cfg.resincludedirs), cfg.resoptions)
p.outln('ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)' .. gmake2.list(resflags))
end
function cpp.libs(cfg, toolset)
local flags = toolset.getlinks(cfg)
p.outln('LIBS +=' .. gmake2.list(flags, true))
end
function cpp.ldDeps(cfg, toolset)
local deps = config.getlinks(cfg, "siblings", "fullpath")
p.outln('LDDEPS +=' .. gmake2.list(p.esc(deps)))
end
function cpp.ldFlags(cfg, toolset)
local flags = table.join(toolset.getLibraryDirectories(cfg), toolset.getrunpathdirs(cfg, cfg.runpathdirs), toolset.getldflags(cfg), cfg.linkoptions)
p.outln('ALL_LDFLAGS += $(LDFLAGS)' .. gmake2.list(flags))
end
function cpp.linkCmd(cfg, toolset)
if cfg.kind == p.STATICLIB then
if cfg.architecture == p.UNIVERSAL then
p.outln('LINKCMD = libtool -o "$@" $(OBJECTS)')
else
p.outln('LINKCMD = $(AR) -rcs "$@" $(OBJECTS)')
end
elseif cfg.kind == p.UTILITY then
-- Empty LINKCMD for Utility (only custom build rules)
p.outln('LINKCMD =')
else
-- this was $(TARGET) $(LDFLAGS) $(OBJECTS)
-- but had trouble linking to certain static libs; $(OBJECTS) moved up
-- $(LDFLAGS) moved to end (http://sourceforge.net/p/premake/patches/107/)
-- $(LIBS) moved to end (http://sourceforge.net/p/premake/bugs/279/)
local cc = iif(p.languages.isc(cfg.language), "CC", "CXX")
p.outln('LINKCMD = $(' .. cc .. ') -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)')
end
end
function cpp.bindirs(cfg, toolset)
local dirs = project.getrelative(cfg.project, cfg.bindirs)
if #dirs > 0 then
p.outln('EXECUTABLE_PATHS = "' .. table.concat(dirs, ":") .. '"')
end
end
function cpp.exepaths(cfg, toolset)
local dirs = project.getrelative(cfg.project, cfg.bindirs)
if #dirs > 0 then
p.outln('EXE_PATHS = export PATH=$(EXECUTABLE_PATHS):$$PATH;')
end
end
--
-- Write out the per file configurations.
--
function cpp.outputPerFileConfigurationSection(prj)
_p('# Per File Configurations')
_p('# #############################################')
_p('')
for cfg in project.eachconfig(prj) do
table.foreachi(prj._.files, function(node)
local fcfg = fileconfig.getconfig(node, cfg)
if fcfg then
cpp.perFileFlags(cfg, fcfg)
end
end)
end
_p('')
end
function cpp.makeVarName(prj, value, saltValue)
prj._gmake = prj._gmake or {}
prj._gmake.varlist = prj._gmake.varlist or {}
prj._gmake.varlistlength = prj._gmake.varlistlength or 0
local cache = prj._gmake.varlist
local length = prj._gmake.varlistlength
local key = value .. saltValue
if (cache[key] ~= nil) then
return cache[key], false
end
local var = string.format("PERFILE_FLAGS_%d", length)
cache[key] = var
prj._gmake.varlistlength = length + 1
return var, true
end
function cpp.perFileFlags(cfg, fcfg)
local toolset = gmake2.getToolSet(cfg)
local isCFile = path.iscfile(fcfg.name)
local getflags = iif(isCFile, toolset.getcflags, toolset.getcxxflags)
local value = gmake2.list(table.join(getflags(fcfg), fcfg.buildoptions))
if fcfg.defines or fcfg.undefines then
local defs = table.join(toolset.getdefines(fcfg.defines, cfg), toolset.getundefines(fcfg.undefines))
if #defs > 0 then
value = value .. gmake2.list(defs)
end
end
if fcfg.includedirs or fcfg.sysincludedirs then
local includes = toolset.getincludedirs(cfg, fcfg.includedirs, fcfg.sysincludedirs)
if #includes > 0 then
value = value .. gmake2.list(includes)
end
end
if #value > 0 then
local newPerFileFlag = false
fcfg.flagsVariable, newPerFileFlag = cpp.makeVarName(cfg.project, value, iif(isCFile, '_C', '_CPP'))
if newPerFileFlag then
if isCFile then
_p('%s = $(ALL_CFLAGS)%s', fcfg.flagsVariable, value)
else
_p('%s = $(ALL_CXXFLAGS)%s', fcfg.flagsVariable, value)
end
end
end
end
function cpp.fileFlags(cfg, file)
local fcfg = fileconfig.getconfig(file, cfg)
local flags = {}
if cfg.pchheader and not cfg.flags.NoPCH and (not fcfg or not fcfg.flags.NoPCH) then
table.insert(flags, "-include $(PCH_PLACEHOLDER)")
end
if fcfg and fcfg.flagsVariable then
table.insert(flags, string.format("$(%s)", fcfg.flagsVariable))
else
local fileExt = cpp.determineFiletype(cfg, file)
if path.iscfile(fileExt) then
table.insert(flags, "$(ALL_CFLAGS)")
elseif path.iscppfile(fileExt) then
table.insert(flags, "$(ALL_CXXFLAGS)")
end
end
return table.concat(flags, ' ')
end
--
-- Write out the file sets.
--
cpp.elements.filesets = function(cfg)
local result = {}
for _, kind in ipairs(cfg._gmake.kinds) do
for _, f in ipairs(cfg._gmake.filesets[kind]) do
table.insert(result, function(cfg, toolset)
cpp.outputFileset(cfg, kind, f)
end)
end
end
return result
end
function cpp.outputFilesSection(prj)
_p('# File sets')
_p('# #############################################')
_p('')
for _, kind in ipairs(prj._gmake.kinds) do
_x('%s :=', kind)
end
_x('')
gmake2.outputSection(prj, cpp.elements.filesets)
end
function cpp.outputFileset(cfg, kind, file)
_x('%s += %s', kind, file)
end
--
-- Write out the targets.
--
cpp.elements.rules = function(cfg)
return {
cpp.allRules,
cpp.targetRules,
gmake2.targetDirRules,
gmake2.objDirRules,
cpp.cleanRules,
gmake2.preBuildRules,
cpp.customDeps,
cpp.pchRules,
}
end
function cpp.outputRulesSection(prj)
_p('# Rules')
_p('# #############################################')
_p('')
gmake2.outputSection(prj, cpp.elements.rules)
end
function cpp.allRules(cfg, toolset)
if cfg.system == p.MACOSX and cfg.kind == p.WINDOWEDAPP then
_p('all: $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')
_p('\t@:')
_p('')
_p('$(dir $(TARGETDIR))PkgInfo:')
_p('$(dir $(TARGETDIR))Info.plist:')
else
_p('all: $(TARGET)')
_p('\t@:')
end
_p('')
end
function cpp.targetRules(cfg, toolset)
local targets = ''
for _, kind in ipairs(cfg._gmake.kinds) do
if kind ~= 'OBJECTS' and kind ~= 'RESOURCES' then
targets = targets .. '$(' .. kind .. ') '
end
end
targets = targets .. '$(OBJECTS) $(LDDEPS)'
if cfg._gmake.filesets['RESOURCES'] then
targets = targets .. ' $(RESOURCES)'
end
_p('$(TARGET): %s | $(TARGETDIR)', targets)
_p('\t$(PRELINKCMDS)')
_p('\t@echo Linking %s', cfg.project.name)
_p('\t$(SILENT) $(LINKCMD)')
_p('\t$(POSTBUILDCMDS)')
_p('')
end
function cpp.customDeps(cfg, toolset)
for _, kind in ipairs(cfg._gmake.kinds) do
if kind == 'CUSTOM' or kind == 'SOURCES' then
_p('$(%s): | prebuild', kind)
end
end
end
function cpp.cleanRules(cfg, toolset)
_p('clean:')
_p('\t@echo Cleaning %s', cfg.project.name)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) rm -f $(TARGET)')
_p('\t$(SILENT) rm -rf $(OBJDIR)')
_p('else')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGET)) del $(subst /,\\\\,$(TARGET))')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\,$(OBJDIR))')
_p('endif')
_p('')
end
function cpp.pchRules(cfg, toolset)
_p('ifneq (,$(PCH))')
_p('$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER)')
_p('$(GCH): $(PCH) | prebuild')
_p('\t@echo $(notdir $<)')
local cmd = iif(p.languages.isc(cfg.language), "$(CC) -x c-header $(ALL_CFLAGS)", "$(CXX) -x c++-header $(ALL_CXXFLAGS)")
_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.gch=%%.d)" -c "$<"', cmd)
_p('$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)')
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) touch "$@"')
_p('else')
_p('\t$(SILENT) echo $null >> "$@"')
_p('endif')
_p('else')
_p('$(OBJECTS): | prebuild')
_p('endif')
_p('')
end
--
-- Output the file compile targets.
--
function cpp.makeUnique(cfg, f)
local cache = cfg._gmake.bases
local seq = cache[f]
if seq == nil then
cache[f] = 1
return f
else
cache[f] = seq + 1
return f .. tostring(seq)
end
end
cpp.elements.fileRules = function(cfg)
local funcs = {}
for _, fileRule in ipairs(cfg._gmake.fileRules) do
table.insert(funcs, function(cfg, toolset)
cpp.outputFileRules(cfg, fileRule)
end)
end
return funcs
end
function cpp.outputFileRuleSection(prj)
_p('# File Rules')
_p('# #############################################')
_p('')
gmake2.outputSection(prj, cpp.elements.fileRules)
end
function cpp.outputFileRules(cfg, file)
local outputs = table.concat(file.buildoutputs, ' ')
local dependencies = p.esc(file.source)
if file.buildinputs and #file.buildinputs > 0 then
dependencies = dependencies .. " " .. table.concat(p.esc(file.buildinputs), " ")
end
_p('%s: %s', outputs, dependencies)
if file.buildmessage then
_p('\t@echo %s', file.buildmessage)
end
if file.buildcommands then
local cmds = os.translateCommandsAndPaths(file.buildcommands, cfg.project.basedir, cfg.project.location)
for _, cmd in ipairs(cmds) do
if cfg.bindirs and #cfg.bindirs > 0 then
_p('\t$(SILENT) $(EXE_PATHS) %s', cmd)
else
_p('\t$(SILENT) %s', cmd)
end
end
end
end
---------------------------------------------------------------------------
--
-- Handlers for individual makefile elements
--
---------------------------------------------------------------------------
function cpp.dependencies(prj)
-- include the dependencies, built by GCC (with the -MMD flag)
_p('-include $(OBJECTS:%%.o=%%.d)')
_p('ifneq (,$(PCH))')
_p(' -include $(PCH_PLACEHOLDER).d')
_p('endif')
end
| bsd-3-clause |
Whitechaser/darkstar | scripts/zones/Beadeaux/npcs/_43b.lua | 5 | 1426 | -----------------------------------
-- Area: Beadeaux
-- NPC: Jail Door
-- Involved in Quests: The Rescue
-- !pos 56 0.1 -23 147
-----------------------------------
package.loaded["scripts/zones/Beadeaux/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/globals/keyitems");
require("scripts/zones/Beadeaux/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
if (player:getQuestStatus(OTHER_AREAS,THE_RESCUE) == QUEST_ACCEPTED and player:hasKeyItem(TRADERS_SACK) == false) then
if (trade:hasItemQty(495,1) == true and trade:getItemCount() == 1) then
player:startEvent(1000);
end
end
end;
function onTrigger(player,npc)
if (player:getQuestStatus(OTHER_AREAS,THE_RESCUE) == QUEST_ACCEPTED and player:hasKeyItem(TRADERS_SACK) == false) then
player:messageSpecial(LOCKED_DOOR_QUADAV_HAS_KEY);
else
player:messageSpecial(NOTHING_OUT_OF_ORDINARY);
end
return 1;
end;
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 1000) then
player:addKeyItem(TRADERS_SACK);
player:messageSpecial(KEYITEM_OBTAINED,TRADERS_SACK);
end
end;
| gpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/ship/components/armor/arm_cygnus_light_weave.lua | 3 | 2300 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_ship_components_armor_arm_cygnus_light_weave = object_tangible_ship_components_armor_shared_arm_cygnus_light_weave:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_components_armor_arm_cygnus_light_weave, "object/tangible/ship/components/armor/arm_cygnus_light_weave.iff")
| agpl-3.0 |
Whitechaser/darkstar | scripts/zones/Hall_of_Transference/npcs/_0e8.lua | 5 | 1366 | -----------------------------------
-- Area: Hall of Transference
-- NPC: Large Apparatus (Right) - Mea
-- !pos 290.253 -81.849 -42.381 14
-----------------------------------
package.loaded["scripts/zones/Hall_of_Transference/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Hall_of_Transference/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
if (player:getVar("MeaChipRegistration") == 0 and player:getVar("skyShortcut") == 1 and trade:hasItemQty(478,1) and trade:getItemCount() == 1) then
player:tradeComplete();
player:startEvent(164);
end
end;
function onTrigger(player,npc)
if (player:getVar("MeaChipRegistration") == 1) then
player:messageSpecial(NO_RESPONSE_OFFSET+6); -- Device seems to be functioning correctly.
else
player:startEvent(163); -- Hexagonal Cones
end
end;
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 164) then
player:messageSpecial(NO_RESPONSE_OFFSET+4,478); -- You fit..
player:messageSpecial(NO_RESPONSE_OFFSET+5); -- Device has been repaired
player:setVar("MeaChipRegistration",1);
end
end;
| gpl-3.0 |
KingRaptor/Zero-K | scripts/armrectr.lua | 6 | 3812 | include "constants.lua"
local head = piece 'head'
local hips = piece 'hips'
local chest = piece 'chest'
local rthigh = piece 'rthigh'
local lthigh = piece 'lthigh'
local lshin = piece 'lshin'
local rshin = piece 'rshin'
local rfoot = piece 'rfoot'
local lfoot = piece 'lfoot'
local larm = piece 'larm'
local rupperarm = piece 'rupperarm'
local claw1 = piece 'claw1'
local claw2 = piece 'claw2'
local rshoulder = piece 'rshoulder'
local rforearm = piece 'rforearm'
-- Signal definitions
local SIG_WALK = 1
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local function Walk()
Signal(SIG_WALK)
SetSignalMask(SIG_WALK)
while true do
Turn(lshin, x_axis, math.rad(10), math.rad(315))
Turn(rshin, x_axis, math.rad(85), math.rad(260))
Turn(rthigh, x_axis, math.rad(-100), math.rad(135))
Turn(lthigh, x_axis, math.rad(30), math.rad(135))
if GetUnitValue(COB.INBUILDSTANCE) == 0 then
Turn(larm, x_axis, math.rad(-30), math.rad(60))
Turn(rshoulder, x_axis, math.rad(30), math.rad(60))
end
WaitForTurn(lthigh, x_axis)
Turn(rshin, x_axis, math.rad(10), math.rad(315))
Turn(lshin, x_axis, math.rad(85), math.rad(260))
Turn(lthigh, x_axis, math.rad(-100), math.rad(135))
Turn(rthigh, x_axis, math.rad(30), math.rad(135))
if GetUnitValue(COB.INBUILDSTANCE) == 0 then
Turn(larm, x_axis, math.rad(30), math.rad(60))
Turn(rshoulder, x_axis, math.rad(-30), math.rad(60))
end
WaitForTurn(rthigh, x_axis)
end
end
local function StopWalk ()
Signal(SIG_WALK)
Turn(lfoot, x_axis, 0, math.rad(395))
Turn(rfoot, x_axis, 0, math.rad(395))
Turn(rthigh, x_axis, 0, math.rad(235))
Turn(lthigh, x_axis, 0, math.rad(230))
Turn(lshin, x_axis, 0, math.rad(235))
Turn(rshin, x_axis, 0, math.rad(230))
Turn(rthigh, y_axis, math.rad(-20), math.rad(135))
Turn(lthigh, y_axis, math.rad(20), math.rad(130))
Turn(rthigh, z_axis, math.rad(-3), math.rad(135))
Turn(lthigh, z_axis, math.rad(3), math.rad(130))
Turn(lfoot, z_axis, math.rad(-3), math.rad(130))
Turn(rfoot, z_axis, math.rad(3), math.rad(130))
if GetUnitValue(COB.INBUILDSTANCE) == 0 then
Turn(larm, x_axis, 0, math.rad(30))
Turn(rshoulder, x_axis, 0, math.rad(30))
end
end
function script.StartMoving()
StartThread(Walk)
end
function script.StopMoving()
StartThread(StopWalk)
end
function script.StartBuilding(heading, pitch)
SetUnitValue(COB.INBUILDSTANCE, 1)
Turn(chest, y_axis, heading, math.rad(150))
Turn(rshoulder, x_axis, -math.rad(90) - pitch, math.rad(150))
Turn(rforearm, x_axis, 0, math.rad(150))
Turn(claw1, x_axis, math.rad(-30), math.rad(150))
Turn(claw2, x_axis, math.rad(30), math.rad(150))
end
function script.StopBuilding()
SetUnitValue(COB.INBUILDSTANCE, 0)
Turn(rshoulder, x_axis, 0, math.rad(150))
Turn(rforearm, x_axis, 0, math.rad(150))
Turn(chest, y_axis, 0, math.rad(150))
Turn(rshoulder, x_axis, 0, math.rad(100))
Turn(claw1, x_axis, 0, math.rad(100))
Turn(claw2, x_axis, 0, math.rad(100))
end
function script.QueryNanoPiece()
GG.LUPS.QueryNanoPiece(unitID,unitDefID,Spring.GetUnitTeam(unitID), claw1)
return claw1
end
function script.Create()
StartThread(SmokeUnit, {chest})
end
function script.Killed(recentDamage, maxHealth)
local severity = recentDamage/maxHealth
local corpseType = 1
if severity <= .25 then
Explode(hips, sfxShatter)
Explode(chest, sfxShatter)
Explode(head, sfxFall + sfxFire)
elseif severity <= .50 then
Explode(hips, sfxShatter)
Explode(chest, sfxShatter)
Explode(head, sfxFall + sfxSmoke + sfxFire + sfxExplodeOnHit)
else
corpseType = 2
Explode(hips, sfxShatter)
Explode(chest, sfxShatter)
Explode(head, sfxFall + sfxSmoke + sfxFire + sfxExplodeOnHit)
end
return corpseType
end | gpl-2.0 |
DailyShana/ygopro-scripts | c15978426.lua | 5 | 1584 | --EMセカンドンキー
function c15978426.initial_effect(c)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15978426,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c15978426.tgtg)
e1:SetOperation(c15978426.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c15978426.filter(c,tohand)
return c:IsSetCard(0x9f) and not c:IsCode(15978426) and c:IsType(TYPE_MONSTER)
and (c:IsAbleToGrave() or (tohand and c:IsAbleToHand()))
end
function c15978426.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local tohand=Duel.GetFieldCard(tp,LOCATION_SZONE,6) and Duel.GetFieldCard(tp,LOCATION_SZONE,7)
return Duel.IsExistingMatchingCard(c15978426.filter,tp,LOCATION_DECK,0,1,nil,tohand)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c15978426.tgop(e,tp,eg,ep,ev,re,r,rp)
local tohand=Duel.GetFieldCard(tp,LOCATION_SZONE,6) and Duel.GetFieldCard(tp,LOCATION_SZONE,7)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c15978426.filter,tp,LOCATION_DECK,0,1,1,nil,tohand)
local tc=g:GetFirst()
if not tc then return end
if tohand and tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectYesNo(tp,aux.Stringid(15978426,1))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/ship/attachment/weapon/blacksun_medium_weapon2_s06.lua | 3 | 2324 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_ship_attachment_weapon_blacksun_medium_weapon2_s06 = object_tangible_ship_attachment_weapon_shared_blacksun_medium_weapon2_s06:new {
}
ObjectTemplates:addTemplate(object_tangible_ship_attachment_weapon_blacksun_medium_weapon2_s06, "object/tangible/ship/attachment/weapon/blacksun_medium_weapon2_s06.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/mobile/dressed_rebel_commando_rodian_male_01.lua | 3 | 2264 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_mobile_dressed_rebel_commando_rodian_male_01 = object_mobile_shared_dressed_rebel_commando_rodian_male_01:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_rebel_commando_rodian_male_01, "object/mobile/dressed_rebel_commando_rodian_male_01.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c47660516.lua | 5 | 2499 | --RUM-バリアンズ・フォース
function c47660516.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c47660516.target)
e1:SetOperation(c47660516.activate)
c:RegisterEffect(e1)
end
function c47660516.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c47660516.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1,c:GetRace(),c:GetCode())
end
function c47660516.filter2(c,e,tp,mc,rk,rc,code)
if c:GetOriginalCode()==6165656 and code~=48995978 then return false end
return c:GetRank()==rk and c:IsRace(rc) and (c:IsSetCard(0x1048) or c:IsSetCard(0x1073)) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c47660516.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c47660516.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c47660516.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c47660516.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c47660516.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c47660516.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1,tc:GetRace(),tc:GetCode())
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
if Duel.GetOverlayCount(tp,0,1)~=0 then
Duel.BreakEffect()
local g1=Duel.GetOverlayGroup(tp,0,1)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(47660516,0))
local mg2=g1:Select(tp,1,1,nil)
local oc=mg2:GetFirst():GetOverlayTarget()
Duel.Overlay(sc,mg2)
Duel.RaiseSingleEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0)
end
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/item/item_recycler_creature.lua | 2 | 3602 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_item_item_recycler_creature = object_draft_schematic_item_shared_item_recycler_creature:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Creature Recycler Schematic",
craftingToolTab = 524288, -- (See DraftSchemticImplementation.h)
complexity = 12,
size = 1,
xpType = "crafting_general",
xp = 28,
assemblySkill = "general_assembly",
experimentingSkill = "general_experimentation",
customizationSkill = "general_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n"},
ingredientTitleNames = {"agitator_motor", "feed_tubes", "chemical_tubing", "metal_slides", "pulverizer", "spinning_blades"},
ingredientSlotType = {1, 1, 0, 0, 2, 2},
resourceTypes = {"object/tangible/loot/simple_kit/shared_motor_small_red.iff", "object/tangible/loot/simple_kit/shared_feed_tubes.iff", "fiberplast", "steel", "object/tangible/loot/simple_kit/shared_pulverizer.iff", "object/tangible/loot/simple_kit/shared_spinning_blade.iff"},
resourceQuantities = {1, 1, 50, 45, 4, 4},
contribution = {100, 100, 100, 100, 100, 100},
targetTemplate = "object/tangible/recycler/creature_recycler.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_item_item_recycler_creature, "object/draft_schematic/item/item_recycler_creature.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/commands/channelForce.lua | 4 | 2129 | --Copyright (C) 2007 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--which carries forward this exception.
--true = 1, false = 0
ChannelForceCommand = {
name = "channelforce",
}
AddCommand(ChannelForceCommand)
| agpl-3.0 |
Van-Hu/gamecode4 | Extra/UtilityDemo/utility.lua | 44 | 7963 | -- Utility.lua
-- A simple utility game
-- A "better" random seed. This was taken from http://lua-users.org/wiki/MathLibraryTutorial
math.randomseed(tonumber(tostring(os.time()):reverse():sub(1,6)))
-----------------------------------------------------------------------------------------------------------------------
-- Actor
-----------------------------------------------------------------------------------------------------------------------
Actor = class(nil,
{
_name = "<unnamed>",
_hp = 100,
_mp = 3,
_minDamage = nil, -- must be overridden
_maxDamage = nil, -- must be overridden
_minHeal = 20,
_maxHeal = 45,
});
function Actor:DoAction(action, opponent)
if (action == "attack") then
local dead = self:_Attack(opponent);
return dead;
elseif (action == "run") then
local success = self:_Run();
return success;
elseif (action == "heal") then
self:_Heal();
return false;
else
print("Unknown action: " .. action);
return false;
end
end
function Actor:PrintStatus()
print(self._name .. "; hp = " .. self._hp .. "; mp = " .. self._mp);
end
function Actor:Hit(damage)
self._hp = self._hp - damage;
if (self._hp < 0) then
print(self._name .. " is dead!");
return true;
end
return false;
end
function Actor:GetHp()
return self._hp;
end
function Actor:GetMp()
return self._mp;
end
function Actor:GetMinDamage()
return self._minDamage;
end
function Actor:GetMaxDamage()
return self._maxDamage;
end
function Actor:GetMinHeal()
return self._minHeal;
end
function Actor:GetMaxHeal()
return self._maxHeal;
end
function Actor:_Attack(opponent)
assert(self._minDamage ~= nil and self._maxDamage ~= nil);
local damage = math.random(self._minDamage, self._maxDamage);
print(self._name .. " struck for " .. damage .. " damage");
return opponent:Hit(damage);
end
function Actor:_Run()
if (math.random() > 0.5) then
print(self._name .. " ran away!");
return true;
else
print(self._name .. " failed to run away!");
return false;
end
end
function Actor:_Heal()
if (self._mp > 0) then
local healAmount = math.random(self._minHeal, self._maxHeal);
print(self._name .. " healed " .. healAmount .. " hp.");
self._hp = self._hp + healAmount;
self._mp = self._mp - 1;
else
print(self._name .. " attempted to heal but had no MP left");
end
end
-----------------------------------------------------------------------------------------------------------------------
-- Teapot
-----------------------------------------------------------------------------------------------------------------------
Teapot = class(Actor,
{
_name = "Teapot",
_minDamage = 10,
_maxDamage = 20,
_mp = 5, -- teapots are more magical
_actions = { "attack", "heal", "run" };
});
function Teapot:Decide(opponent)
local bestUtility = 0;
local bestAction = nil;
for i, action in ipairs(self._actions) do
-- build the world state
local tempWorldState = WorldState:Create();
tempWorldState:Build(self, opponent);
-- apply the action
tempWorldState:ApplyAction(action, self, opponent);
-- grab the utility
local utility = tempWorldState:GetUtility();
if (utility > bestUtility) then
bestUtility = utility;
bestAction = action;
end
print("\tScoring action '" .. action .. "': utility = " .. utility);
end
print("\tChose " .. bestAction);
return bestAction;
end
-- This is the world state object used by the teapot
WorldState = class(nil,
{
opponentHp = nil,
opponentMp = nil,
survivalChance = nil, -- the chance that we won't die next attack, from 0 - 1
});
function WorldState:Build(teapot, opponent)
self.opponentHp = opponent:GetHp();
self.opponentMp = opponent:GetMp();
self.survivalChance = self:_CalculateSurvivalChance(teapot:GetHp(), opponent);
self.killChance = 1 - self:_CalculateSurvivalChance(opponent:GetHp(), teapot);
end
function WorldState:ApplyAction(action, teapot, opponent)
if (action == "attack") then
local averageDamage = ((teapot:GetMaxDamage() - teapot:GetMinDamage()) / 2) + teapot:GetMinDamage();
self.opponentHp = self.opponentHp - averageDamage;
self.killChance = 1 - self:_CalculateSurvivalChance(self.opponentHp, teapot);
elseif (action == "run") then
self.survivalChance = 0.5;
elseif (action == "heal") then
if (teapot:GetMp() > 0) then
local averageHeal = ((teapot:GetMaxHeal() - teapot:GetMinHeal()) / 2) + teapot:GetMinHeal();
local newHp = teapot:GetHp() + averageHeal;
self.survivalChance = self:_CalculateSurvivalChance(newHp, opponent);
end
else
print("Unknown action: " .. action);
return false;
end
end
function WorldState:GetUtility()
local lifeScore = 100 * self.survivalChance; -- a state in which we're alive grants 100 points, modified by the chance that we might survive
local attackScore = 100 - self.opponentHp; -- a state in which the opponent is hurt is always good; teapot will get more aggressive as player is hurt
attackScore = attackScore + (attackScore * self.killChance); -- adjust the attack score by up to double if the opponent is within a turn of death
return lifeScore + attackScore;
end
function WorldState:_CalculateSurvivalChance(defenderHp, attacker)
if (defenderHp > attacker:GetMaxDamage()) then
return 1;
elseif (defenderHp <= attacker:GetMinDamage()) then
return 0;
else
local range = attacker:GetMaxDamage() - attacker:GetMinDamage();
local percentage = (defenderHp - attacker:GetMinDamage()) / range;
return percentage;
end
end
-----------------------------------------------------------------------------------------------------------------------
-- Player
-----------------------------------------------------------------------------------------------------------------------
Player = class(Actor,
{
_name = "Player",
_minDamage = 15,
_maxDamage = 30,
});
-----------------------------------------------------------------------------------------------------------------------
-- Game class
-----------------------------------------------------------------------------------------------------------------------
Game = class(nil,
{
_player = nil,
_teapot = nil,
});
function Game:Start()
self._player = Player:Create();
self._teapot = Teapot:Create();
print("A Teapot draws near! Command?");
print("1) Attack");
print("2) Run");
print("3) Heal");
print("4) Status");
print("Q to quit");
end
function Game:Update(action)
-- player runs action
local gameOver = self._player:DoAction(action, self._teapot);
-- check for game end
if (gameOver) then
self:_Reset();
return;
end
-- teapot action
action = self._teapot:Decide(self._player);
gameOver = self._teapot:DoAction(action, self._player);
-- check for game end
if (gameOver) then
self:_Reset();
return;
end
self:ShowStatus();
end
function Game:ShowStatus()
self._player:PrintStatus();
self._teapot:PrintStatus();
end
function Game:_Reset()
print("Game over!\n\n");
self:Start();
end
-----------------------------------------------------------------------------------------------------------------------
-- Global game object
-----------------------------------------------------------------------------------------------------------------------
g_game = Game:Create();
g_game:Start();
-----------------------------------------------------------------------------------------------------------------------
-- Player commands
-----------------------------------------------------------------------------------------------------------------------
function Attack()
g_game:Update("attack");
end
function Run()
g_game:Update("run");
end
function Heal()
g_game:Update("heal");
end
function Status()
g_game:ShowStatus();
end
| lgpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/space/chassis/xwing_wing_r.lua | 3 | 2256 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_space_chassis_xwing_wing_r = object_draft_schematic_space_chassis_shared_xwing_wing_r:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_space_chassis_xwing_wing_r, "object/draft_schematic/space/chassis/xwing_wing_r.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/loot/items/armor/bone_armor_bracer_l.lua | 4 | 1136 | bone_armor_bracer_l = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "a Bone Armor Left Bracer",
directObjectTemplate = "object/tangible/wearables/armor/bone/armor_bone_s01_bracer_l.iff",
craftingValues = {
{"armor_rating",1,1,0},
{"energyeffectiveness",10,35,10},
{"armor_effectiveness",4,19,10},
{"armor_integrity",7500, 12500,0},
{"armor_health_encumbrance",6,4,0},
{"armor_action_encumbrance",8,4,0},
{"armor_mind_encumbrance",4,2,0},
},
skillMods = {
},
customizationStringNames = {"/private/index_color_0", "/private/index_color_1"},
customizationValues = {
{0, 1},
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}
},
junkDealerTypeNeeded = JUNKARMOUR,
junkMinValue = 25,
junkMaxValue = 50
}
addLootItemTemplate("bone_armor_bracer_l", bone_armor_bracer_l)
| agpl-3.0 |
DailyShana/ygopro-scripts | c84845628.lua | 3 | 1891 | --獄落鳥
function c84845628.initial_effect(c)
--atk & def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c84845628.adval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e2)
--control
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_CONTROL)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(c84845628.cost)
e3:SetTarget(c84845628.target)
e3:SetOperation(c84845628.operation)
c:RegisterEffect(e3)
end
function c84845628.adval(e,c)
local tp=c:GetControler()
return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_TUNER)*100
end
function c84845628.cfilter(c)
return c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost()
end
function c84845628.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c84845628.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c84845628.cfilter,1,1,REASON_COST,nil)
end
function c84845628.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c84845628.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,RESET_END,1) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/bio_engineer/dna_template/dna_template_guf_drolg.lua | 3 | 2344 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_bio_engineer_dna_template_dna_template_guf_drolg = object_draft_schematic_bio_engineer_dna_template_shared_dna_template_guf_drolg:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_bio_engineer_dna_template_dna_template_guf_drolg, "object/draft_schematic/bio_engineer/dna_template/dna_template_guf_drolg.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/firework/base/serverobjects.lua | 3 | 2104 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--Children folder includes
-- Server Objects
includeFile("tangible/firework/base/firework_base.lua")
| agpl-3.0 |
KingRaptor/Zero-K | gamedata/resources.lua | 2 | 6007 | -- $Id: resources.lua 4609 2009-05-12 01:32:58Z carrepairer $
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
-- file: resources.lua
-- brief: resources definitions
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local resources = {
graphics = {
smoke = {
'smoke/smoke00.tga',
'smoke/smoke01.tga',
'smoke/smoke02.tga',
'smoke/smoke03.tga',
'smoke/smoke04.tga',
'smoke/smoke05.tga',
'smoke/smoke06.tga',
'smoke/smoke07.tga',
'smoke/smoke08.tga',
'smoke/smoke09.tga',
'smoke/smoke10.tga',
'smoke/smoke11.tga',
},
scars = {
'unknown/scars/scar1.png',
'unknown/scars/scar2.png',
'unknown/scars/scar3.png',
'unknown/scars/scar4.png',
},
trees = {
bark='Bark.bmp',
leaf='bleaf.bmp',
gran1='gran.bmp',
gran2='gran2.bmp',
birch1='birch1.bmp',
birch2='birch2.bmp',
birch3='birch3.bmp',
},
maps = {
detailtex='detailtex2.bmp',
watertex='ocean.jpg',
},
groundfx = {
groundflash='GPL/groundflash.tga',
groundring='groundring.tga',
seismic='GPL/circles.png',
},
projectiletextures = {
-- MANUAL
----------Spring Effects--------
circularthingy='circularthingy.tga',
laserend='laserend.tga',
laserfalloff='laserfalloff.tga',
randdots='randdots.tga',
smoketrail='PD/smoketrail.tga',
wake='GPL/wake.png',
wakelarge='GPL/wakeLarge.png',
flare='flare.tga',
flame='GPL/flame.png',
explofade='explofade.tga',
heatcloud='GPL/explo.png',
explo='GPL/fire.png',
-- MANUAL
["3explo"]= "cc/3explo.tga",
AAsmoketrail= "AAsmoketrail.tga",
bigexplo= "cc/bigexplo.tga",
bloodblast= "pd/bloodblast.png",
bloodblastwhite= "pd/bloodblastwhite.tga",
blooddrop= "pd/blooddrop.png",
blooddropwhite= "pd/blooddropwhite.tga",
bloodsplat= "pd/bloodsplat.tga",
bluelight = "other/light_blue.png",
bluenovaexplo= "cc/bluenovaexplo.tga",
bluering= "cc/bluering.tga",
brightblueexplo='CC/brightblueexplo.tga',
burncircle='PD/burncircle.tga',
chargeparticles='PD/chargeparticles.tga',
corelaser= "gpl/corelaser.png",
darksmoketrail= "darksmoketrail.tga",
debris2= "other/debris2.tga",
diamondstar= "other/diamondstar.tga",
dirt= "cc/dirt.png",
dirtplosion2= "pd/dirtplosion2.tga",
dosray = "pd/dosray.tga",
dust= "other/dust.tga",
energywave= "other/energywave.tga",
electnovaexplo= "cc/electnovaexplo.png",
exp00_1= "gpl/explosion2/exp00_1.tga",
exp00_10= "gpl/explosion2/exp00_10.tga",
exp00_2= "gpl/explosion2/exp00_2.tga",
exp00_3= "gpl/explosion2/exp00_3.tga",
exp00_4= "gpl/explosion2/exp00_4.tga",
exp00_5= "gpl/explosion2/exp00_5.tga",
exp00_6= "gpl/explosion2/exp00_6.tga",
exp00_7= "gpl/explosion2/exp00_7.tga",
exp00_8= "gpl/explosion2/exp00_8.tga",
exp00_9= "gpl/explosion2/exp00_9.tga",
exp02_1= "gpl/explosion3/exp02_1.png",
exp02_2= "gpl/explosion3/exp02_2.png",
exp02_3= "gpl/explosion3/exp02_3.png",
fireball= "pd/fireball.tga",
fireyexplo= "cc/fireyexplo.tga",
flareprojectiletexture= "pd/fireball.tga",
flashside1= "cc/flashside1.tga",
flashside2= "cc/flashside2.tga",
flowerflash= "pd/flowerflash.tga",
greenlight= "other/light_green.png",
greennovaexplo= "cc/greennovaexplo.tga",
gunshot= "cc/gunshot.tga",
kburst= "other/burst.tga",
kfoam= "other/foam.tga",
kfoom= "other/foom.tga",
largelaser= "gpl/largelaserfalloff.png",
largelaser_long= "gpl/largelaserfalloff_long.png",
lightb= "pd/lightningball.tga",
lightb3= "pd/lightningball3.tga",
lightb4= "pd/lightningball4.tga",
lightb_purple= "pd/lightningball_purple.png",
lightening= "cc/lightening.tga",
lightning= "pd/lightning.tga",
lightring= "pd/lightring.tga",
lightsmoketrail= "lightsmoketrail.tga",
muzzlefront= "muzzlefront.tga",
muzzleside= "muzzleside.tga",
new_dirta = "smoke/new_dirta.png",
null= "pd/null.tga",
orangesmoke= "pd/orangesmoke.tga",
orangesmoke2= "pd/smokeorange.tga",
orangesmoke3= "gpl/smoke_orange.png",
pinknovaexplo= "cc/pinknovaexplo.tga",
plasma= "gpl/plasma.tga",
plasma0029= "other/plasma0029.tga",
plasma2= "gpl/plasma.tga",
plasma3= "gpl/plasmashot.png",
purpletrail= "purpletrail.tga",
redexplo= "cc/redexplo.tga",
redlight= "other/light_red.png",
sakexplo= "saktoths/sakexplo.tga",
shell= "pd/shell.tga",
shield= "pd/shield.png",
shield2= "pd/shield2.png",
shield3hex= "pd/shield3hex.png",
shield3mist= "pd/shield3mist.png",
shield3wake= "pd/shield3wake.png",
smallflare= "gpl/smallflare.tga",
smoke= "pd/smokesmall.tga",
smokesmall= "pd/smokesmall.tga",
smoketrailthinner= "pd/smoketrailthinner.tga",
smoke1="pd/smoke1.tga",
shockwave="pd/shockwave.tga",
spark="pd/spark.tga",
splashbase= "pd/splashbase.tga",
splashside= "pd/splashside.tga",
sporetrail= "gpl/sporetrail.tga",
sporetrail2= "gpl/sporetrail2.tga",
sporetrailblue= "gpl/sporetrailblue.tga",
starexplo= "saktoths/starexplo.tga",
uglynovaexplo= "cc/uglynovaexplo.tga",
whitelightb= "pd/whitelightningball.tga",
whitelightgpl = 'GPL/lightw.png',
sonic_glow = "sonic_glow.png",
},
},
}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
return resources
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/bio_engineer/bio_component/bio_component_clothing_field_armor_2.lua | 3 | 2404 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_bio_engineer_bio_component_bio_component_clothing_field_armor_2 = object_draft_schematic_bio_engineer_bio_component_shared_bio_component_clothing_field_armor_2:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_bio_engineer_bio_component_bio_component_clothing_field_armor_2, "object/draft_schematic/bio_engineer/bio_component/bio_component_clothing_field_armor_2.iff")
| agpl-3.0 |
Whitechaser/darkstar | scripts/zones/Bastok_Mines/npcs/Rashid.lua | 5 | 3349 | -----------------------------------
-- Area: Bastok Mines
-- NPC: Rashid
-- Type: Mission Giver
-- !pos -8.444 -2 -123.575 234
-----------------------------------
package.loaded["scripts/zones/Bastok_Mines/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/zones/Bastok_Mines/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
local CurrentMission = player:getCurrentMission(BASTOK);
local Count = trade:getItemCount();
if (CurrentMission ~= 255) then
if (CurrentMission == FETICHISM and player:hasCompletedMission(BASTOK,FETICHISM) == false and trade:hasItemQty(606,1) and trade:hasItemQty(607,1) and trade:hasItemQty(608,1) and trade:hasItemQty(609,1) and Count == 4) then
player:startEvent(1008); -- Finish Mission "Fetichism" (First Time)
elseif (CurrentMission == FETICHISM and trade:hasItemQty(606,1) and trade:hasItemQty(607,1) and trade:hasItemQty(608,1) and trade:hasItemQty(609,1) and Count == 4) then
player:startEvent(1005); -- Finish Mission "Fetichism" (Repeat)
elseif (CurrentMission == TO_THE_FORSAKEN_MINES and player:hasCompletedMission(BASTOK,TO_THE_FORSAKEN_MINES) == false and trade:hasItemQty(563,1) and Count == 1) then
player:startEvent(1010); -- Finish Mission "To the forsaken mines" (First Time)
elseif (CurrentMission == TO_THE_FORSAKEN_MINES and trade:hasItemQty(563,1) and Count == 1) then
player:startEvent(1006); -- Finish Mission "To the forsaken mines" (Repeat)
end
end
end;
function onTrigger(player,npc)
if (player:getNation() ~= NATION_BASTOK) then
player:startEvent(1003); -- For non-Bastokian
else
local CurrentMission = player:getCurrentMission(BASTOK);
local cs, p, offset = getMissionOffset(player,1,CurrentMission,player:getVar("MissionStatus"));
if (cs ~= 0 or offset ~= 0 or ((CurrentMission == 0 or CurrentMission == 16) and offset == 0)) then
if (CurrentMission <= 15 and cs == 0) then
player:showText(npc,ORIGINAL_MISSION_OFFSET + offset); -- dialog after accepting mission (Rank 1~5)
elseif (CurrentMission > 15 and cs == 0) then
player:showText(npc,EXTENDED_MISSION_OFFSET + offset); -- dialog after accepting mission (Rank 6~10)
else
player:startEvent(cs,p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8]);
end
elseif (player:getRank() == 1 and player:hasCompletedMission(BASTOK,THE_ZERUHN_REPORT) == false) then
player:startEvent(1000); -- Start First Mission "The Zeruhn Report"
elseif (CurrentMission ~= 255) then
player:startEvent(1002); -- Have mission already activated
else
local flagMission, repeatMission = getMissionMask(player);
player:startEvent(1001,flagMission,0,0,0,0,repeatMission); -- Mission List
end
end
end;
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
finishMissionTimeline(player,1,csid,option);
end; | gpl-3.0 |
DailyShana/ygopro-scripts | c25119460.lua | 3 | 3470 | --YZ-キャタピラー・ドラゴン
function c25119460.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,65622692,64500000,true,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c25119460.splimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c25119460.spcon)
e2:SetOperation(c25119460.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25119460,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c25119460.descost)
e3:SetTarget(c25119460.destg)
e3:SetOperation(c25119460.desop)
c:RegisterEffect(e3)
end
function c25119460.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA+LOCATION_GRAVE)
end
function c25119460.spfilter(c,code)
return c:IsCode(code) and c:IsAbleToRemoveAsCost()
end
function c25119460.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
local g1=Duel.GetMatchingGroup(c25119460.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g2=Duel.GetMatchingGroup(c25119460.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
if g1:GetCount()==0 or g2:GetCount()==0 then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
if ft==-1 then return f1>0 and f2>0
else return f1>0 or f2>0 end
end
function c25119460.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c25119460.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g2=Duel.GetMatchingGroup(c25119460.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
g1:Remove(Card.IsCode,nil,tc:GetCode())
ft=ft+1
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c25119460.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c25119460.filter(c)
return c:IsFacedown() and c:IsDestructable()
end
function c25119460.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c25119460.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c25119460.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c25119460.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c25119460.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
| gpl-2.0 |
Whitechaser/darkstar | scripts/globals/spells/cure_iv.lua | 2 | 4857 | -----------------------------------------
-- Spell: Cure IV
-- Restores target's HP.
-----------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/magic");
require("scripts/globals/msg");
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
local divisor = 0;
local constant = 0;
local basepower = 0;
local power = 0;
local basecure = 0;
local final = 0;
local minCure = 270;
if (USE_OLD_CURE_FORMULA == true) then
power = getCurePowerOld(caster);
rate = 0.6666;
constant = 165;
if (power > 460) then
rate = 6.5;
constant = 354.6666;
elseif (power > 220) then
rate = 2;
constant = 275;
end
else
power = getCurePower(caster);
if (power < 200) then
divisor = 1;
constant = 270;
basepower = 70;
elseif (power < 300) then
divisor = 2;
constant = 400;
basepower = 200;
elseif (power < 400) then
divisor = 10/7;
constant = 450;
basepower = 300;
elseif (power < 700) then
divisor = 2.5;
constant = 520;
basepower = 400;
else
divisor = 999999;
constant = 640;
basepower = 0;
end
end
if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == TYPE_PC or target:getObjType() == TYPE_MOB)) then
if (USE_OLD_CURE_FORMULA == true) then
basecure = getBaseCure(power,divisor,constant);
else
basecure = getBaseCure(power,divisor,constant,basepower)
end
final = getCureFinal(caster,spell,basecure,minCure,false);
if (caster:hasStatusEffect(dsp.effects.AFFLATUS_SOLACE) and target:hasStatusEffect(dsp.effects.STONESKIN) == false) then
local solaceStoneskin = 0;
local equippedBody = caster:getEquipID(SLOT_BODY);
if (equippedBody == 11186) then
solaceStoneskin = math.floor(final * 0.30);
elseif (equippedBody == 11086) then
solaceStoneskin = math.floor(final * 0.35);
else
solaceStoneskin = math.floor(final * 0.25);
end
target:addStatusEffect(dsp.effects.STONESKIN,solaceStoneskin,0,25);
end;
final = final + (final * (target:getMod(MOD_CURE_POTENCY_RCVD)/100));
--Applying server mods....
final = final * CURE_POWER;
local diff = (target:getMaxHP() - target:getHP());
if (final > diff) then
final = diff;
end
target:addHP(final);
target:wakeUp();
caster:updateEnmityFromCure(target,final);
else
if (target:isUndead()) then
spell:setMsg(msgBasic.MAGIC_DMG);
local params = {};
params.dmg = minCure;
params.multiplier = 1;
params.skillType = HEALING_MAGIC_SKILL;
params.attribute = MOD_MND;
params.hasMultipleTargetReduction = false;
local dmg = calculateMagicDamage(caster, target, spell, params)*0.5;
local params = {};
params.diff = caster:getStat(MOD_MND)-target:getStat(MOD_MND);
params.attribute = MOD_MND;
params.skillType = HEALING_MAGIC_SKILL;
params.bonus = 1.0;
local resist = applyResistance(caster, target, spell, params);
dmg = dmg*resist;
dmg = addBonuses(caster,spell,target,dmg);
dmg = adjustForTarget(target,dmg,spell:getElement());
dmg = finalMagicAdjustments(caster,target,spell,dmg);
final = dmg;
target:delHP(final);
target:updateEnmityFromDamage(caster,final);
elseif (caster:getObjType() == TYPE_PC) then
spell:setMsg(msgBasic.MAGIC_NO_EFFECT);
else
-- e.g. monsters healing themselves.
if (USE_OLD_CURE_FORMULA == true) then
basecure = getBaseCureOld(power,divisor,constant);
else
basecure = getBaseCure(power,divisor,constant,basepower);
end
final = getCureFinal(caster,spell,basecure,minCure,false);
local diff = (target:getMaxHP() - target:getHP());
if (final > diff) then
final = diff;
end
target:addHP(final);
end
end
local mpBonusPercent = (final*caster:getMod(MOD_CURE2MP_PERCENT))/100;
if (mpBonusPercent > 0) then
caster:addMP(mpBonusPercent);
end
return final;
end;
| gpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/weapon/pistol_blaster_dl44_metal.lua | 1 | 3645 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_weapon_pistol_blaster_dl44_metal = object_draft_schematic_weapon_shared_pistol_blaster_dl44_metal:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "DL44 Metal Pistol",
craftingToolTab = 1, -- (See DraftSchemticImplementation.h)
complexity = 22,
size = 3,
xpType = "crafting_weapons_general",
xp = 80,
assemblySkill = "weapon_assembly",
experimentingSkill = "weapon_experimentation",
customizationSkill = "weapon_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n", "craft_weapon_ingredients_n"},
ingredientTitleNames = {"frame_assembly", "receiver_assembly", "grip_assembly", "powerhandler", "barrel", "scope"},
ingredientSlotType = {0, 0, 0, 1, 1, 3},
resourceTypes = {"steel", "steel", "metal", "object/tangible/component/weapon/shared_blaster_power_handler.iff", "object/tangible/component/weapon/shared_blaster_pistol_barrel.iff", "object/tangible/component/weapon/shared_scope_weapon.iff"},
resourceQuantities = {25, 8, 4, 1, 1, 1},
contribution = {100, 100, 100, 100, 100, 100},
ingredientAppearance = {"", "", "", "", "muzzle", "scope"},
targetTemplate = "object/weapon/ranged/pistol/pistol_dl44_metal.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_weapon_pistol_blaster_dl44_metal, "object/draft_schematic/weapon/pistol_blaster_dl44_metal.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c73178098.lua | 5 | 1074 | --虚栄巨影
function c73178098.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetTarget(c73178098.target)
e1:SetOperation(c73178098.activate)
c:RegisterEffect(e1)
end
function c73178098.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c73178098.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
e1:SetValue(1000)
tc:RegisterEffect(e1)
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/static/item/item_container_inorganic_water.lua | 3 | 2256 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_item_item_container_inorganic_water = object_static_item_shared_item_container_inorganic_water:new {
}
ObjectTemplates:addTemplate(object_static_item_item_container_inorganic_water, "object/static/item/item_container_inorganic_water.iff")
| agpl-3.0 |
KingRaptor/Zero-K | units/fakeunit_los.lua | 1 | 1501 | unitDef = {
unitname = [[fakeunit_los]],
name = [[LOS Provider]],
description = [[Knows all and sees all]],
acceleration = 1,
brakeRate = 0.8,
buildCostEnergy = 0.45,
buildCostMetal = 0.45,
builder = false,
buildPic = [[levelterra.png]],
buildTime = 0.45,
canFly = true,
canGuard = true,
canMove = true,
canPatrol = true,
canSubmerge = false,
canSelfDestruct = false,
category = [[FAKEUNIT]],
cruiseAlt = 300,
customParams = {
dontcount = [[1]],
completely_hidden = 1, -- for widget-senpai not to notice me
},
explodeAs = [[TINY_BUILDINGEX]],
floater = true,
footprintX = 3,
footprintZ = 3,
hoverAttack = true,
iconType = [[none]],
idleAutoHeal = 10,
idleTime = 300,
levelGround = false,
maxDamage = 900000,
maxVelocity = 5,
maxWaterDepth = 0,
minCloakDistance = 9,
noAutoFire = false,
objectName = [[debris1x1b.s3o]],
script = [[fakeunit_los.lua]],
sightDistance = 500,
stealth = true,
turnRate = 0,
workerTime = 0,
}
return lowerkeys({ fakeunit_los = unitDef })
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/clothing/clothing_bandolier_field_03.lua | 2 | 3563 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_clothing_clothing_bandolier_field_03 = object_draft_schematic_clothing_shared_clothing_bandolier_field_03:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Two-Strap Bandolier",
craftingToolTab = 8, -- (See DraftSchemticImplementation.h)
complexity = 20,
size = 2,
xpType = "crafting_clothing_general",
xp = 110,
assemblySkill = "clothing_assembly",
experimentingSkill = "clothing_experimentation",
customizationSkill = "clothing_customization",
customizationOptions = {2},
customizationStringNames = {"/private/index_color_1"},
customizationDefaults = {0},
ingredientTemplateNames = {"craft_clothing_ingredients_n", "craft_clothing_ingredients_n", "craft_clothing_ingredients_n", "craft_clothing_ingredients_n", "craft_clothing_ingredients_n"},
ingredientTitleNames = {"utility_pocket", "load_bearing_harness", "steel_interstructure", "steel_crossframe", "reinforcement"},
ingredientSlotType = {1, 0, 0, 0, 1},
resourceTypes = {"object/tangible/component/clothing/shared_cargo_pocket.iff", "fiberplast", "metal", "metal", "object/tangible/component/clothing/shared_reinforced_fiber_panels.iff"},
resourceQuantities = {1, 20, 15, 10, 1},
contribution = {100, 100, 100, 100, 100},
targetTemplate = "object/tangible/wearables/bandolier/bandolier_s03.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_clothing_clothing_bandolier_field_03, "object/draft_schematic/clothing/clothing_bandolier_field_03.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c4861205.lua | 7 | 1510 | --ミイラの呼び声
function c4861205.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(4861205,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c4861205.condition)
e1:SetTarget(c4861205.target)
e1:SetOperation(c4861205.operation)
c:RegisterEffect(e1)
end
function c4861205.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c4861205.filter(c,e,sp)
return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function c4861205.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c4861205.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c4861205.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c4861205.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
| gpl-2.0 |
fberst/xcsoar | Data/Lua/init.lua | 18 | 1849 | require("gestures");
require("gce");
-- Custom ---------------------------------------------------------------------
xcsoar.replay.start("/home/jmw/.xcsoar/logs/2016-04-03-XFL-A4N-01.igc");
ttarget = 17900.0;
dt = -1;
record = false;
xcsoar.timer.new(10,
function(t)
-- check for replay to have started
if (xcsoar.replay.virtual_time > 0) then
-- on first call, set fast forward time
if (dt<0) then
dt = ttarget - xcsoar.replay.virtual_time;
print("Fast forward ", dt)
xcsoar.replay.fast_forward(dt);
-- detect end condition
elseif (xcsoar.replay.virtual_time > ttarget + 60) then
print("Stop replay")
record = false;
xcsoar.replay.stop();
t:cancel()
-- detect reaching target
elseif (xcsoar.replay.virtual_time >= ttarget) then
if (not record) then
record = true;
print("Reached target time")
end
end
end
end
)
xcsoar.input_event.new("key_UP",
function(e)
print("up");
end
);
xcsoar.input_event.new("key_UP",
function(e)
print("up2");
end
);
xcsoar.input_event.new("key_DOWN",
function(e)
print("erase up");
xcsoar.input_event.clear("key_UP");
end
);
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/hopper/serverobjects.lua | 3 | 2428 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--Children folder includes
includeFile("tangible/hopper/crafting_station_hopper/serverobjects.lua")
includeFile("tangible/hopper/manufacturing_facility_hopper/serverobjects.lua")
-- Server Objects
includeFile("tangible/hopper/crafting_station_ingredient_hopper_1.lua")
includeFile("tangible/hopper/manufacture_installation_ingredient_hopper_1.lua")
includeFile("tangible/hopper/manufacture_installation_output_hopper_1.lua")
| agpl-3.0 |
Whitechaser/darkstar | scripts/globals/items/dish_of_spaghetti_tonno_rosso.lua | 2 | 1210 | -----------------------------------------
-- ID: 5623
-- Item: Dish of Spaghetti Tonno Rosso
-- Food Effect: 30 Mins, All Races
-----------------------------------------
-- Health % 13
-- Health Cap 180
-- Dexterity 1
-- Vitality 2
-- Store TP +6
-- hMP +1
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(dsp.effects.FOOD) == true or target:hasStatusEffect(dsp.effects.FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
function onItemUse(target)
target:addStatusEffect(dsp.effects.FOOD,0,0,3600,5623);
end;
function onEffectGain(target, effect)
target:addMod(MOD_FOOD_HPP, 13);
target:addMod(MOD_FOOD_HP_CAP, 180);
target:addMod(MOD_DEX, 1);
target:addMod(MOD_VIT, 2);
target:addMod(MOD_STORETP, 6);
target:addMod(MOD_HPHEAL, 1);
end;
function onEffectLose(target, effect)
target:delMod(MOD_FOOD_HPP, 13);
target:delMod(MOD_FOOD_HP_CAP, 180);
target:delMod(MOD_DEX, 1);
target:delMod(MOD_VIT, 2);
target:delMod(MOD_STORETP, 6);
target:delMod(MOD_HPHEAL, 1);
end;
| gpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/screenplays/tasks/corellia/corran_horn.lua | 1 | 2425 | corran_horn_missions =
{
{
missionType = "escort",
primarySpawns =
{
{ npcTemplate = "chandra_conrad", planetName = "corellia", npcName = "Chandra Conrad" }
},
secondarySpawns =
{
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" }
},
itemSpawns = {},
rewards =
{
{ rewardType = "credits", amount = 200 }
}
},
{
missionType = "escort",
primarySpawns =
{
{ npcTemplate = "obrio_caldori", planetName = "corellia", npcName = "Obrio Caldori" }
},
secondarySpawns =
{
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" }
},
itemSpawns = {},
rewards =
{
{ rewardType = "credits", amount = 400 }
}
},
{
missionType = "escort",
primarySpawns =
{
{ npcTemplate = "voydd_blancken", planetName = "corellia", npcName = "Voydd Blancken" }
},
secondarySpawns =
{
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" },
{ npcTemplate = "thug", planetName = "corellia", npcName = "a thug" }
},
itemSpawns = {},
rewards =
{
{ rewardType = "credits", amount = 800 }
}
}
}
npcMapCorranHorn =
{
{
spawnData = { planetName = "corellia", npcTemplate = "corran_horn", x = -2.8, z = 2.5, y = 12.1, direction = 40, cellID = 3075353, position = STAND },
worldPosition = { x = 3189, y = 5239 },
npcNumber = 1,
stfFile = "@static_npc/corellia/corran_horn",
missions = corran_horn_missions
}
}
CorranHorn = ThemeParkLogic:new {
numberOfActs = 1,
npcMap = npcMapCorranHorn,
className = "CorranHorn",
screenPlayState = "corran_horn_quest",
distance = 800
}
registerScreenPlay("CorranHorn", true)
corran_horn_mission_giver_conv_handler = mission_giver_conv_handler:new {
themePark = CorranHorn
}
corran_horn_mission_target_conv_handler = mission_target_conv_handler:new {
themePark = CorranHorn
} | agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/static/installation/mockup_mining_ore_harvester_style_2.lua | 3 | 2308 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_installation_mockup_mining_ore_harvester_style_2 = object_static_installation_shared_mockup_mining_ore_harvester_style_2:new {
}
ObjectTemplates:addTemplate(object_static_installation_mockup_mining_ore_harvester_style_2, "object/static/installation/mockup_mining_ore_harvester_style_2.iff")
| agpl-3.0 |
Whitechaser/darkstar | scripts/globals/weaponskills/blade_teki.lua | 24 | 1260 | -----------------------------------
-- Blade Teki
-- Katana weapon skill
-- Skill Level: 70
-- Decription: Deals water elemental damage. Damage varies with TP.
-- Aligned with the Aqua Gorget.
-- Aligned with the Aqua Belt.
-- Element: Water
-- Modifiers: STR:20% ; INT:20%
-- 100%TP 200%TP 300%TP
-- 0.50 0.75 1.00
-----------------------------------
require("scripts/globals/magic");
require("scripts/globals/status");
require("scripts/globals/settings");
require("scripts/globals/weaponskills");
-----------------------------------
function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar)
local params = {};
params.ftp100 = 0.5; params.ftp200 = 0.75; params.ftp300 = 1;
params.str_wsc = 0.2; params.dex_wsc = 0.0; params.vit_wsc = 0.0; params.agi_wsc = 0.0; params.int_wsc = 0.2; params.mnd_wsc = 0.0; params.chr_wsc = 0.0;
params.ele = ELE_WATER;
params.skill = SKILL_KAT;
params.includemab = true;
if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then
params.str_wsc = 0.3; params.int_wsc = 0.3;
end
local damage, criticalHit, tpHits, extraHits = doMagicWeaponskill(player, target, wsID, tp, primary, action, params);
return tpHits, extraHits, criticalHit, damage;
end
| gpl-3.0 |
njligames/NJLIGameEngine | projects/YappyBirds_macOS_Xcode/build/Debug/NJLIGameEngine.app/Contents/Resources/assets/scripts/NJLI/STATEMACHINE/UI/LABEL/STATES/Default.lua | 4 | 6189 | local BaseClass = require "NJLI.STATEMACHINE.NodeEntityState"
local Default = {}
Default.__index = Default
--#############################################################################
--DO NOT EDIT ABOVE
--#############################################################################
--#############################################################################
--Begin Custom Code
--Required local functions:
-- __ctor()
-- __dtor()
-- __load()
-- __unLoad()
--#############################################################################
local __ctor = function(self, init)
--TODO: construct this Entity
end
local __dtor = function(self)
--TODO: destruct this Entity
end
local __load = function(self)
--TODO: load this Entity
end
local __unLoad = function(self)
--TODO: unload this Entity
end
--#############################################################################
--Default Specific
--#############################################################################
--#############################################################################
--NodeEntityState overwrite
--#############################################################################
function Default:enter()
BaseClass.enter(self)
end
function Default:update(timeStep)
BaseClass.update(self, timeStep)
end
function Default:exit()
BaseClass.exit(self)
end
function Default:onMessage()
BaseClass.onMessage(self)
end
function Default:rayTouchesDown(rayContact)
BaseClass.rayTouchesDown(self, rayContact)
end
function Default:rayTouchesUp(rayContact)
BaseClass.rayTouchesUp(self, rayContact)
end
function Default:rayTouchesMove(rayContact)
BaseClass.rayTouchesMove(self, rayContact)
end
function Default:rayTouchesCancelled(rayContact)
BaseClass.rayTouchesCancelled(self, rayContact)
end
function Default:rayTouchesMissed(node)
BaseClass.rayTouchesMissed(self, node)
end
function Default:rayTouchDown(rayContact)
BaseClass.rayTouchDown(self, rayContact)
end
function Default:rayTouchUp(rayContact)
BaseClass.rayTouchUp(self, rayContact)
end
function Default:rayTouchMove(rayContact)
BaseClass.rayTouchMove(self, rayContact)
end
function Default:rayTouchCancelled(rayContact)
BaseClass.rayTouchCancelled(self, rayContact)
end
function Default:rayTouchMissed(node)
BaseClass.rayTouchMissed(self, node)
end
function Default:rayMouseDown(rayContact)
BaseClass.rayMouseDown(self, rayContact)
end
function Default:rayMouseUp(rayContact)
BaseClass.rayMouseUp(self, rayContact)
end
function Default:rayMouseMove(rayContact)
BaseClass.rayMouseMove(self, rayContact)
end
function Default:rayMouseMissed(node)
BaseClass.rayMouseMissed(self, node)
end
function Default:collide(otherNode, collisionPoint)
BaseClass.collide(self, collisionPoint)
end
function Default:near(otherNode)
BaseClass.near(self, otherNode)
end
function Default:actionUpdate(action, timeStep)
BaseClass.actionUpdate(self, timeStep)
end
function Default:actionComplete(action)
BaseClass.actionComplete(self, action)
end
function Default:keyboardShow()
BaseClass.keyboardShow(self)
end
function Default:keyboardCancel()
BaseClass.keyboardCancel(self)
end
function Default:keyboardReturn()
BaseClass.keyboardReturn(self)
end
function Default:renderHUD()
BaseClass.renderHUD(self)
end
function Default:gamePause()
BaseClass.gamePause(self)
end
function Default:gameUnPause()
BaseClass.gameUnPause(self)
end
function Default:touchesDown(touches)
BaseClass.touchesDown(self, touches)
end
function Default:touchesUp(touches)
BaseClass.touchesUp(self, touches)
end
function Default:touchesMove(touches)
BaseClass.touchesMove(self, touches)
end
function Default:touchesCancelled(touches)
BaseClass.touchesCancelled(self, touches)
end
function Default:touchDown(touch)
BaseClass.touchDown(self, touch)
end
function Default:touchUp(touch)
BaseClass.touchUp(self, touch)
end
function Default:touchMove(touch)
BaseClass.touchMove(self, touch)
end
function Default:touchCancelled(touch)
BaseClass.touchCancelled(self, touch)
end
function Default:mouseDown(mouse)
BaseClass.mouseDown(self, mouse)
end
function Default:mouseUp(mouse)
BaseClass.mouseUp(self, mouse)
end
function Default:mouseMove(mouse)
BaseClass.mouseMove(self, mouse)
end
--#############################################################################
--End Custom Code
--#############################################################################
--#############################################################################
--DO NOT EDIT BELOW
--#############################################################################
setmetatable(Default, {
__index = BaseClass,
__call = function (cls, ...)
local self = setmetatable({}, cls)
--Create the base first
BaseClass._create(self, ...)
self:_create(...)
return self
end,
})
function Default:className()
return "Default"
end
function Default:class()
return self
end
function Default:superClass()
return BaseClass
end
function Default:__gc()
--Destroy derived class first
Default._destroy(self)
--Destroy base class after derived class
BaseClass._destroy(self)
end
function Default:__tostring()
local ret = self:className() .. " =\n{\n"
for pos,val in pairs(self) do
ret = ret .. "\t" .. "["..pos.."]" .. " => " .. type(val) .. " = " .. tostring(val) .. "\n"
end
ret = ret .. "\n\t" .. tostring_r(BaseClass) .. "\n}"
return ret .. "\n\t" .. tostring_r(getmetatable(self)) .. "\n}"
end
function Default:_destroy()
assert(not self.__DefaultCalledLoad, "Must unload before you destroy")
__dtor(self)
end
function Default:_create(init)
self.__DefaultCalledLoad = false
__ctor(self, init)
end
function Default:load()
--load base first
BaseClass.load(self)
--load derived last...
__load(self)
self.__DefaultCalledLoad = true
end
function Default:unLoad()
assert(self.__DefaultCalledLoad, "Must load before unloading")
--unload derived first...
__unLoad(self)
self.__DefaultCalledLoad = false
--unload base last...
BaseClass.unLoad(self)
end
return Default
| mit |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/loot/quest/force_sensitive/camp_remote.lua | 1 | 2291 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_loot_quest_force_sensitive_camp_remote = object_tangible_loot_quest_force_sensitive_shared_camp_remote:new {
noTrade = 1,
}
ObjectTemplates:addTemplate(object_tangible_loot_quest_force_sensitive_camp_remote, "object/tangible/loot/quest/force_sensitive/camp_remote.iff")
| agpl-3.0 |
Whitechaser/darkstar | scripts/zones/Port_San_dOria/npcs/Patolle.lua | 5 | 1576 | -----------------------------------
-- Area: Port San d'Oria
-- NPC: Patolle
-- Only sells when San d'Oria controlls Kuzotz Region
-- Working 100%
-----------------------------------
package.loaded["scripts/zones/Port_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Port_San_dOria/TextIDs");
require("scripts/globals/conquest");
require("scripts/globals/quests");
require("scripts/globals/shop");
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
local FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
local count = trade:getItemCount();
local MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
function onTrigger(player,npc)
local RegionOwner = GetRegionOwner(KUZOTZ);
if (RegionOwner ~= NATION_SANDORIA) then
player:showText(npc,PATOLLE_CLOSED_DIALOG);
else
player:showText(npc,PATOLLE_OPEN_DIALOG);
local stock =
{
916, 855, -- Cactuar Needle
4412, 299, -- Thundermelon
4491, 184 -- Watermelon
}
showShop(player,SANDORIA,stock);
end
end;
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
vansatchen/dlink327 | releases/sources/Domoticz/domoticz/scripts/dzVents/examples/notify for dead system-alive check devices.lua | 6 | 1615 | -- this script can be used in conjunction with the System-alive checker plug-in.
-- the plugin pings a list of devices and creates switches for these devices
-- the reason for this script is to not treat devices as dead immediately after they
-- do not respond. More often than not, the second ping atempt does work. So only
-- if the device has been not responding for a while AFTER it is been presumed dead
-- then this script will notify you
-- put the names of these switches in the devicesToCheck list
-- you may have to tweak the THRESHOLD depending on the check interval
local THRESHOLD = 5 -- minutes
local devicesToCheck = {'ESP8266 CV', 'ESP8266 ManCave', 'ESP8266 Watermeter'}
return {
active = true,
on = {
devices = {
devicesToCheck
},
timer = {
'every 5 minutes'
}
},
data = {
notified = { initial = {} }
},
execute = function(domoticz, device, triggerInfo)
if (triggerInfo.type == domoticz.EVENT_TYPE_TIMER) then
-- check all devices that are off and have not been updated in the past 5 minutes and have not been notified for
for index, deviceName in pairs(devicesToCheck) do
local device = domoticz.devices(deviceName)
if (device.state == 'Off' and
device.lastUpdate.minutesAgo >= THRESHOLD and
domoticz.data.notified[deviceName] == false) then
domoticz.notify(deviceName .. ' is not responding anymore.',' ',domoticz.PRIORITY_HIGH)
-- make sure we only notify once for this device in this case
domoticz.data.notified[deviceName] = true
end
end
else
domoticz.data.notified[device.name] = false
end
end
} | gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/mission/mission_informant_spawner_hard.lua | 3 | 2276 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_mission_mission_informant_spawner_hard = object_tangible_mission_shared_mission_informant_spawner_hard:new {
}
ObjectTemplates:addTemplate(object_tangible_mission_mission_informant_spawner_hard, "object/tangible/mission/mission_informant_spawner_hard.iff")
| agpl-3.0 |
Whitechaser/darkstar | scripts/zones/Caedarva_Mire/npcs/Nareema.lua | 5 | 2412 | -----------------------------------
-- Area: Caedarva Mire
-- NPC: Nareema
-- Type: Assault
-- !pos 518.387 -24.707 -467.297 79
-----------------------------------
package.loaded["scripts/zones/Caedarva_Mire/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/globals/quests");
require("scripts/zones/Caedarva_Mire/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
local toauMission = player:getCurrentMission(TOAU);
local beginnings = player:getQuestStatus(AHT_URHGAN,BEGINNINGS);
-- IMMORTAL SENTRIES
if (toauMission == IMMORTAL_SENTRIES) then
if (player:hasKeyItem(SUPPLIES_PACKAGE)) then
player:startEvent(5,1);
elseif (player:getVar("AhtUrganStatus") == 1) then
player:startEvent(6,1);
end;
-- BEGINNINGS
elseif (beginnings == QUEST_ACCEPTED) then
if (not player:hasKeyItem(BRAND_OF_THE_STONESERPENT)) then
player:startEvent(12); -- brands you
else
player:startEvent(13); -- blue muddies the purest waters
end;
-- ASSAULT
elseif (toauMission >= PRESIDENT_SALAHEEM) then
local IPpoint = player:getCurrency("imperial_standing");
if (player:hasKeyItem(LEUJAOAM_ASSAULT_ORDERS) and player:hasKeyItem(ASSAULT_ARMBAND) == false) then
player:startEvent(149,50,IPpoint);
else
player:startEvent(7,1);
-- player:delKeyItem(ASSAULT_ARMBAND);
end;
-- DEFAULT DIALOG
else
player:startEvent(4);
end;
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
-- IMMORTAL SENTRIES
if (csid == 5 and option == 1) then
player:delKeyItem(SUPPLIES_PACKAGE);
player:setVar("AhtUrganStatus",1);
-- BEGINNINGS
elseif (csid == 12) then
player:addKeyItem(BRAND_OF_THE_STONESERPENT);
player:messageSpecial(KEYITEM_OBTAINED,BRAND_OF_THE_STONESERPENT);
-- ASSAULT
elseif (csid == 149 and option == 1) then
player:delCurrency("imperial_standing", 50);
player:addKeyItem(ASSAULT_ARMBAND);
player:messageSpecial(KEYITEM_OBTAINED,ASSAULT_ARMBAND);
end;
end;
| gpl-3.0 |
DailyShana/ygopro-scripts | c83519853.lua | 5 | 3141 | --魔聖騎士皇ランスロット
function c83519853.initial_effect(c)
c:SetUniqueOnField(1,0,83519853)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x107a),1)
c:EnableReviveLimit()
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(83519853,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c83519853.condition)
e1:SetTarget(c83519853.target)
e1:SetOperation(c83519853.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c83519853.regcon)
e2:SetOperation(c83519853.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(83519853,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c83519853.thcon)
e3:SetTarget(c83519853.thtg)
e3:SetOperation(c83519853.thop)
c:RegisterEffect(e3)
end
function c83519853.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c83519853.filter(c,ec)
return c:IsSetCard(0x207a) and c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(ec)
end
function c83519853.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c83519853.filter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c83519853.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c83519853.filter,tp,LOCATION_DECK,0,1,1,nil,c)
local tc=g:GetFirst()
if tc then
Duel.Equip(tp,tc,c,true)
end
end
function c83519853.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c83519853.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(83519853,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c83519853.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(83519853)~=0
end
function c83519853.thfilter(c)
return (c:IsSetCard(0x107a) or c:IsSetCard(0x207a)) and c:IsAbleToHand()
end
function c83519853.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c83519853.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c83519853.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c83519853.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
| gpl-2.0 |
Whitechaser/darkstar | scripts/zones/QuBia_Arena/bcnms/those_who_lurk_in_shadows.lua | 5 | 2390 | -----------------------------------
-- Area: Qu'Bia Arena
-- NPC: Those Who Lurk in Shadows
-- !pos -221 -24 19 206
-----------------------------------
package.loaded["scripts/zones/QuBia_Arena/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/keyitems");
require("scripts/globals/missions");
require("scripts/zones/QuBia_Arena/TextIDs");
-----------------------------------
-- After registering the BCNM via bcnmRegister(bcnmid)
function onBcnmRegister(player,instance)
end;
-- Physically entering the BCNM via bcnmEnter(bcnmid)
function onBcnmEnter(player,instance)
end;
-- Leaving the BCNM by every mean possible, given by the LeaveCode
-- 1=Select Exit on circle
-- 2=Winning the BC
-- 3=Disconnected or warped out
-- 4=Losing the BC
-- via bcnmLeave(1) or bcnmLeave(2). LeaveCodes 3 and 4 are called
-- from the core when a player disconnects or the time limit is up, etc
function onBcnmLeave(player,instance,leavecode)
-- print("leave code "..leavecode);
if (player:hasKeyItem(MARK_OF_SEED)) then
player:delKeyItem(MARK_OF_SEED);
end
if (leavecode == 2) then -- Play end CS. Need time and battle id for record keeping + storage
player:addExp(700);
if (player:getCurrentMission(ACP) == THOSE_WHO_LURK_IN_SHADOWS_III) then
player:startEvent(32001,1,1,1,instance:getTimeInside(),1,20,0);
else -- Gives skip dialog if previously completed
player:startEvent(32001,1,1,1,instance:getTimeInside(),1,20,1);
end
elseif (leavecode == 4) then
player:startEvent(32002);
end
end;
function onEventUpdate(player,csid,option)
-- print("bc update csid "..csid.." and option "..option);
end;
function onEventFinish(player,csid,option)
-- print("bc finish csid "..csid.." and option "..option);
if (csid == 32001) then
if (player:getCurrentMission(ACP) == THOSE_WHO_LURK_IN_SHADOWS_III) then
player:completeMission(ACP,THOSE_WHO_LURK_IN_SHADOWS_III);
player:addMission(ACP,REMEMBER_ME_IN_YOUR_DREAMS);
end
if (player:hasKeyItem(IVORY_KEY) == false and player:getCurrentMission(ACP) >= THOSE_WHO_LURK_IN_SHADOWS_III) then
player:addKeyItem(IVORY_KEY);
player:setVar("LastIvoryKey", os.date("%j"));
player:messageSpecial(KEYITEM_OBTAINED,IVORY_KEY);
end
end
end; | gpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/lair/pharple/objects.lua | 3 | 5496 | --Copyright (C) 2009 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--which carries forward this exception.
object_tangible_lair_pharple_shared_lair_pharple = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/lair/pharple/shared_lair_pharple.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/defaultappearance.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 25,
clientDataFile = "clientdata/client_shared_lair_small.cdf",
clientGameObjectType = 4,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@lair_d:pharple",
gameObjectType = 4,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 64,
objectName = "@lair_n:pharple",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3003958462,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/lair/base/shared_lair_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_lair_pharple_shared_lair_pharple, "object/tangible/lair/pharple/shared_lair_pharple.iff")
object_tangible_lair_pharple_shared_lair_pharple_wasteland = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/lair/pharple/shared_lair_pharple_wasteland.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/defaultappearance.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 25,
clientDataFile = "clientdata/client_shared_lair_small.cdf",
clientGameObjectType = 4,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@lair_d:pharple_wasteland",
gameObjectType = 4,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 64,
objectName = "@lair_n:pharple_wasteland",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4033646950,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/lair/base/shared_lair_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_lair_pharple_shared_lair_pharple_wasteland, "object/tangible/lair/pharple/shared_lair_pharple_wasteland.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/furniture/furniture_lamp_free_s03_on.lua | 2 | 3341 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_furniture_furniture_lamp_free_s03_on = object_draft_schematic_furniture_shared_furniture_lamp_free_s03_on:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Free-standing Lamp \'Tallbirch\'",
craftingToolTab = 512, -- (See DraftSchemticImplementation.h)
complexity = 18,
size = 1,
xpType = "crafting_structure_general",
xp = 250,
assemblySkill = "structure_assembly",
experimentingSkill = "structure_experimentation",
customizationSkill = "structure_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_furniture_ingredients_n", "craft_furniture_ingredients_n", "craft_furniture_ingredients_n", "craft_furniture_ingredients_n"},
ingredientTitleNames = {"lamp_body", "neck", "lamp_assembly", "shade"},
ingredientSlotType = {0, 0, 0, 0},
resourceTypes = {"metal", "metal", "metal", "mineral"},
resourceQuantities = {40, 50, 15, 20},
contribution = {100, 100, 100, 100},
targetTemplate = "object/tangible/furniture/all/frn_all_light_lamp_free_s03.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_furniture_furniture_lamp_free_s03_on, "object/draft_schematic/furniture/furniture_lamp_free_s03_on.iff")
| agpl-3.0 |
Goodzilam/b | plugins/danbooru.lua | 616 | 1750 | do
local URL = "http://danbooru.donmai.us"
local URL_NEW = "/posts.json"
local URL_POP = "/explore/posts/popular.json"
local scale_day = "?scale=day"
local scale_week = "?scale=week"
local scale_month = "?scale=month"
local function get_post(url)
local b, c, h = http.request(url)
if c ~= 200 then return nil end
local posts = json:decode(b)
return posts[math.random(#posts)]
end
local function run(msg, matches)
local url = URL
if matches[1] == "!danbooru" then
url = url .. URL_NEW
else
url = url .. URL_POP
if matches[1] == "d" then
url = url .. scale_day
elseif matches[1] == "w" then
url = url .. scale_week
elseif matches[1] == "m" then
url = url .. scale_month
end
end
local post = get_post(url)
if post then
vardump(post)
local img = URL .. post.large_file_url
send_photo_from_url(get_receiver(msg), img)
local txt = ''
if post.tag_string_artist ~= '' then
txt = 'Artist: ' .. post.tag_string_artist .. '\n'
end
if post.tag_string_character ~= '' then
txt = txt .. 'Character: ' .. post.tag_string_character .. '\n'
end
if post.file_size ~= '' then
txt = txt .. '[' .. math.ceil(post.file_size/1000) .. 'kb] ' .. URL .. post.file_url
end
return txt
end
end
return {
description = "Gets a random fresh or popular image from Danbooru",
usage = {
"!danbooru - gets a random fresh image from Danbooru 🔞",
"!danboorud - random daily popular image 🔞",
"!danbooruw - random weekly popular image 🔞",
"!danboorum - random monthly popular image 🔞"
},
patterns = {
"^!danbooru$",
"^!danbooru ?(d)$",
"^!danbooru ?(w)$",
"^!danbooru ?(m)$"
},
run = run
}
end | gpl-2.0 |
DailyShana/ygopro-scripts | c34160055.lua | 5 | 1181 | --龍炎剣の使い手
function c34160055.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34160055,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c34160055.target)
e1:SetOperation(c34160055.operation)
c:RegisterEffect(e1)
end
function c34160055.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return tc:IsControler(tp) and not tc:IsCode(34160055) end
tc:CreateEffectRelation(e)
end
function c34160055.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(300)
e2:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
end
| gpl-2.0 |
KingRaptor/Zero-K | LuaRules/Utilities/vector.lua | 11 | 1621 | local sqrt = math.sqrt
local pi = math.pi
local cos = math.cos
local sin = math.sin
local function DistSq(x1,z1,x2,z2)
return (x1 - x2)*(x1 - x2) + (z1 - z2)*(z1 - z2)
end
local function Mult(b, v)
return {b*v[1], b*v[2]}
end
local function AbsVal(x, y, z)
if z then
return sqrt(x*x + y*y + z*z)
elseif y then
return sqrt(x*x + y*y)
elseif x[3] then
return sqrt(x[1]*x[1] + x[2]*x[2] + x[3]*x[3])
else
return sqrt(x[1]*x[1] + x[2]*x[2])
end
end
local function Unit(v)
local mag = AbsVal(v)
if mag > 0 then
return {v[1]/mag, v[2]/mag}
else
return v
end
end
local function Norm(b, v)
local mag = AbsVal(v)
if mag > 0 then
return {b*v[1]/mag, b*v[2]/mag}
else
return v
end
end
local function Angle(x,z)
if not z then
x,z = x[1], x[2]
end
if x == 0 and z == 0 then
return 0
end
local mult = 1/AbsVal(x, z)
x, z = x*mult, z*mult
if z > 0 then
return math.acos(x)
elseif z < 0 then
return 2*math.pi - math.acos(x)
elseif x < 0 then
return math.pi
end
-- x < 0
return 0
end
-- Spring.GetHeadingFromVector is actually broken at angles close to pi/4 and reflections
local function AngleSpringHeaving(x, z)
if z then
return -Spring.GetHeadingFromVector(x, z)/2^15*pi + pi/2
else
return -Spring.GetHeadingFromVector(x[1], x[2])/2^15*pi + pi/2
end
end
local function PolarToCart(mag, dir)
return {mag*cos(dir), mag*sin(dir)}
end
local function Add(v1, v2)
return {v1[1] + v2[1], v1[2] + v2[2]}
end
Spring.Utilities.Vector = {
DistSq = DistSq,
Mult = Mult,
AbsVal = AbsVal,
Unit = Unit,
Norm = Norm,
Angle = Angle,
PolarToCart = PolarToCart,
Add = Add,
} | gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/static/structure/general/web_06.lua | 3 | 2212 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_structure_general_web_06 = object_static_structure_general_shared_web_06:new {
}
ObjectTemplates:addTemplate(object_static_structure_general_web_06, "object/static/structure/general/web_06.iff")
| agpl-3.0 |
Zefiros-Software/premake-core | modules/vstudio/tests/vc2010/test_manifest.lua | 14 | 1667 | --
-- tests/actions/vstudio/vc2010/test_manifest.lua
-- Validate generation of Manifest block in Visual Studio 201x C/C++ projects.
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
--
local p = premake
local suite = test.declare("vs2010_manifest")
local vc2010 = p.vstudio.vc2010
local project = p.project
--
-- Setup
--
local wks, prj
function suite.setup()
p.action.set("vs2010")
wks, prj = test.createWorkspace()
kind "ConsoleApp"
end
local function prepare(platform)
local cfg = test.getconfig(prj, "Debug", platform)
vc2010.manifest(cfg)
end
--
-- Check the basic element structure with default settings.
--
function suite.defaultSettings()
files { "source/test.manifest" }
prepare()
test.capture [[
<Manifest>
<AdditionalManifestFiles>source/test.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
</Manifest>
]]
end
--
-- Check that there is no manifest when using static lib
--
function suite.staticLib()
kind "StaticLib"
files { "test.manifest" }
prepare()
test.isemptycapture()
end
--
-- Check that DPI Awareness emits correctly
--
function suite.dpiAwareness_None()
dpiawareness "None"
prepare()
test.capture [[
<Manifest>
<EnableDpiAwareness>false</EnableDpiAwareness>
</Manifest>
]]
end
function suite.dpiAwareness_High()
dpiawareness "High"
prepare()
test.capture [[
<Manifest>
<EnableDpiAwareness>true</EnableDpiAwareness>
</Manifest>
]]
end
function suite.dpiAwareness_HighPerMonitor()
dpiawareness "HighPerMonitor"
prepare()
test.capture [[
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
</Manifest>
]]
end
| bsd-3-clause |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/mission/quest_item/aaph_koden_q1_needed.lua | 3 | 2280 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_mission_quest_item_aaph_koden_q1_needed = object_tangible_mission_quest_item_shared_aaph_koden_q1_needed:new {
}
ObjectTemplates:addTemplate(object_tangible_mission_quest_item_aaph_koden_q1_needed, "object/tangible/mission/quest_item/aaph_koden_q1_needed.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c69303178.lua | 5 | 1304 | --光神機-桜火
function c69303178.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(69303178,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c69303178.ntcon)
e1:SetOperation(c69303178.ntop)
c:RegisterEffect(e1)
end
function c69303178.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c69303178.ntop(e,tp,eg,ep,ev,re,r,rp,c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(69303178,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetTarget(c69303178.tgtg)
e1:SetOperation(c69303178.tgop)
e1:SetReset(RESET_EVENT+0xc6e0000)
c:RegisterEffect(e1)
end
function c69303178.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c69303178.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
| gpl-2.0 |
Whitechaser/darkstar | scripts/globals/spells/diaga_iii.lua | 2 | 2374 | -----------------------------------------
-- Spell: Diaga III
-- Lowers an enemy's defense and gradually deals light elemental damage.
-----------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/magic");
require("scripts/globals/msg");
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
--calculate raw damage
local basedmg = caster:getSkillLevel(ENFEEBLING_MAGIC_SKILL) / 3;
local params = {};
params.dmg = basedmg;
params.multiplier = 5;
params.skillType = ENFEEBLING_MAGIC_SKILL;
params.attribute = MOD_INT;
params.hasMultipleTargetReduction = false;
local dmg = calculateMagicDamage(caster, target, spell, params);
dmg = utils.clamp(dmg, 1, 60);
--get resist multiplier (1x if no resist)
local params = {};
params.diff = caster:getStat(MOD_INT)-target:getStat(MOD_INT);
params.attribute = MOD_INT;
params.skillType = ENFEEBLING_MAGIC_SKILL;
params.bonus = 1.0;
local resist = applyResistance(caster, target, spell, params);
--get the resisted damage
dmg = dmg*resist;
--add on bonuses (staff/day/weather/jas/mab/etc all go in this function)
dmg = addBonuses(caster,spell,target,dmg);
--add in target adjustment
dmg = adjustForTarget(target,dmg,spell:getElement());
--add in final adjustments including the actual damage dealt
local final = finalMagicAdjustments(caster,target,spell,dmg);
-- Calculate duration and bonus
local duration = 120;
local dotBonus = caster:getMod(MOD_DIA_DOT); -- Dia Wand
if (caster:hasStatusEffect(dsp.effects.SABOTEUR)) then
duration = duration * 2;
caster:delStatusEffect(dsp.effects.SABOTEUR);
end
-- Check for Bio.
local bio = target:getStatusEffect(dsp.effects.BIO);
-- Do it!
if (target:addStatusEffect(dsp.effects.DIA,3+dotBonus,3,duration,FLAG_ERASABLE,15,3)) then
spell:setMsg(msgBasic.MAGIC_DMG);
else
spell:setMsg(msgBasic.MAGIC_NO_EFFECT);
end
-- Try to kill same tier Bio
if (BIO_OVERWRITE == 1 and bio ~= nil) then
if (bio:getPower() <= 3) then
target:delStatusEffect(dsp.effects.BIO);
end
end
return final;
end;
| gpl-3.0 |
KingRaptor/Zero-K | LuaUI/Widgets/gui_replace_cloak_con_order.lua | 12 | 2136 |
function widget:GetInfo()
return {
name = "Replace Cloak Con Orders",
desc = "Prevents constructor accidental decloak in enemy territory by replacing Repair, Reclaim and Rez with Move. .\n\nNOTE:Use command menu or command hotkeys to override.",
author = "GoogleFrog",
date = "13 August 2011",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = false -- loaded by default?
}
end
options_path = 'Game/Unit AI/Replace Cloak Con Orders'
options = {
reclaim = {name='Replace Reclaim', type='bool', value=true},
resurrect = {name='Replace Resurrect', type='bool', value=true},
repair = {name='Replace Repair', type='bool', value=true},
}
function widget:CommandNotify(id, params, cmdOptions)
if cmdOptions.right and #params < 4 and ((id == CMD.REPAIR and options.repair.value) or
(id == CMD.RECLAIM and options.reclaim.value) or (id == CMD.RESURRECT and options.resurrect.value)) then
local selUnits = Spring.GetSelectedUnits()
local replace = false
for i = 1, #selUnits do
local unitID = selUnits[i]
local ud = Spring.GetUnitDefID(unitID)
-- assumption here is that everything that can repair or rez can also reclaim
if ud and UnitDefs[ud] and UnitDefs[ud].canReclaim and Spring.GetUnitIsCloaked(unitID) and UnitDefs[ud].speed > 0 then
replace = true
break
end
end
if replace then
local x,y,z
if #params == 1 then
if id == CMD.REPAIR then
if Spring.ValidUnitID(params[1]) and Spring.GetUnitPosition(params[1]) then
x,_,z = Spring.GetUnitPosition(params[1])
y = Spring.GetGroundHeight(x,z)
end
else
params[1] = params[1] - Game.maxUnits
if Spring.ValidFeatureID(params[1]) and Spring.GetFeaturePosition(params[1]) then
x,_,z = Spring.GetFeaturePosition(params[1])
y = Spring.GetGroundHeight(x,z)
end
end
else
x,y,z = params[1], params[2], params[3]
end
if x and y then
for i = 1, #selUnits do
local unitID = selUnits[i]
Spring.GiveOrderToUnit(unitID,CMD.MOVE,{x,y,z},cmdOptions)
end
end
end
return replace
end
return false
end | gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/space/armor/heavy_durasteel_plating.lua | 1 | 3489 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_space_armor_heavy_durasteel_plating = object_draft_schematic_space_armor_shared_heavy_durasteel_plating:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Mark III Durasteel Plating",
craftingToolTab = 131072, -- (See DraftSchemticImplementation.h)
complexity = 29,
size = 1,
xpType = "shipwright",
xp = 250,
assemblySkill = "chassis_assembly",
experimentingSkill = "chassis_experimentation",
customizationSkill = "medicine_customization",
disableFactoryRun = true,
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n"},
ingredientTitleNames = {"ship_skin", "steel_frame", "armor_upgrade", "absorptive_layer", "plate_lubricant"},
ingredientSlotType = {0, 0, 3, 0, 0},
resourceTypes = {"aluminum", "steel", "object/tangible/ship/crafted/armor/shared_base_armor_subcomponent_mk3.iff", "ore", "petrochem_inert"},
resourceQuantities = {250, 250, 1, 250, 250},
contribution = {100, 100, 100, 100, 100},
targetTemplate = "object/tangible/ship/crafted/armor/heavy_durasteel_plating.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_space_armor_heavy_durasteel_plating, "object/draft_schematic/space/armor/heavy_durasteel_plating.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/furniture/furniture_chair_loveseat_cheap.lua | 2 | 3186 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_furniture_furniture_chair_loveseat_cheap = object_draft_schematic_furniture_shared_furniture_chair_loveseat_cheap:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Loveseat",
craftingToolTab = 512, -- (See DraftSchemticImplementation.h)
complexity = 14,
size = 2,
xpType = "crafting_structure_general",
xp = 300,
assemblySkill = "structure_assembly",
experimentingSkill = "structure_experimentation",
customizationSkill = "structure_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_furniture_ingredients_n", "craft_furniture_ingredients_n"},
ingredientTitleNames = {"frame", "upholstery"},
ingredientSlotType = {0, 0},
resourceTypes = {"metal", "hide"},
resourceQuantities = {80, 70},
contribution = {100, 100},
targetTemplate = "object/tangible/furniture/cheap/love_seat_s01.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_furniture_furniture_chair_loveseat_cheap, "object/draft_schematic/furniture/furniture_chair_loveseat_cheap.iff")
| agpl-3.0 |
Zefiros-Software/premake-core | binmodules/luasocket/test/testmesg.lua | 45 | 2957 | -- load the smtp support and its friends
local smtp = require("socket.smtp")
local mime = require("mime")
local ltn12 = require("ltn12")
function filter(s)
if s then io.write(s) end
return s
end
source = smtp.message {
headers = { ['content-type'] = 'multipart/alternative' },
body = {
[1] = {
headers = { ['Content-type'] = 'text/html' },
body = "<html> <body> Hi, <b>there</b>...</body> </html>"
},
[2] = {
headers = { ['content-type'] = 'text/plain' },
body = "Hi, there..."
}
}
}
r, e = smtp.send{
rcpt = {"<diego@tecgraf.puc-rio.br>",
"<diego@princeton.edu>" },
from = "<diego@princeton.edu>",
source = ltn12.source.chain(source, filter),
--server = "mail.cs.princeton.edu"
server = "localhost",
port = 2525
}
print(r, e)
-- creates a source to send a message with two parts. The first part is
-- plain text, the second part is a PNG image, encoded as base64.
source = smtp.message{
headers = {
-- Remember that headers are *ignored* by smtp.send.
from = "Sicrano <sicrano@tecgraf.puc-rio.br>",
to = "Fulano <fulano@tecgraf.puc-rio.br>",
subject = "Here is a message with attachments"
},
body = {
preamble = "If your client doesn't understand attachments, \r\n" ..
"it will still display the preamble and the epilogue.\r\n" ..
"Preamble might show up even in a MIME enabled client.",
-- first part: No headers means plain text, us-ascii.
-- The mime.eol low-level filter normalizes end-of-line markers.
[1] = {
body = mime.eol(0, [[
Lines in a message body should always end with CRLF.
The smtp module will *NOT* perform translation. It will
perform necessary stuffing, though.
]])
},
-- second part: Headers describe content the to be an image,
-- sent under the base64 transfer content encoding.
-- Notice that nothing happens until the message is sent. Small
-- chunks are loaded into memory and translation happens on the fly.
[2] = {
headers = {
["ConTenT-tYpE"] = 'image/png; name="luasocket.png"',
["content-disposition"] = 'attachment; filename="luasocket.png"',
["content-description"] = 'our logo',
["content-transfer-encoding"] = "BASE64"
},
body = ltn12.source.chain(
ltn12.source.file(io.open("luasocket.png", "rb")),
ltn12.filter.chain(
mime.encode("base64"),
mime.wrap()
)
)
},
epilogue = "This might also show up, but after the attachments"
}
}
r, e = smtp.send{
rcpt = {"<diego@tecgraf.puc-rio.br>",
"<diego@princeton.edu>" },
from = "<diego@princeton.edu>",
source = ltn12.source.chain(source, filter),
--server = "mail.cs.princeton.edu",
--port = 25
server = "localhost",
port = 2525
}
print(r, e)
| bsd-3-clause |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/gcw/flip_banner_onpole_imperial.lua | 3 | 2248 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_gcw_flip_banner_onpole_imperial = object_tangible_gcw_shared_flip_banner_onpole_imperial:new {
}
ObjectTemplates:addTemplate(object_tangible_gcw_flip_banner_onpole_imperial, "object/tangible/gcw/flip_banner_onpole_imperial.iff")
| agpl-3.0 |
njligames/NJLIGameEngine | projects/ELIA/_archive/_OLD/scripts/nodes/BirdBeak/States/Yap.lua | 4 | 2317 |
local getNodeState = function(self)
return self.nodeState
end
local getNodeObject = function(self)
return self.nodeObject
end
local push = function(self)
assert(self:getNodeObject(), "self:getNodeObject() must not be nil in " .. self:getNodeState():getName())
self:getNodeObject():getNode():getStateMachine():pushState(self:getNodeState())
end
local isIn = function(self)
assert(self:getNodeObject(), "self:getNodeObject() must not be nil in " .. self:getNodeState():getName())
return self:getNodeState():getName() == self:getNodeObject():getNode():getStateMachine():getState():getName()
end
local actionUpdate = function(self, action, timeStep)
end
local actionComplete = function(self, action)
end
local enter = function(self)
if self:getNodeObject():getBirdNodeObject():playTauntSound() then
self:getNodeObject():setFrameActionName("idle")
self:getNodeObject():setFrameNumber(0)
self:getNodeObject():setFrameIncrement(1)
else
end
end
local update = function(self, timeStep)
if not self:getNodeObject():getBirdNodeObject():isPlayingSound() then
self:getNodeObject():getStateObject("Idle"):push()
end
end
local exit = function(self)
end
local onMessage = function(self, message)
end
local render = function(self)
end
local collide = function(self, otherNode, collisionPoint)
end
local near = function(self, otherNode)
end
local touchDown = function(self, rayContact)
end
local touchUp = function(self, rayContact)
end
local touchMove = function(self, rayContact)
end
local touchCancelled = function(self, rayContact)
end
local delete = function(self)
end
local methods =
{
getNodeState = getNodeState,
getNodeObject = getNodeObject,
push = push,
isIn = isIn,
actionUpdate = actionUpdate,
actionComplete = actionComplete,
enter = enter,
update = update,
exit = exit,
onMessage = onMessage,
render = render,
collide = collide,
near = near,
touchDown = touchDown,
touchUp = touchUp,
touchMove = touchMove,
touchCancelled = touchCancelled,
__gc = delete
}
local new = function(name, nodeObject)
local nodeState = njli.NodeState.create()
nodeState:setName(name)
local properties =
{
nodeState = nodeState,
nodeObject = nodeObject,
}
return setmetatable(properties, {__index = methods})
end
return {
new = new,
}
| mit |
njligames/NJLIGameEngine | projects/YappyBirds/_archive/_OLD/scripts/nodes/BirdBeak/States/Yap.lua | 4 | 2317 |
local getNodeState = function(self)
return self.nodeState
end
local getNodeObject = function(self)
return self.nodeObject
end
local push = function(self)
assert(self:getNodeObject(), "self:getNodeObject() must not be nil in " .. self:getNodeState():getName())
self:getNodeObject():getNode():getStateMachine():pushState(self:getNodeState())
end
local isIn = function(self)
assert(self:getNodeObject(), "self:getNodeObject() must not be nil in " .. self:getNodeState():getName())
return self:getNodeState():getName() == self:getNodeObject():getNode():getStateMachine():getState():getName()
end
local actionUpdate = function(self, action, timeStep)
end
local actionComplete = function(self, action)
end
local enter = function(self)
if self:getNodeObject():getBirdNodeObject():playTauntSound() then
self:getNodeObject():setFrameActionName("idle")
self:getNodeObject():setFrameNumber(0)
self:getNodeObject():setFrameIncrement(1)
else
end
end
local update = function(self, timeStep)
if not self:getNodeObject():getBirdNodeObject():isPlayingSound() then
self:getNodeObject():getStateObject("Idle"):push()
end
end
local exit = function(self)
end
local onMessage = function(self, message)
end
local render = function(self)
end
local collide = function(self, otherNode, collisionPoint)
end
local near = function(self, otherNode)
end
local touchDown = function(self, rayContact)
end
local touchUp = function(self, rayContact)
end
local touchMove = function(self, rayContact)
end
local touchCancelled = function(self, rayContact)
end
local delete = function(self)
end
local methods =
{
getNodeState = getNodeState,
getNodeObject = getNodeObject,
push = push,
isIn = isIn,
actionUpdate = actionUpdate,
actionComplete = actionComplete,
enter = enter,
update = update,
exit = exit,
onMessage = onMessage,
render = render,
collide = collide,
near = near,
touchDown = touchDown,
touchUp = touchUp,
touchMove = touchMove,
touchCancelled = touchCancelled,
__gc = delete
}
local new = function(name, nodeObject)
local nodeState = njli.NodeState.create()
nodeState:setName(name)
local properties =
{
nodeState = nodeState,
nodeObject = nodeObject,
}
return setmetatable(properties, {__index = methods})
end
return {
new = new,
}
| mit |
KingRaptor/Zero-K | scripts/spideranarchid.lua | 16 | 4496 | include "constants.lua"
include "spider_walking.lua"
--------------------------------------------------------------------------------
-- pieces
--------------------------------------------------------------------------------
local body = piece 'body'
local turret = piece 'turret'
local gun = piece 'gun'
local flare = piece 'flare'
local aim = piece 'aim'
local br = piece 'leg1' -- back right
local mr = piece 'leg2' -- middle right
local fr = piece 'leg3' -- front right
local bl = piece 'leg4' -- back left
local ml = piece 'leg5' -- middle left
local fl = piece 'leg6' -- front left
local smokePiece = {body, turret}
--------------------------------------------------------------------------------
-- constants
--------------------------------------------------------------------------------
-- Signal definitions
local SIG_WALK = 1
local SIG_AIM = 2
local PERIOD = 0.1
local sleepTime = PERIOD*1000
local legRaiseAngle = math.rad(30)
local legRaiseSpeed = legRaiseAngle/PERIOD
local legLowerSpeed = legRaiseAngle/PERIOD
local legForwardAngle = math.rad(20)
local legForwardTheta = math.rad(25)
local legForwardOffset = -math.rad(20)
local legForwardSpeed = legForwardAngle/PERIOD
local legMiddleAngle = math.rad(20)
local legMiddleTheta = 0
local legMiddleOffset = 0
local legMiddleSpeed = legMiddleAngle/PERIOD
local legBackwardAngle = math.rad(20)
local legBackwardTheta = -math.rad(25)
local legBackwardOffset = math.rad(20)
local legBackwardSpeed = legBackwardAngle/PERIOD
local restore_delay = 3000
-- four-stroke hexapedal walkscript
local function Walk()
Signal(SIG_WALK)
SetSignalMask(SIG_WALK)
while true do
walk(br, mr, fr, bl, ml, fl,
legRaiseAngle, legRaiseSpeed, legLowerSpeed,
legForwardAngle, legForwardOffset, legForwardSpeed, legForwardTheta,
legMiddleAngle, legMiddleOffset, legMiddleSpeed, legMiddleTheta,
legBackwardAngle, legBackwardOffset, legBackwardSpeed, legBackwardTheta,
sleepTime)
end
end
local function RestoreLegs()
Signal(SIG_WALK)
SetSignalMask(SIG_WALK)
restoreLegs(br, mr, fr, bl, ml, fl,
legRaiseSpeed, legForwardSpeed, legMiddleSpeed,legBackwardSpeed)
end
function script.Create()
StartThread(SmokeUnit, smokePiece)
end
function script.StartMoving()
StartThread(Walk)
end
function script.StopMoving()
StartThread(RestoreLegs)
end
local function RestoreAfterDelay()
Sleep(restore_delay)
Turn(turret, y_axis, 0, math.rad(90))
Turn(gun, x_axis, 0, math.rad(90))
Move(gun, y_axis, 0, 10)
end
function script.AimWeapon(num, heading, pitch)
Signal(SIG_AIM)
SetSignalMask(SIG_AIM)
Turn(turret, y_axis, heading, math.rad(450))
Turn(gun, x_axis, -pitch, math.rad(180))
Move(gun, y_axis, 130, 40)
WaitForTurn(turret, y_axis)
WaitForTurn(gun, x_axis)
StartThread(RestoreAfterDelay)
return true
end
function script.AimFromWeapon(num)
return aim
end
function script.QueryWeapon(num)
return flare
end
function script.Killed(recentDamage, maxHealth)
local severity = recentDamage/maxHealth
if severity <= .25 then
Explode(gun, sfxNone)
Explode(body, sfxNone)
Explode(br, sfxNone)
Explode(mr, sfxNone)
Explode(fr, sfxNone)
Explode(bl, sfxNone)
Explode(ml, sfxNone)
Explode(fl, sfxNone)
Explode(turret, sfxNone)
return 1
elseif severity <= .50 then
Explode(gun, sfxFall)
Explode(body, sfxNone)
Explode(br, sfxFall)
Explode(mr, sfxFall)
Explode(fr, sfxFall)
Explode(bl, sfxFall)
Explode(ml, sfxFall)
Explode(fl, sfxFall)
Explode(turret, sfxShatter)
return 1
elseif severity <= .99 then
Explode(gun, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(body, sfxNone)
Explode(br, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(mr, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(fr, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(bl, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(ml, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(fl, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(turret, sfxShatter)
return 2
else
Explode(gun, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(body, sfxNone)
Explode(br, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(mr, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(fr, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(bl, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(ml, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(fl, sfxFall + sfxSmoke + sfxFire + sfxExplode)
Explode(turret, sfxShatter + sfxExplode)
return 2
end
end
| gpl-2.0 |
DailyShana/ygopro-scripts | c69279219.lua | 3 | 1407 | --我が身を盾に
function c69279219.initial_effect(c)
--Negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c69279219.condition)
e1:SetCost(c69279219.cost)
e1:SetTarget(c69279219.target)
e1:SetOperation(c69279219.operation)
c:RegisterEffect(e1)
end
function c69279219.cfilter(c)
return c:IsOnField() and c:IsType(TYPE_MONSTER)
end
function c69279219.condition(e,tp,eg,ep,ev,re,r,rp)
if tp==ep or not Duel.IsChainNegatable(ev) then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(c69279219.cfilter,nil)-tg:GetCount()>0
end
function c69279219.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500) end
Duel.PayLPCost(tp,1500)
end
function c69279219.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c69279219.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/lair/base/antpile_light.lua | 2 | 2268 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_lair_base_antpile_light = object_tangible_lair_base_shared_antpile_light:new {
objectMenuComponent = {"cpp", "LairMenuComponent"},
}
ObjectTemplates:addTemplate(object_tangible_lair_base_antpile_light, "object/tangible/lair/base/antpile_light.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/draft_schematic/item/component/item_electronic_energy_distributor.lua | 2 | 3575 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_draft_schematic_item_component_item_electronic_energy_distributor = object_draft_schematic_item_component_shared_item_electronic_energy_distributor:new {
templateType = DRAFTSCHEMATIC,
customObjectName = "Energy Distributor",
craftingToolTab = 524288, -- (See DraftSchemticImplementation.h)
complexity = 19,
size = 3,
xpType = "crafting_general",
xp = 55,
assemblySkill = "general_assembly",
experimentingSkill = "general_experimentation",
customizationSkill = "clothing_customization",
customizationOptions = {},
customizationStringNames = {},
customizationDefaults = {},
ingredientTemplateNames = {"craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n", "craft_item_ingredients_n"},
ingredientTitleNames = {"assembly_frame", "charge_neutralization_barrier", "module_brackets", "micro_switching_mechanism_contacts", "switching_and_routing_mechanism", "thermal_barrier"},
ingredientSlotType = {0, 0, 0, 0, 0, 0},
resourceTypes = {"metal", "gas_inert", "steel", "metal", "petrochem_inert_polymer", "ore"},
resourceQuantities = {12, 4, 4, 2, 2, 3},
contribution = {100, 100, 100, 100, 100, 100},
targetTemplate = "object/tangible/component/item/electronic_energy_distributor.iff",
additionalTemplates = {
}
}
ObjectTemplates:addTemplate(object_draft_schematic_item_component_item_electronic_energy_distributor, "object/draft_schematic/item/component/item_electronic_energy_distributor.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/mobile/dressed_cobral_thief_human_female_01.lua | 3 | 2260 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_mobile_dressed_cobral_thief_human_female_01 = object_mobile_shared_dressed_cobral_thief_human_female_01:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_cobral_thief_human_female_01, "object/mobile/dressed_cobral_thief_human_female_01.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/deed/city_deed/garden_tatooine_med_04_deed.lua | 3 | 2488 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_deed_city_deed_garden_tatooine_med_04_deed = object_tangible_deed_city_deed_shared_garden_tatooine_med_04_deed:new {
templateType = STRUCTUREDEED,
placeStructureComponent = "PlaceDecorationComponent",
gameObjectType = 8388609,
generatedObjectTemplate = "object/building/player/city/garden_tatooine_med_04.iff"
}
ObjectTemplates:addTemplate(object_tangible_deed_city_deed_garden_tatooine_med_04_deed, "object/tangible/deed/city_deed/garden_tatooine_med_04_deed.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c82052602.lua | 3 | 2398 | --ガガガバック
function c82052602.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c82052602.condition)
e1:SetTarget(c82052602.target)
e1:SetOperation(c82052602.activate)
c:RegisterEffect(e1)
if not c82052602.global_check then
c82052602.global_check=true
c82052602[0]=false
c82052602[1]=false
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BATTLE_DESTROYED)
ge1:SetOperation(c82052602.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c82052602.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c82052602.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
local pos=tc:GetPosition()
if tc:IsSetCard(0x54) and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE)
and tc:GetControler()==tc:GetPreviousControler() then
c82052602[tc:GetControler()]=true
end
tc=eg:GetNext()
end
end
function c82052602.clear(e,tp,eg,ep,ev,re,r,rp)
c82052602[0]=false
c82052602[1]=false
end
function c82052602.filter(c,id,e,tp)
return c:IsReason(REASON_BATTLE) and c:GetTurnID()==id and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c82052602.condition(e,tp,eg,ep,ev,re,r,rp)
return c82052602[tp] and Duel.GetFlagEffect(tp,82052602)==0
end
function c82052602.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c82052602.filter,tp,LOCATION_GRAVE,0,1,nil,Duel.GetTurnCount(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
Duel.RegisterFlagEffect(tp,82052602,RESET_PHASE+PHASE_END,0,1)
end
function c82052602.activate(e,tp,eg,ep,ev,re,r,rp)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c82052602.filter,tp,LOCATION_GRAVE,0,ft1,ft1,nil,Duel.GetTurnCount(),e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
Duel.BreakEffect()
Duel.Damage(tp,g:GetCount()*600,REASON_EFFECT)
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/mission/quest_item/lian_byrne_q1_needed.lua | 3 | 2280 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_mission_quest_item_lian_byrne_q1_needed = object_tangible_mission_quest_item_shared_lian_byrne_q1_needed:new {
}
ObjectTemplates:addTemplate(object_tangible_mission_quest_item_lian_byrne_q1_needed, "object/tangible/mission/quest_item/lian_byrne_q1_needed.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c28357177.lua | 9 | 1091 | --派手ハネ
function c28357177.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(28357177,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetTarget(c28357177.target)
e1:SetOperation(c28357177.operation)
c:RegisterEffect(e1)
end
function c28357177.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_MZONE,LOCATION_MZONE,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c28357177.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg then
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/loot/groups/weapon/melee_weapons.lua | 4 | 1493 | --Automatically generated by SWGEmu Spawn Tool v0.12 loot editor.
melee_weapons = {
description = "",
minimumLevel = 0,
maximumLevel = 0,
lootItems = {
{itemTemplate = "axe_heavy_duty", weight = 500000},
{itemTemplate = "axe_vibroaxe", weight = 400000},
{itemTemplate = "baton_stun", weight = 400000},
{itemTemplate = "baton_gaderiffi", weight = 400000},
{itemTemplate = "knife_dagger", weight = 500000},
{itemTemplate = "knife_survival", weight = 500000},
{itemTemplate = "knife_stone", weight = 500000},
{itemTemplate = "knife_vibroblade", weight = 500000},
{itemTemplate = "melee_vibroknuckler", weight = 400000},
{itemTemplate = "polearm_staff_metal", weight = 500000},
{itemTemplate = "polearm_staff_wood", weight = 500000},
{itemTemplate = "polearm_staff_wood_reinforced", weight = 500000},
{itemTemplate = "polearm_vibro_axe", weight = 400000},
{itemTemplate = "polearm_lance", weight = 500000},
{itemTemplate = "polearm_lance_vibrolance", weight = 400000},
{itemTemplate = "one_handed_sword", weight = 500000},
{itemTemplate = "one_handed_curved_sword", weight = 400000},
{itemTemplate = "one_handed_ryyk_blade", weight = 400000},
{itemTemplate = "two_handed_sword_battleaxe", weight = 500000},
{itemTemplate = "two_handed_sword_cleaver", weight = 500000},
{itemTemplate = "two_handed_sword_maul", weight = 400000},
{itemTemplate = "two_handed_sword_katana", weight = 400000},
}
}
addLootGroupTemplate("melee_weapons", melee_weapons)
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/mobile/dressed_noble_naboo_twilek_female_01.lua | 3 | 2260 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_mobile_dressed_noble_naboo_twilek_female_01 = object_mobile_shared_dressed_noble_naboo_twilek_female_01:new {
}
ObjectTemplates:addTemplate(object_mobile_dressed_noble_naboo_twilek_female_01, "object/mobile/dressed_noble_naboo_twilek_female_01.iff")
| agpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/tangible/medicine/crafted/medpack_disease_area_quickness_c.lua | 2 | 3393 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_tangible_medicine_crafted_medpack_disease_area_quickness_c = object_tangible_medicine_crafted_shared_medpack_disease_area_quickness_c:new {
gameObjectType = 8240,
templateType = DOTPACK,
useCount = 10,
medicineUse = 5,
effectiveness = 100,
duration = 300,
range = 15,
rangeMod = 0.3,
pool = 4,
dotType = DISEASED,
potency = 350,
commandToExecute = "applydisease",
area = 10,
numberExperimentalProperties = {1, 1, 2, 2, 2, 2, 2, 2, 2, 1},
experimentalProperties = {"XX", "XX", "OQ", "PE", "OQ", "UT", "CD", "OQ", "CD", "OQ", "OQ", "PE", "OQ", "PE", "DR", "OQ", "XX"},
experimentalWeights = {1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "exp_effectiveness", "exp_charges", "exp_charges", "exp_effectiveness", "expEaseOfUse", "expEaseOfUse", "exp_effectiveness", "null"},
experimentalSubGroupTitles = {"null", "null", "power", "charges", "range", "area", "skillmodmin", "potency", "duration", "hitpoints"},
experimentalMin = {0, 0, 5, 15, 15, 5, 100, 25, 120, 1000},
experimentalMax = {0, 0, 50, 35, 30, 20, 70, 150, 1000, 1000},
experimentalPrecision = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 4},
}
ObjectTemplates:addTemplate(object_tangible_medicine_crafted_medpack_disease_area_quickness_c, "object/tangible/medicine/crafted/medpack_disease_area_quickness_c.iff")
| agpl-3.0 |
DailyShana/ygopro-scripts | c47198668.lua | 3 | 3758 | --DDD死偉王ヘル・アーマゲドン
function c47198668.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(c47198668.atktg1)
e2:SetOperation(c47198668.atkop1)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCountLimit(1)
e3:SetCost(c47198668.atkcost)
e3:SetTarget(c47198668.atktg2)
e3:SetOperation(c47198668.atkop2)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c47198668.efilter)
c:RegisterEffect(e4)
end
function c47198668.filter1(c)
return c:IsFaceup() and c:IsSetCard(0xaf)
end
function c47198668.atktg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c47198668.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c47198668.filter1,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c47198668.filter1,tp,LOCATION_MZONE,0,1,1,nil)
end
function c47198668.atkop1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c47198668.filter2(c,e,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsType(TYPE_MONSTER)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsCanBeEffectTarget(e)
end
function c47198668.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsDirectAttacked() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e:GetHandler():RegisterEffect(e1)
end
function c47198668.atktg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c47198668.filter2(chkc,e,tp) end
if chk==0 then return eg:IsExists(c47198668.filter2,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=eg:FilterSelect(tp,c47198668.filter2,1,1,nil,e,tp)
Duel.SetTargetCard(g)
end
function c47198668.atkop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c47198668.efilter(e,re,rp)
if not re:IsActiveType(TYPE_SPELL+TYPE_TRAP) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g:IsContains(e:GetHandler())
end
| gpl-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/weapon/melee/2h_sword/2h_sword_scythe.lua | 2 | 6163 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_weapon_melee_2h_sword_2h_sword_scythe = object_weapon_melee_2h_sword_shared_2h_sword_scythe:new {
playerRaces = { "object/creature/player/bothan_male.iff",
"object/creature/player/bothan_female.iff",
"object/creature/player/human_male.iff",
"object/creature/player/human_female.iff",
"object/creature/player/ithorian_male.iff",
"object/creature/player/ithorian_female.iff",
"object/creature/player/moncal_male.iff",
"object/creature/player/moncal_female.iff",
"object/creature/player/rodian_male.iff",
"object/creature/player/rodian_female.iff",
"object/creature/player/sullustan_male.iff",
"object/creature/player/sullustan_female.iff",
"object/creature/player/trandoshan_male.iff",
"object/creature/player/trandoshan_female.iff",
"object/creature/player/twilek_male.iff",
"object/creature/player/twilek_female.iff",
"object/creature/player/wookiee_male.iff",
"object/creature/player/wookiee_female.iff",
"object/creature/player/zabrak_male.iff",
"object/creature/player/zabrak_female.iff" },
-- RANGEDATTACK, MELEEATTACK, FORCEATTACK, TRAPATTACK, GRENADEATTACK, HEAVYACIDBEAMATTACK,
-- HEAVYLIGHTNINGBEAMATTACK, HEAVYPARTICLEBEAMATTACK, HEAVYROCKETLAUNCHERATTACK, HEAVYLAUNCHERATTACK
attackType = MELEEATTACK,
-- ENERGY, KINETIC, ELECTRICITY, STUN, BLAST, HEAT, COLD, ACID, FORCE, LIGHTSABER
damageType = KINETIC,
-- NONE, LIGHT, MEDIUM, HEAVY
armorPiercing = MEDIUM,
-- combat_rangedspecialize_bactarifle, combat_rangedspecialize_rifle, combat_rangedspecialize_pistol, combat_rangedspecialize_heavy, combat_rangedspecialize_carbine
-- combat_meleespecialize_unarmed, combat_meleespecialize_twohand, combat_meleespecialize_polearm, combat_meleespecialize_onehand, combat_general,
-- combat_meleespecialize_twohandlightsaber, combat_meleespecialize_polearmlightsaber, combat_meleespecialize_onehandlightsaber
xpType = "combat_meleespecialize_twohand",
-- See http://www.ocdsoft.com/files/certifications.xls
certificationsRequired = { "cert_sword_2h_scythe" },
-- See http://www.ocdsoft.com/files/accuracy.xls
creatureAccuracyModifiers = { "twohandmelee_accuracy" },
-- See http://www.ocdsoft.com/files/defense.xls
defenderDefenseModifiers = { "melee_defense" },
-- Leave as "dodge" for now, may have additions later
defenderSecondaryDefenseModifiers = { "counterattack" },
defenderToughnessModifiers = { "twohandmelee_toughness" },
-- See http://www.ocdsoft.com/files/speed.xls
speedModifiers = { "twohandmelee_speed" },
-- Leave blank for now
damageModifiers = { },
-- The values below are the default values. To be used for blue frog objects primarily
healthAttackCost = 31,
actionAttackCost = 76,
mindAttackCost = 31,
forceCost = 0,
pointBlankRange = 0,
pointBlankAccuracy = 10,
idealRange = 5,
idealAccuracy = 10,
maxRange = 6,
maxRangeAccuracy = 10,
minDamage = 40,
maxDamage = 210,
attackSpeed = 4.7,
woundsRatio = 30,
numberExperimentalProperties = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalProperties = {"XX", "XX", "SR", "SR", "SR", "SR", "SR", "SR", "SR", "XX", "SR", "XX", "SR", "SR", "SR"},
experimentalWeights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
experimentalGroupTitles = {"null", "null", "expDamage", "expDamage", "expDamage", "expDamage", "exp_durability", "expRange", "expRange", "null", "expRange", "null", "expEffeciency", "expEffeciency", "expEffeciency"},
experimentalSubGroupTitles = {"null", "null", "mindamage", "maxdamage", "attackspeed", "woundchance", "hitpoints", "zerorangemod", "maxrangemod", "midrange", "midrangemod", "maxrange", "attackhealthcost", "attackactioncost", "attackmindcost"},
experimentalMin = {0, 0, 65, 165, 4.2, 5, 750, -15, -15, 6, -15, 6, 48, 76, 40},
experimentalMax = {0, 0, 155, 287, 3, 15, 1500, 10, 10, 6, 10, 6, 22, 40, 18},
experimentalPrecision = {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
experimentalCombineType = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
}
ObjectTemplates:addTemplate(object_weapon_melee_2h_sword_2h_sword_scythe, "object/weapon/melee/2h_sword/2h_sword_scythe.iff")
| agpl-3.0 |
Whitechaser/darkstar | scripts/zones/Northern_San_dOria/npcs/Alphollon_C_Meriard.lua | 5 | 3432 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Alphollon C Meriard
-- Type: Purifies cursed items with their corresponding abjurations.
-- @zone 231
-- !pos 98.108 -1 137.999
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Northern_San_dOria/TextIDs");
-----------------------------------
function onTrade(player,npc,trade)
if (trade:getItemCount() == 2) then
local item = 0;
local reward = 0;
local abjurList =
{
-- Abjuration, item, item -1, reward, reward +1 (5 ID's per transaction)
1314,1344,1345,13934,13935, 1315,1346,1347,14387,14388,
1316,1348,1349,14821,14822, 1317,1350,1351,14303,14304,
1318,1352,1353,14184,14185, 1319,1354,1355,12429,13924,
1320,1356,1357,12557,14371, 1321,1358,1359,12685,14816,
1322,1360,1361,12813,14296, 1323,1362,1363,12941,14175,
1324,1364,1365,13876,13877, 1325,1366,1367,13787,13788,
1326,1368,1369,14006,14007, 1327,1370,1371,14247,14248,
1328,1372,1373,14123,14124, 1329,1374,1375,12421,13911,
1330,1376,1377,12549,14370, 1331,1378,1379,12677,14061,
1332,1380,1381,12805,14283, 1333,1382,1383,12933,14163,
1334,1384,1385,13908,13909, 1335,1386,1387,14367,14368,
1336,1388,1389,14058,14059, 1337,1390,1391,14280,14281,
1338,1392,1393,14160,14161, 1339,1394,1395,13927,13928,
1340,1396,1397,14378,14379, 1341,1398,1399,14076,14077,
1342,1400,1401,14308,14309, 1343,1402,1403,14180,14181,
2429,2439,2440,16113,16114, 2430,2441,2442,14573,14574,
2431,2443,2444,14995,14996, 2432,2445,2446,15655,15656,
2433,2447,2448,15740,15741, 2434,2449,2450,16115,16116,
2435,2451,2452,14575,14576, 2436,2453,2454,14997,14998,
2437,2455,2456,15657,15658, 2438,2457,2458,15742,15743,
1441,4234,4234,4513,4513, 1442,4235,4235,4511,4511
};
for i = 1,#abjurList,5 do
if (trade:hasItemQty(abjurList[i],1)) then
if (trade:hasItemQty(abjurList[i + 1],1)) then
item = abjurList[i + 1];
reward = abjurList[i + 3];
elseif (trade:hasItemQty(abjurList[i + 2],1)) then
item = abjurList[i + 2];
reward = abjurList[i + 4];
end
break;
end
end
if (reward ~= 0) then
--Trade pair for a nice reward.
player:startEvent(720,item,reward);
player:setVar("reward",reward);
end
end
end;
function onTrigger(player,npc)
player:startEvent(719);
end;
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
if (csid == 720) then
local reward = player:getVar("reward");
if (reward ~= 0) then
player:tradeComplete();
player:addItem(reward);
player:setVar("reward",0);
player:messageSpecial(ITEM_OBTAINED,reward);
end
end
end;
| gpl-3.0 |
lasko2112/legend-of-hondo | MMOCoreORB/bin/scripts/object/static/space/spacestation/rsf_spacestation.lua | 3 | 2256 | --Copyright (C) 2010 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
object_static_space_spacestation_rsf_spacestation = object_static_space_spacestation_shared_rsf_spacestation:new {
}
ObjectTemplates:addTemplate(object_static_space_spacestation_rsf_spacestation, "object/static/space/spacestation/rsf_spacestation.iff")
| agpl-3.0 |
xiewen/DBProxy | tests/suite/base/t/select_affected_rows.lua | 4 | 1321 | --[[ $%BEGINLICENSE%$
Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 of the
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
$%ENDLICENSE%$ --]]
local affected_rows
function read_query(packet)
if packet:byte() == proxy.COM_QUERY then
if packet:sub(2) == "SELECT affected_rows" then
proxy.response.type = proxy.MYSQLD_PACKET_OK
proxy.response.resultset = {
fields = {
{ name = "rows", type = proxy.MYSQL_TYPE_LONG }
},
rows = {
{ affected_rows }
}
}
return proxy.PROXY_SEND_RESULT
else
proxy.queries:append(1, packet)
return proxy.PROXY_SEND_QUERY
end
end
end
function read_query_result(inj)
affected_rows = inj.resultset.affected_rows
end
| gpl-2.0 |
DailyShana/ygopro-scripts | c61650133.lua | 3 | 1960 | --召喚の呪詛
function c61650133.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--maintain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c61650133.mtcon)
e2:SetOperation(c61650133.mtop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(61650133,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c61650133.rmtg)
e3:SetOperation(c61650133.rmop)
c:RegisterEffect(e3)
end
function c61650133.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c61650133.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)>500 and Duel.SelectYesNo(tp,aux.Stringid(61650133,0)) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
function c61650133.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
end
function c61650133.rmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local rm1=false
local rm2=false
local tc=eg:GetFirst()
while tc do
if tc:IsOnField() then
if tc:IsControler(tp) then rm1=true else rm2=true end
end
tc=eg:GetNext()
end
local g=Group.CreateGroup()
if rm1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
g:Merge(g1)
end
if rm2 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,LOCATION_HAND,0,1,1,nil)
g:Merge(g2)
end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
| gpl-2.0 |
KingRaptor/Zero-K | LuaUI/Widgets/cmd_state_reverse_toggle.lua | 12 | 1055 | function widget:GetInfo()
return {
name = "State Reverse Toggle",
desc = "Makes multinary states reverse toggleable",
author = "Google Frog",
date = "Oct 2, 2009",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true -- loaded by default?
}
end
local spGetSelectedUnits = Spring.GetSelectedUnits
local spGiveOrderToUnit = Spring.GiveOrderToUnit
local CMD_FIRE_STATE = CMD.FIRE_STATE
local CMD_MOVE_STATE = CMD.MOVE_STATE
local multiStates = {
[CMD_FIRE_STATE] = 3,
[CMD_MOVE_STATE] = 3,
[CMD.AUTOREPAIRLEVEL] = 4,
}
function widget:CommandNotify(id, params, options)
if multiStates[id] then
if options.right then
local units = spGetSelectedUnits()
local state = params[1]
state = state - 2 -- engine sent us one step forward instead of one step back, so we go two steps back
if state < 0 then
state = multiStates[id] + state -- wrap
end
for i=1, #units do
spGiveOrderToUnit(units[i], id, { state }, {})
end
return true
end
end
end | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.