Commit ac7f26b1 authored by Nemo Ma's avatar Nemo Ma

upd

parent 938b42a9
......@@ -70,57 +70,6 @@
9990228 0
9990233 0
10080420 0
10100000 0
10106001 0
10106002 0
10106003 0
10106004 0
10106005 0
10106006 0
10106007 0
10106008 0
10106009 0
10106010 0
10106011 0
10106012 0
10106013 0
10106014 0
10122001 0
10122002 0
10122003 0
10122004 0
10122005 0
10122006 0
10122007 0
10122008 0
10122009 0
10122010 0
10122011 0
10122012 0
10122013 0
10122014 0
10122015 0
10122016 0
10122017 0
10122018 0
10122019 0
10122020 0
10130001 0
10130002 0
10130003 0
10130004 0
10130005 0
10130006 0
10130007 0
10130008 0
10130009 0
10130010 0
10130011 0
10130012 0
10130013 0
10130014 0
10171001 0
10199990 0
10736541 0
11163044 0
11450000 0
......@@ -1585,6 +1534,9 @@
31403102 0
31403103 0
31403104 0
#230611
30005508 0
11451703 1
#230528
1003003 0
10150039 0
......
No preview for this file type
No preview for this file type
--恶念体制造兵器
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormalSummoned",
"Search", nil, "Search,Add2Hand", "Delay", nil, nil,
{ "~Target", "Add2Hand", s.thfilter, "Deck" }, s.thop)
local e2 = Scl.CreateQuickOptionalEffect(c, nil, "ChangeControl", 1,
"ChangeControl", "Target", "MonsterZone", nil, nil, {
{ "Target", "ChangeControl", s.ctfilter, 0, "MonsterZone"}, { "~Target", "Return2Hand", s.rtfilter, "OnField", 0, 1, 1, c }} , s.ctop)
end
function s.thfilter(c)
return c:IsSetCard(0x3338) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(id)
end
function s.thop(e,tp)
Scl.SelectAndOperateCards("Add2Hand",tp,s.thfilter,tp,"Deck",0,1,1,nil)()
end
function s.ctfilter(c)
return c:IsControlerCanBeChanged() and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function s.rtfilter(c)
return c:IsAbleToHand() and c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.ctop(e,tp)
if Scl.SelectAndOperateCards("Return2Hand",tp,s.rtfilter,tp,"OnField",0,1,1,aux.ExceptThisCard(e))() > 0 and Scl.IsCorrectlyOperated("Hand") then
local _, tc = Scl.GetTargetsReleate2Chain()
if not tc then return end
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
\ No newline at end of file
--恶念体复制兵器
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormalSummoned",
"AddFromDeck/GY2Hand", nil, "AddFromDeck/GY2Hand", "Delay",
nil, nil, {
{ "~Target", "Look", s.codefilter, "Hand,OnField" },
{ "~Target", "Add2Hand", aux.TRUE, "Deck,GY"} }, s.thop)
local e2 = Scl.CreateQuickOptionalEffect(c, nil, "Destroy", 1,
"Destroy", "Target", "MonsterZone", nil, nil, {
{ "Target", "Destroy", aux.TRUE, 0, "OnField"}, { "~Target", "Return2Hand", s.rtfilter, "OnField", 0, 1, 1, c }} , s.desop)
end
function s.thfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function s.codefilter(c,e,tp)
return c:IsSetCard(0x3338) and Scl.IsOriginalType(c, 0, TYPE_MONSTER) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c:GetCode()) and not c:IsCode(id)
end
function s.thop(e,tp)
local _,_,tc = Scl.SelectAndOperateCards("Look",tp,s.codefilter,tp,"Hand,OnField",0,1,1,nil,e,tp)()
if not tc then return end
Scl.SelectAndOperateCards("Add2Hand",tp,aux.NecroValleyFilter(s.thfilter),tp,"Deck,GY",0,1,2,nil,tc:GetCode())()
end
function s.rtfilter(c)
return c:IsAbleToHand() and c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.desop(e,tp)
if Scl.SelectAndOperateCards("Return2Hand",tp,s.rtfilter,tp,"OnField",0,1,1,aux.ExceptThisCard(e))() > 0 and Scl.IsCorrectlyOperated("Hand") then
local _, tc = Scl.GetTargetsReleate2Chain()
if not tc then return end
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--恶念体增幅兵器
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormalSummoned",
"PlaceInSpell&TrapZone", nil, nil, "Delay", nil, nil,
{ "~Target", "PlaceInSpell&TrapZone", s.pfilter, "Deck,GY" }, s.tfop)
local e2 = Scl.CreateQuickOptionalEffect(c, nil, "BanishFacedown", 1,
"BanishFacedown", "Target", "MonsterZone", nil, nil, {
{ "Target", "BanishFacedown", s.bfilter, 0, "GY"}, { "~Target", "Return2Hand", s.rtfilter, "OnField", 0, 1, 1, c }} , s.bop)
end
function s.pfilter(c,e,tp)
return aux.IsCodeListed(c, 10106003) and Scl.IsType(c,TYPE_CONTINUOUS,TYPE_TRAP,TYPE_SPELL) and not c:IsForbidden() and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0
end
function s.tfop(e,tp)
Scl.SelectAndOperateCards("PlaceInSpell&TrapZone",tp,aux.NecroValleyFilter(s.pfilter),tp,"Deck,GY",0,1,1,nil,e,tp)()
end
function s.bfilter(c,e,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function s.rtfilter(c)
return c:IsAbleToHand() and c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.bop(e,tp)
if Scl.SelectAndOperateCards("Return2Hand",tp,s.rtfilter,tp,"OnField",0,1,1,aux.ExceptThisCard(e))() > 0 and Scl.IsCorrectlyOperated("Hand") then
local _, tc = Scl.GetTargetsReleate2Chain()
if not tc then return end
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
end
end
\ No newline at end of file
--自负之恶念体
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "Equip", nil,
"Equip", "Target", "Hand,MonsterZone", s.eqcon, nil,
s.eqtg, s.eqop)
local e2 = Scl.CreateFieldTriggerContinousEffect(c, "BeforeEffectResolving", nil, nil, nil, "Spell&TrapZone", s.cecon, s.ceop)
--[[local e1 = Scl.CreateQ(c, "BeSpecialSummoned",
"Equip", nil, "Equip",
"Delay", "Hand,MonsterZone", s.eqcon, nil,
{ "~Target", "Equip", s.eqfilter, true }, s.eqop)
local e2 = Scl.CreateEquipBuffEffect(c, "+ATK", 800)
local e3,e4 = Scl.CreateEquipBuffEffect(c,
"NegateEffect,NegateActivatedEffect", 1)
--]]
local e5,e6 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormalSummoned,BeAdded2Hand",
"Draw", nil, "Draw,ShuffleIn2Deck", "Delay", nil,
nil, { "PlayerTarget", "Draw", 1 }, s.drop)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.eqcon(e,tp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc = re:GetHandler()
if chk == 0 then
return rc:IsFaceup() and rc:IsCanBeEffectTarget(e) and rc:IsSummonType(SUMMON_TYPE_SPECIAL) and re:IsActiveType(TYPE_MONSTER) and rc:IsLocation(LOCATION_MZONE) and rp ~= tp and rc:IsRelateToChain(ev) and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0
end
Duel.SetTargetCard(rc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.eqfilter(c,e,tp)
return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsSummonPlayer(1-tp) and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0
end
function s.egfilter(c)
return c:IsRelateToChain() and c:IsFaceup()
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local _, rc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
local _,c = Scl.GetActivateCard()
if rc and c then
Scl.Equip(c, rc)
end
end
function s.cecon(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
return re:GetHandler():GetEquipGroup():IsContains(c)
end
function s.ceop(e,tp,eg,ep,ev,re,r,rp)
Scl.HintCard(id)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,s.rep_op)
end
function s.rep_op(e,tp)
local c = e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
Scl.AddSingleBuff2Self(c, "+ATK", 800, "Reset", RESETS_SCL)
end
end
function s.rvfilter(c)
return not c:IsPublic()
end
function s.drop(e,tp)
if Duel.Draw(tp,1,REASON_EFFECT) > 0 then
Scl.SetExtraSelectAndOperateParama(nil,true)
Scl.SelectAndOperateCards("ShuffleIn2Deck",tp,Card.IsAbleToDeck,tp,"Hand,OnField",0,1,1,nil)()
end
end
\ No newline at end of file
--自卑之恶念体
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateFieldTriggerOptionalEffect(c, "DeclareAttack",
"Equip", nil, "Equip",
"Target", "Hand,MonsterZone", s.eqcon, nil, s.eqtg, s.eqop)
local e2 = Scl.CreateEquipBuffEffect(c, "!Attack", 1)
local e3,e4 = Scl.CreateEquipBuffEffect(c,
"=ATK,=DEF", 0)
local e5,e6 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormalSummoned,BeAdded2Hand",
{id, 0}, nil, nil, "Delay", nil, nil, nil, s.drop)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.eqcon(e,tp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function s.eqfilter(c,e,tp)
return c:IsControler(1-tp) and c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsCanBeEffectTarget(e)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc1,bc2 = Duel.GetBattleMonster(tp)
local g = Scl.Mix2Group(bc1,bc2)
local sg = g:Filter(s.eqfilter,nil,e,tp)
if chk == 0 then return #sg > 0 and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 end
local tc = sg:GetFirst()
if #sg > 1 then
Scl.HintSelect(tp, "Opponent")
tc = sg:Select(tp,1,1,nil):GetFirst()
end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.eqop(e,tp,eg)
local _, tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
local _, c = Scl.GetActivateCard()
if not tc or not c then return end
Scl.Equip(c, tc)
end
function s.drop(e,tp)
Duel.RegisterFlagEffect(tp,id,RESET_EP_SCL,0,1)
if s.buff then return end
s.buff = true
local c = e:GetHandler()
Scl.CreateFieldBuffEffect({c,tp},"+ATK,+DEF",s.val1,s.limtg,{0, "MonsterZone"},nil, nil, RESET_EP_SCL)
Scl.CreateFieldBuffEffect({c,tp},"+Level",s.val2,s.limtg,{0, "MonsterZone"},nil, nil, RESET_EP_SCL)
end
function s.val1(e,c)
local ct = Duel.GetFlagEffect(tp, id)
return ct * -800
end
function s.val2(e,c)
local ct = Duel.GetFlagEffect(tp, id)
return ct * -1
end
function s.limtg(e,c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
--焦躁之恶念体
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateFieldTriggerOptionalEffect(c, "BeSpecialSummoned",
"Equip", nil, "Equip,NormalSummon",
"Target", "Hand,MonsterZone", s.eqcon, nil,
{ "Target", "Equip", s.eqfilter, 0, "MonsterZone" }, s.eqop)
local e2 = Scl.CreateFieldTriggerContinousEffect(c, "BeforeEffectResolving",
nil, nil, nil, "Spell&TrapZone", s.drcon, s.drop)
local e3 = Scl.CreateFieldTriggerContinousEffect(c, "NegateActivatedEffect",
nil, nil, nil, "Spell&TrapZone", s.drcon, s.drop)
end
function s.cfilter(c,tp)
return (c:IsSummonLocation(LOCATION_EXTRA) or c:IsSummonLocation(LOCATION_DECK) ) and c:IsSummonPlayer(1-tp) and c:IsType(TYPE_EFFECT)
end
function s.eqcon(e,tp,eg)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.eqfilter(c,e,tp)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0
end
function s.sumfilter(c)
return c:IsSetCard(0x3338) and c:IsSummonable(true, nil)
end
function s.eqop(e,tp,eg)
local _, c = Scl.GetActivateCard()
local _, tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
if not c or not tc then return end
if Scl.Equip(c, tc) > 0 then
Scl.SetExtraSelectAndOperateParama("NormalSummon", true)
local _,c = Scl.SelectCards("NormalSummon",tp,s.sumfilter,tp,"Hand,MonsterZone",0,1,1,nil)
if c then
Duel.Summon(tp,c,true,nil)
end
end
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local tc = e:GetHandler():GetEquipTarget()
local re2=Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_EFFECT)
return tc and re2:GetHandler() == tc
end
function s.drop(e,tp)
Scl.HintCard(id)
Duel.Draw(tp,1,REASON_EFFECT)
--Duel.Draw(1-tp,1,REASON_EFFECT)
--local c = e:GetHandler()
--local e1,e2 = Scl.CreatePlayerBuffEffect({c,tp}, "!Normal&SpecialSummon",1,aux.TargetBoolFunction(Card.IsSetCard,0x3338),nil,nil,{RESET_EP_SCL,2})
end
\ No newline at end of file
--惶恐之恶念体
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateFieldTriggerOptionalEffect(c, "BeSpecialSummoned",
"Equip", nil, "Equip,NormalSummon",
"Target", "Hand,MonsterZone", s.eqcon, nil,
{ "Target", "Equip", s.eqfilter, 0, "MonsterZone" }, s.eqop)
--local e2 = Scl.CreateFieldTriggerContinousEffect(c, "Adjust", nil, nil, nil, "Spell&TrapZone", nil, s.bnop)
local e3 = Scl.CreateFieldTriggerContinousEffect(c, "BeEffectTarget", nil, nil, nil, "Spell&TrapZone", s.bncon2, s.bnop2)
local e4 = Scl.CreateFieldTriggerContinousEffect(c, "BeAttackTarget", nil, nil, nil, "Spell&TrapZone", s.bncon3, s.bnop2)
local e5 = Scl.CreateFieldTriggerContinousEffect(c, "BeforeEffectResolving", nil, nil, nil, "Spell&TrapZone", s.bncon4, s.bnop2)
end
function s.cfilter(c,tp)
return (c:IsSummonLocation(LOCATION_HAND) or c:IsSummonLocation(LOCATION_GRAVE) ) and c:IsSummonPlayer(1-tp)
end
function s.eqcon(e,tp,eg)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.eqfilter(c,e,tp)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0
end
function s.sumfilter(c)
return c:IsSetCard(0x3338) and c:IsSummonable(true, nil)
end
function s.eqop(e,tp,eg)
local _, c = Scl.GetActivateCard()
local _, tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
if not c or not tc then return end
if Scl.Equip(c, tc) > 0 then
Scl.SetExtraSelectAndOperateParama("NormalSummon", true)
local _,c = Scl.SelectCards("NormalSummon",tp,s.sumfilter,tp,"Hand,MonsterZone",0,1,1,nil)
if c then
Duel.Summon(tp,c,true,nil)
end
end
end
function s.bnop(e,tp)
local c = e:GetHandler()
local ec = c:GetEquipTarget()
if not ec then return end
if ec:GetOwnerTargetCount()>0 then
Scl.HintCard(id)
Scl.AddSingleBuff({c,ec},"NegateEffect",1,"NegateActivatedEffect",1)
end
end
function s.bncon2(e,tp,eg)
local c = e:GetHandler()
local ec = c:GetEquipTarget()
return ec and eg:IsContains(ec)
end
function s.bnop2(e,tp,eg)
local c = e:GetHandler()
local ec = c:GetEquipTarget()
if not ec then return end
if not ec:IsDisabled() then
Scl.HintCard(id)
end
Scl.AddSingleBuff({c,ec},"NegateEffect",1,"NegateActivatedEffect",1)
end
function s.bncon3(e,tp,eg)
local c = e:GetHandler()
local ec = c:GetEquipTarget()
local bc = Duel.GetAttackTarget()
return ec and bc and ec == bc
end
function s.bncon4(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
local ec = c:GetEquipTarget()
local tg = Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and tg and tg:IsContains(ec)
end
\ No newline at end of file
--惊惧之恶念体
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateFieldTriggerOptionalEffect(c, "BeSpecialSummoned",
"Equip", nil, "Equip,NormalSummon",
"Target", "Hand,MonsterZone", s.eqcon, nil,
{ "Target", "Equip", s.eqfilter, 0, "MonsterZone" }, s.eqop)
local e2 = Scl.CreateFieldTriggerContinousEffect(c, "BeforeLeavingField",nil,nil,nil,"Spell&TrapZone",s.lfcon,s.lfop)
end
function s.cfilter(c,tp)
return c:IsSummonPlayer(1-tp) and not c:GetReasonEffect():IsHasProperty(EFFECT_FLAG_UNCOPYABLE)
end
function s.eqcon(e,tp,eg)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.eqfilter(c,e,tp)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0
end
function s.sumfilter(c)
return c:IsSetCard(0x3338) and c:IsSummonable(true, nil)
end
function s.eqop(e,tp,eg)
local _, c = Scl.GetActivateCard()
local _, tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
if not c or not tc then return end
if Scl.Equip(c, tc) > 0 then
Scl.SetExtraSelectAndOperateParama("NormalSummon", true)
local _,c = Scl.SelectCards("NormalSummon",tp,s.sumfilter,tp,"Hand,MonsterZone",0,1,1,nil)
if c then
Duel.Summon(tp,c,true,nil)
end
end
end
function s.lfcon(e,tp,eg)
local c = e:GetHandler()
local ec = c:GetEquipTarget()
return ec and eg:IsContains(ec)
end
function s.lfop(e,tp)
local c = e:GetHandler()
local ec = c:GetEquipTarget()
local eg = ec:GetEquipGroup()
for tc in aux.Next(eg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_HAND)
tc:RegisterEffect(e1,true)
end
end
\ No newline at end of file
--恶念体 神智摧毁者
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
Scl.SetSummonCondition(c, false, aux.FALSE)
local e0 = Scl.AddNormalSummonProcedure(c, false, s.sumcon, nil,
s.sumop, nil, nil, "TributeSummon")
--[[local e1 = Scl.CreateFieldBuffEffect(c, "NegateEffect", 1,
aux.TargetBoolFunction(s.cfilter),
{"MonsterZone","MonsterZone"}, "MonsterZone", s.con)--]]
local e1 = Scl.CreateFieldBuffEffect(c, "UnaffectedByOpponentsCardEffects",
s.val, nil,
{"OnField",0}, "MonsterZone", s.con, nil, nil, nil, "SetAvailable,IgnoreUnaffected")
local e2 = Scl.CreateSingleBuffEffect(c, "+ATK", s.val, "MonsterZone", s.con)
end
function s.ecfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.otfilter(c,tp)
return c:GetEquipGroup():IsExists(s.ecfilter,1,nil)
end
function s.sumcon(e,c,tp,minc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(s.otfilter))
e1:SetValue(POS_FACEUP_ATTACK)
c:RegisterEffect(e1)
local mg=Duel.GetMatchingGroup(s.otfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local res = c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
e1:Reset()
return res
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(s.otfilter))
e1:SetValue(POS_FACEUP_ATTACK)
c:RegisterEffect(e1)
local mg=Duel.GetMatchingGroup(s.otfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
e1:Reset()
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function s.con(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function s.cfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function s.val(e,c)
return Duel.GetMatchingGroupCount(s.cfilter, e:GetHandlerPlayer(), 0, LOCATION_MZONE, nil) * 800
end
\ No newline at end of file
--恶念体 大脑掌控者
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
Scl.SetSummonCondition(c, false, aux.FALSE)
local e0 = Scl.AddNormalSummonProcedure(c, false, s.sumcon, nil,
s.sumop, nil, nil, "TributeSummon")
local e1 = Scl.CreateFieldTriggerContinousEffect(c, "BeSpecialSummoned", nil,
nil, nil, "MonsterZone", s.damcon, s.damop)
local e2 = Scl.CreateFieldTriggerContinousEffect(c, "ActivateEffect", nil,
nil, nil, "MonsterZone", s.glpcon, s.glpop)
end
function s.ecfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.otfilter(c,tp)
return c:GetEquipGroup():IsExists(s.ecfilter,1,nil)
end
function s.sumcon(e,c,tp,minc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(s.otfilter))
e1:SetValue(POS_FACEUP_ATTACK)
c:RegisterEffect(e1)
local mg=Duel.GetMatchingGroup(s.otfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local res = c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
e1:Reset()
return res
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(s.otfilter))
e1:SetValue(POS_FACEUP_ATTACK)
c:RegisterEffect(e1)
local mg=Duel.GetMatchingGroup(s.otfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
e1:Reset()
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function s.con(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer, 1, nil, 1 - tp) and s.con(e)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
Scl.HintCard(id)
local ct = eg:FilterCount(Card.IsSummonPlayer, nil, 1 - tp)
Duel.Damage(1 - tp, ct * 800, REASON_EFFECT, true)
Duel.Recover(tp, ct * 1000, REASON_EFFECT, true)
Duel.RDComplete()
end
function s.glpcon(e,tp,eg,ep,ev,re,r,rp)
local loc = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION)
return rp ~= tp and re:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and s.con(e) and loc & LOCATION_MZONE ~= 0
end
function s.glpop(e,tp)
Scl.HintCard(id)
Duel.Damage(1 - tp, 800, REASON_EFFECT, true)
Duel.Recover(tp, 1000, REASON_EFFECT, true)
Duel.RDComplete()
end
\ No newline at end of file
--自私之恶念体
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateFieldTriggerOptionalEffect(c, "BeSpecialSummoned",
"Equip", nil, "Equip",
"Target", "Hand,MonsterZone", s.eqcon, nil,
{ "Target", "Equip", s.eqfilter, true }, s.eqop)
local e2 = Scl.CreateEquipBuffEffect(c,
"!BeUsedAsMaterial4SpecialSummon", 1)
local e3 = Scl.CreateFieldBuffEffect(c, "!BeTributed", 1,
s.tg, {0, 1}, "Spell&TrapZone")
local e4,e5 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormalSummoned,BeAdded2Hand",
"AddFromDeck2Hand", nil, "AddFromDeck2Hand", "Delay", nil,
nil, s.thtg, s.thop)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3338)
end
function s.eqcon(e,tp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function s.eqfilter(c,e,tp)
return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsSummonPlayer(1-tp) and Duel.GetLocationCount(tp,LOCATION_SZONE) > 0
end
function s.egfilter(c)
return c:IsRelateToChain() and c:IsFaceup()
end
function s.eqop(e,tp,eg)
local _, tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
local _, c = Scl.GetActivateCard()
if not tc or not c then return end
Scl.Equip(c, tc)
end
function s.tg(e,c)
local ec = e:GetHandler():GetEquipTarget()
return ec and ec == c
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g = Duel.GetDecktopGroup(1-tp,1)
if chk == 0 then return #g > 0 and g:GetFirst():IsAbleToHand(tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function s.thop(e,tp)
local c = e:GetHandler()
local g = Duel.GetDecktopGroup(1-tp,1)
if #g == 0 then return end
local tc = g:GetFirst()
if Duel.SendtoHand(g,tp,REASON_EFFECT) <= 0 or not tc:IsLocation(LOCATION_HAND) then return end
Scl.AddSingleBuff({c,tc},"Reveal",1)
Scl.CreateFieldTriggerContinousEffect_PhaseOpearte({c,tp},tc,"BanishFacedown",nil, nil, PHASE_END)
end
\ No newline at end of file
--异位魔的威压
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
aux.AddCodeList(c,10106003)
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateQuickOptionalEffect(c, nil, "Look", 1,
"SpecialSummonFromHand/GY", nil, "Spell&TrapZone", nil, nil,
{ "~Target", "Dummy", aux.TRUE, 0, "Hand,GY" }, s.spop)
local e3 = Scl.CreateFieldTriggerOptionalEffect(c, "BeAdded2Hand",
"Add2Hand", 1, "Search,Add2Hand" , "Delay", "Spell&TrapZone",
nil, nil, s.thtg, s.thop)
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,1-tp,false,false,POS_FACEUP,1-tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE ) > 0
end
function s.spop(e,tp)
local g = Duel.GetFieldGroup(tp,0,LOCATION_HAND+LOCATION_GRAVE)
if #g == 0 then return end
Duel.ConfirmCards(tp, g)
if g:IsExists(s.spfilter,1,nil,e,tp) and Scl.SelectYesNo(tp, "SpecialSummon") then
local sg = g:FilterSelect(tp, s.spfilter, 1, 1, nil, e, tp)
Scl.HintSelection(sg)
Scl.AddSingleBuff(nil, "NegateEffect,NegateActivatedEffect", 1)
Scl.SpecialSummon(sg,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
function s.pfilter(c,tp)
return not c:IsPublic() and c:IsControler(tp) and c:IsSetCard(0x3338) and c:IsPreviousSetCard(0x3338) and c:IsType(TYPE_MONSTER) and Scl.IsOriginalType(c, 0, "Monster") and (not c:IsReason(REASON_DRAW) or not c:IsReason(REASON_RULE)) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c:GetCode())
end
function s.thfilter(c,code)
return c:IsCode(0x3338) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(code)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then
return e:IsCostChecked() and eg:IsExists(s.pfilter,1,nil,tp)
end
local ct,og,tc = Scl.SelectAndOperateCardsFromGroup("Reveal",eg,tp,s.pfilter,1,1,nil,tp)()
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp)
local tc = Duel.GetFirstTarget()
Scl.SelectAndOperateCards("Add2Hand",tp,aux.NecroValleyFilter(s.thfilter),tp,"Deck,GY",0,1,1,nil,tc:GetCode())()
end
\ No newline at end of file
--异位魔的威信
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
aux.AddCodeList(c,10106003)
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateQuickOptionalEffect(c, nil, "Look", 1,
"SpecialSummonFromDeck/Extra", nil, "Spell&TrapZone", nil, nil,
{ "~Target", "Dummy", aux.TRUE, 0, "Deck,Extra" }, s.spop)
local e2 = Scl.CreateQuickOptionalEffect(c, nil, "Equip", 1,
"Equip", "Target", "Spell&TrapZone", nil, nil, {
{ "Target", "Dummy", Card.IsFaceup, "MonsterZone", "MonsterZone" },
{ "~Target", "Equip", s.eqfilter, "Hand,Deck,GY" } }, s.eqop)
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) and Duel.GetLocationCount( 1- tp,LOCATION_MZONE ) > 0
end
function s.spop(e,tp)
local g = Duel.GetFieldGroup(tp,0,LOCATION_DECK+LOCATION_EXTRA)
if #g == 0 then return end
Duel.ConfirmCards(tp, g)
if g:IsExists(s.spfilter,1,nil,e,tp) and Scl.SelectYesNo(tp, "SpecialSummon") then
local sg = g:FilterSelect(tp, s.spfilter, 1, 1, nil, e, tp)
Scl.HintSelection(sg)
Scl.AddSingleBuff(nil, "NegateEffect,NegateActivatedEffect", 1)
Scl.SpecialSummon(sg,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
function s.eqfilter(c,e,tp)
return (c:GetOriginalLevel() == 1 or c:GetOriginalLevel() == 4) and c:IsSetCard(0x3338) and Scl.GetSZoneCount(tp) > 0 and not c:IsForbidden()
end
function s.eqop(e,tp)
local _,tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
if not tc then return end
Scl.SelectAndOperateCards("Equip",tp,aux.NecroValleyFilter(s.eqfilter),tp,"Hand,Deck,GY",0,1,1,nil,e,tp)(tc)
end
\ No newline at end of file
--恶念聚集
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = GetID()
function s.initial_effect(c)
aux.AddCodeList(c,10106003)
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateIgnitionEffect(c, "Search", 1,
"AddFromDeck2Hand,NormalSummon", "Target",
"Spell&TrapZone", nil,
{ "PlayerCost", "Discard", 1},
{{ "Target", "Dummy", s.cfilter, "OnField" },
{ "~Target", "Add2Hand", Card.IsAbleToHand, "Deck,GY" }}, s.thop)
local e3 = Scl.CreateFieldTriggerContinousEffect(c, "ActivateEffect",
nil, nil, nil, "Spell&TrapZone", nil, s.lcop)
end
function s.cfilter(c,e,tp)
return Scl.IsOriginalType(c,0,TYPE_MONSTER) and c:IsSetCard(0x3338) and c:IsFaceup() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c:GetOriginalLevel())
end
function s.thfilter(c,lv)
return c:IsAbleToHand() and c:IsSetCard(0x3338) and c:IsType(TYPE_MONSTER) and c:GetOriginalLevel() ~= lv
end
function s.thop(e,tp)
local _,tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
if not tc then return end
if Scl.SelectAndOperateCards("Add2Hand",tp,aux.NecroValleyFilter(s.thfilter),tp,"Deck,GY",0,1,1,nil,tc:GetOriginalLevel())() > 0 and Scl.IsCorrectlyOperated("Hand") then
Scl.SetExtraSelectAndOperateParama("NormalSummon", true)
Scl.SelectAndOperateCards("NormalSummon",tp,s.sumfilter,tp,"Hand,MonsterZone",0,1,1,nil)()
end
end
function s.sumfilter(c)
return c:IsSetCard(0x3338) and c:IsSummonable(true,nil)
end
function s.lcop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0x3338) and ep==tp then
Duel.SetChainLimit(s.chainlm)
end
end
function s.chainlm(e,rp,tp)
return tp==rp
end
\ No newline at end of file
--乌托兰秘境 静谧河谷
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = Scl.SetID(10122001)
if not Scl_Utoland then
Scl_Utoland = s
function Scl_Utoland.Link(c)
c:EnableReviveLimit()
local lk = c:GetLink()
if lk == 1 then
aux.AddLinkProcedure(c, aux.TRUE, 1, 1, s.link_group_filter)
else
aux.AddLinkProcedure(c, aux.TRUE, 1, lk, s.link_group_filter2)
end
end
function s.link_group_filter(g, lc, tp)
return g:IsExists(s.link_filter, 1, nil, tp)
end
function s.link_filter(c, tp)
return s.link_filter2(c, tp) or (c:IsLinkSetCard(0xc333) and c:IsLinkAbove(2))
end
function s.link_group_filter2(g, lc, tp)
return g:IsExists(s.link_filter2, 1, nil, tp)
end
function s.link_filter2(c, tp)
return c:IsLinkCode(10122011) or (c:GetFlagEffect(10122019) > 0 and c:GetFlagEffectLabel(10122019) == tp)
end
function Scl_Utoland.GetTributeGroup(tp)
local g1=Duel.GetReleaseGroup(tp):Filter(Card.IsSetCard, nil, 0xc333)
local g2=Duel.GetMatchingGroup(s.tri_filter, tp, LOCATION_SZONE, 0, nil)
return g1 + g2
end
function s.tri_filter(c)
return c:IsSetCard(0xc333) and Scl.IsOriginalType(c,0,TYPE_MONSTER)
end
function Scl_Utoland.FieldActivateEffects(c, cid, cost, tg, minct, maxct, tk_exop)
minct = minct or 1
maxct = maxct or minct
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateQuickOptionalEffect({c, 0}, "FreeChain", "SpecialSummonToken", nil, "SpecialSummonToken", nil, nil, s.field_effect_con, cost, Scl_Utoland.Token_Target(minct, maxct, tg), s.field_effect_op(minct, maxct, tk_exop))
local e3 = Scl.CloneEffect({c, 1}, e2)
local e4 = Scl.CreateSingleBuffEffect(c, id, 1, "FieldZone")
return e1,e2,e3,e4
end
function Scl_Utoland.FieldEffects(c, cid, cost, tg, minct, maxct, tk_exop)
local e1, e2, e3, e4 = Scl_Utoland.FieldActivateEffects(c, cid, cost, tg, minct, maxct, tk_exop)
local e5 = Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "ActivateSpell", { 1, cid }, "ActivateSpell", nil, "FieldZone", nil, nil, { { "Target", "Return2Hand", Card.IsAbleToHand }, { "~Target", "ActivateSpell", s.hand_act_filter(cid), "Hand" } }, s.hand_act_op(cid))
return e1,e2,e3,e4,e5
end
function s.field_effect_con(e)
local c = e:GetOwner()
local tp = e:GetHandlerPlayer()
return c:IsHasEffect(id, tp) and c:IsControler(tp) and c:GetFlagEffect(id) == 0
end
function s.limit_act_count(e)
local c = e:GetOwner()
local tp = e:GetHandlerPlayer()
local fc = Duel.GetFieldCard(tp, LOCATION_SZONE, 5)
if fc and c == fc and c:GetFieldID() == fc:GetFieldID() then
fc:RegisterFlagEffect(id, RESETS_EP_SCL, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 3))
end
end
function Scl_Utoland.Token_Target(minct, maxct, tg, limit)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then
if tg then
return tg(e,tp,eg,ep,ev,re,r,rp,0)
else
return Scl_Utoland.SpecialSummonTokenAble(tp, nil, minct, maxct)
end
end
if not tg then
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,maxct,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,maxct,0,0)
else
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
if not limit then
s.limit_act_count(e)
end
end
end
function Scl_Utoland.SpecialSummonTokenAble(tp, tc, minct, maxct)
minct =minct or 1
maxct = maxct or minct
minct = type(minct) == "function" and minct(tp) or minct
maxct = type(maxct) == "function" and maxct(tp) or maxct
if minct == 0 then
return false
end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,10122011,0xc333,0x4011,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_DARK) then
return false
end
if minct > 1 and Scl.IsAffectedByBlueEyesSpiritDragon(tp) then
return false
end
if Scl.IsAffectedByBlueEyesSpiritDragon(tp) then
maxct = 1
end
local useless_zone = 0
local ct1, useless_zone1, ct2, useless_zone2 = 0,0,0,0x1f00
ct1, useless_zone1 = Duel.GetMZoneCount(tp,tc)
useless_zone1 = useless_zone1 - (useless_zone1 & 0x60)
if Duel.IsPlayerAffectedByEffect(tp,10122012) then
ct2, useless_zone2 = Scl.GetSZoneCount(tp,tc)
useless_zone2 = useless_zone2 * 0x100
end
useless_zone = useless_zone1 | useless_zone2
local zct = ct1 + ct2
return zct >= minct, useless_zone, minct, math.min(zct, maxct)
end
function s.field_effect_op(minct, maxct, tk_exop)
return function(e, tp)
local res = Scl_Utoland.SpecialSummonToken(e:GetOwner(), tp, minct, maxct)
if tk_exop then
tk_exop(e, tp, res)
end
end
end
function Scl_Utoland.SpecialSummonToken(c, tp, minct, maxct, buff)
local bool, zone, minct2, maxct2 = Scl_Utoland.SpecialSummonTokenAble(tp, nil, minct, maxct)
if not bool then return false end
local res = false
for i = 1, maxct2 do
local token = Duel.CreateToken(tp, 10122011)
Scl.HintSelect(tp, {id, 0})
local sel_zone = Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,zone)
if sel_zone & 0x1f ~= 0 then
if Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP, sel_zone) then
if buff then
buff(c, token)
end
res = true
end
else
sel_zone = sel_zone / 0x100
Duel.MoveToField(token, tp, tp,LOCATION_SZONE, POS_FACEUP, true, sel_zone)
if buff then
buff(c, token)
end
local e1 = Scl.CreateSingleBuffCondition({c, token}, "=Type", TYPE_SPELL + TYPE_CONTINUOUS, "Spell&TrapZone", nil, RESETS_WITHOUT_SET_SCL)
local e2 = Scl.CreateSingleBuffEffect(token, "ExtraLinkMaterial", s.ex_lmat_val, "Spell&TrapZone", nil, RESETS_SCL)
local e3 = Scl.CreateFieldTriggerMandatoryEffect(token, "DuringEP", "NegateEffect", 1, "NegateEffect,Destroy", nil, "Spell&TrapZone", nil, nil, s.neg_tg, s.neg_op, RESETS_SCL)
end
if maxct2 ~= ct2 and i < maxct2 and i >= minct2 and not Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
break
end
end
if res then
Duel.SpecialSummonComplete()
end
return true
end
function s.xxmxattg(e,c)
return c == e:GetHandler()
end
function s.ex_lmat_val(e,lc,mg,c,tp)
if not (lc:IsSetCard(0xc333) and e:GetHandlerPlayer()==tp) then return false,nil end
return true,true
end
function s.neg_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then return true end
local g = e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
local g1 = g:Filter(aux.NegateAnyFilter,nil)
local g2 = g:Filter(Card.IsFacedown,nil)
if #g1 > 0 then
Duel.SetOperationInfo(0, CATEGORY_NEGATE, g1, #g1, 0, 0)
end
if #g2 > 0 then
Duel.SetOperationInfo(0, CATEGORY_DESTROY, g2, #g2, 0, 0)
end
end
function s.neg_op(e,tp,eg,ep,ev,re,r,rp)
local g = e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
local g1 = g:Filter(aux.NegateAnyFilter,nil)
local g2 = g:Filter(Card.IsFacedown,nil)
if #g1 > 0 then
Scl.NegateCardEffects(g1)
end
if #g2 > 0 then
Duel.Destroy(g2, REASON_EFFECT)
end
end
function s.hand_act_filter(cid)
return function(c,e,tp)
return not c:IsCode(cid) and Scl.IsType(c, 0, TYPE_SPELL+TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
end
function s.hand_act_op(cid)
return function(e,tp)
local c = Scl.GetActivateCard()
if c and Duel.SendtoHand(c,nil,REASON_EFFECT) > 0 and c:IsLocation(LOCATION_HAND) then
Scl.SelectAndOperateCards("ActivateSpell", tp, s.hand_act_filter(cid), tp, "Hand", 0, 1, 1, nil,e,tp)()
end
end
end
function Scl_Utoland.DeepFieldGYEffect(c, cid)
return Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "ActivateSpell", { 1, cid }, "ActivateSpell,Destroy", nil, "GY", nil, nil, { { "~Target", "Destroy", s.field_des_filter, "Spell&TrapZone" }, { "~Target", "ActivateSpell", s.gy_act_filter } }, s.gy_act_op)
end
function Scl_Utoland.DeepFieldEffects(c, cid, event, con, minct, maxct)
minct = minct or 1
maxct = maxct or minct
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateFieldTriggerOptionalEffect({c, 0}, event, "SpecialSummonToken", nil, "SpecialSummonToken", maxct == minct and "Delay" or nil, nil, s.deep_field_sp_con(con), nil, Scl_Utoland.Token_Target(minct, maxct, false, true), s.deep_field_effect_op(minct, maxct))
local e3 = Scl.CloneEffect({c, 1}, e2)
local e4 = Scl.CreateQuickOptionalEffect(c, "ActivateEffect", "ActivateSpell", { 1, cid }, "ActivateSpell,Destroy", nil, "GY", nil, nil, { { "~Target", "Destroy", s.field_des_filter, "Spell&TrapZone" }, { "~Target", "ActivateSpell", s.gy_act_filter } }, s.gy_act_op)
local e5 = Scl.CreateSingleBuffEffect(c, id, 1, "FieldZone")
return e1,e2,e3,e4,e5
end
function s.deep_field_sp_con(con)
return function(e,tp,...)
local c = e:GetOwner()
return con(e,tp,...) and c:IsHasEffect(id) and c:IsControler(e:GetHandlerPlayer())
end
end
function s.deep_field_effect_op(minct, maxct)
return function(e, tp)
if not Scl_Utoland.SpecialSummonToken(e:GetOwner(), tp, minct, maxct) then return end
Scl_Utoland.LinkSummon(tp)
end
end
function s.lnk_filter(c)
return c:IsSetCard(0xc333) and c:IsType(TYPE_LINK) and c:IsLinkSummonable(nil)
end
function Scl_Utoland.LinkSummon(tp)
local g=Duel.GetMatchingGroup(s.lnk_filter,tp,LOCATION_EXTRA,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.LinkSummon(tp,tc,nil)
end
end
function s.field_des_filter(c)
return c:GetSequence() == 5
end
function s.gy_act_filter(c,e,tp)
return c:GetActivateEffect():IsActivatable(tp,true,true)
end
function s.gy_act_op(e,tp)
local c = Scl.GetActivateCard()
local fc = Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if not fc or Duel.Destroy(fc,REASON_EFFECT) <= 0 or not c then return end
Scl.ActivateCard(c, tp, tp, LOCATION_FZONE, POS_FACEUP, true)
end
function Scl_Utoland.Unaffected(c)
local e1 = Scl.CreateSingleBuffEffect(c, "UnaffectedByOpponentsCardEffects", 1, "MonsterZone", Scl_Utoland.TokenCondition)
return e1
end
function Scl_Utoland.TokenCondition(e)
return Duel.IsExistingMatchingCard(s.faceup_tkfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function s.faceup_tkfilter(c)
return c:IsFaceup() and c:IsCode(10122011)
end
--------------------------------------
end
--------------------------------------
if s then
-----------------------------------
function s.initial_effect(c)
Scl_Utoland.FieldEffects(c, id, scl.cost_pay_lp(800))
end
------
end
\ No newline at end of file
--乌托兰秘境 平和海滩
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.FieldEffects(c, id, nil, nil, 1, 1, s.exop)
end
function s.exop(e,tp)
local e1 = Scl.CreatePlayerBuffEffect({e:GetHandler(),tp},"!SpecialSummon", 1, s.tg, {1,0}, nil, nil, RESETS_EP_SCL)
end
function s.tg(e,c)
return not c:IsSetCard(0xc333)
end
\ No newline at end of file
--乌托兰秘境 星辉原野
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.FieldEffects(c, id, { "PlayerCost", "Discard", 1 }, nil, 1, 2)
end
\ No newline at end of file
--空想星界 星辉沼地
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.FieldEffects(c, id, nil, s.tg, 1, 2)
end
function s.cfilter(c,tp)
return Scl_Utoland.SpecialSummonTokenAble(tp, c, 1, 2)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local rg = Scl_Utoland.GetTributeGroup(tp)
if chk==0 then
if e:IsCostChecked() then
return rg:IsExists(s.cfilter,1,nil,tp)
else
local res = Scl_Utoland.SpecialSummonTokenAble(tp, nil, 1, 2)
return res
end
end
if e:IsCostChecked() then
Scl.SelectAndOperateCardsFromGroup("Tribute",rg,tp,aux.TRUE,1,1,nil)(REASON_COST)
end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
--梦吟
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl.AddTokenList(c, 10122011)
local e1 = Scl.CreateActivateEffect(c, "FreeChain", "SpecialSummonToken", { 1, id }, "SpecialSummonToken", nil, nil, nil, Scl_Utoland.Token_Target(1, 1, nil, true), s.act)
local e2 = Scl.CreateFieldTriggerOptionalEffect(c, "BePlacedOnField", "Return2Hand", {1, id + 100}, "Return2Hand", "Delay", "GY", s.thcon, nil, { "~Target", "Return2Hand", Card.IsAbleToHand }, s.thop)
end
function s.act(e,tp)
local maxct = Duel.GetFieldCard(tp,LOCATION_SZONE,5) and 2 or 1
Scl_Utoland.SpecialSummonToken(e:GetHandler(), tp, 1, maxct)
end
function s.thcon(e,tp,eg)
return eg:IsExists(s.thcfilter,1,nil,tp)
end
function s.thcfilter(c,tp)
return c:IsControler(tp) and c:IsFaceup() and c:IsCode(10122011)
end
function s.thop(e,tp)
local _, c = Scl.GetActivateCard()
if c then
Scl.Send2Hand(c, nil, REASON_EFFECT, true)
end
end
\ No newline at end of file
--梦坠
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c, "FreeChain", "Destroy", {1, id}, "Destroy", "Target", nil, nil, { "Target", "Destroy", {aux.TRUE, s.gcheck}, "OnField", "OnField", 1, 3 }, s.act)
local e2 = Scl.CreateFieldTriggerOptionalEffect(c, "BePlacedOnField", "Return2Hand", {1, id + 100}, "Return2Hand", "Delay", "GY", s.thcon, nil, { "~Target", "Return2Hand", Card.IsAbleToHand }, s.thop)
end
function s.cfilter(c,tp)
return c:IsFaceup() and Scl.IsOriginalType(c,0,TYPE_MONSTER) and c:IsSetCard(0xc333)
end
function s.gcheck(g,e,tp)
return g:IsExists(s.cfilter,1,nil,tp)
end
function s.act(e,tp)
local g= Scl.GetTargetsReleate2Chain()
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function s.thcon(e,tp,eg)
return eg:IsExists(s.thcfilter,1,nil,tp)
end
function s.thcfilter(c,tp)
return c:IsControler(tp) and c:IsFaceup() and c:IsCode(10122011)
end
function s.thop(e,tp)
local _, c = Scl.GetActivateCard()
if c then
Scl.Send2Hand(c, nil, REASON_EFFECT, true)
end
end
\ No newline at end of file
--来自乌托兰秘境的守护者
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.Link(c)
local e1 = Scl_Utoland.Unaffected(c)
--local e2 = Scl.CreateFieldBuffEffect(c, "!BeBattleTarget", 1, s.tg, {"MonsterZone", 0}, "MonsterZone", Scl_Utoland.TokenCondition)
local e2 = Scl.CreateFieldBuffEffect(c, "!BeDestroyedByBattle", 1, s.tg, {"MonsterZone", 0}, "MonsterZone", Scl_Utoland.TokenCondition)
local e3 = Scl.CreatePlayerBuffEffect(c, "GainLPInsteadOfTakingDamage", s.val, nil, {1, 0}, "MonsterZone", Scl_Utoland.TokenCondition)
local e4 = Scl.CreateEffectBuffEffect(c, "!NegateActivation", s.efilter, "MonsterZone", Scl_Utoland.TokenCondition)
local e5 = Scl.CreateEffectBuffEffect(c, "!NegateActivatedEffect", s.efilter, "MonsterZone", Scl_Utoland.TokenCondition)
end
function s.tg(e,c)
return c:IsFaceup() and c:IsSetCard(0xc333)
end
function s.efilter(e,ct)
local p=e:GetHandler():GetControler()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp and te:GetHandler():IsSetCard(0xc333)
end
function s.val(e,re,r,rp,rc)
if r & REASON_BATTLE ==0 then
return false
end
local tp=e:GetHandlerPlayer()
local bc=rc:GetBattleTarget()
return bc and bc:IsSetCard(0xc333) and bc:IsControler(tp)
end
--乌托兰最深层-迷失域之主
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.Link(c)
local e1 = Scl_Utoland.Unaffected(c)
local e2 = Scl.CreateQuickOptionalEffect_NegateActivation(c, "Banish", 1, "MonsterZone", { "All", 1 }, { "Cost", "Tribute", s.tfilter, "OnField" })
end
function s.tfilter(c)
return c:IsSetCard(0xc333) and Scl.IsOriginalType(c,0,TYPE_MONSTER)
end
\ No newline at end of file
--如梦
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c, "FreeChain", "ActivateSpell", nil, "ActivateSpell", nil, nil, nil, { "~Target", "ActivateSpell", s.afilter, "Hand,Deck,GY" }, s.act)
end
function s.afilter(c,e,tp)
return c:IsSetCard(0xc333) and Scl.IsType(c,0,TYPE_SPELL+TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true)
end
function s.act(e,tp)
Scl.SelectAndOperateCards("ActivateSpell",tp,aux.NecroValleyFilter(s.afilter),tp,"Hand,Deck,GY",0,1,1,nil,e,tp)()
end
\ No newline at end of file
--初醒
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c,"FreeChain","Destroy",nil,"Destroy,Draw,BanishFacedown", nil, nil, nil, { { "~Target", "Destroy", s.dfilter, "OnField",0, true, true, c }, { "PlayerTarget", "Draw", scl.black_hole_count } }, s.act)
end
function s.act(e,tp)
local g = Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
if #g == 0 then return end
local ct = Duel.Destroy(g,REASON_EFFECT)
if ct == 0 then return end
local rg = Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil,tp,POS_FACEDOWN)
if Duel.Draw(tp,ct,REASON_EFFECT) > 0 and ct >= 8 and #rg > 0 and Scl.SelectYesNo(tp, "BanishFacedown") then
Duel.BreakEffect()
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
end
\ No newline at end of file
--侵入乌托兰梦境的梦魇魔
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.Link(c)
local e1 = Scl.CreatePlayerBuffEffect(c, id, 1, nil, { 1, 0 }, "MonsterZone")
end
\ No newline at end of file
--乌托兰深层 灼炎地狱
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.DeepFieldEffects(c, id, "BeNormal/SpecialSummoned", s.con)
end
function s.cfilter(c,tp)
return c:GetSummonPlayer()~=tp
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
--乌托兰深层 迷失雨林
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.DeepFieldEffects(c, id, "BeAdded2Hand", s.con)
end
function s.cfilter(c,tp)
return c:IsControler(1-tp)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and Duel.GetCurrentPhase() ~= PHASE_DRAW
end
--乌托兰深层 死域之海
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.DeepFieldEffects(c, id, "DeclareAttack", s.con, 1, 2)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
--乌托兰深层 燃魂沙丘
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
local e1,e2,e3 = Scl_Utoland.FieldActivateEffects(c, id, nil, nil, s.minct, s.maxct, s.exop)
local e4 = Scl_Utoland.DeepFieldGYEffect(c, id)
if not s.counter then
s.counter = { [0] = 0, [1] = 0 }
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(s.ctop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_CHAIN_NEGATED)
ge2:SetOperation(s.ctop2)
Duel.RegisterEffect(ge2,0)
local ge3=ge1:Clone()
ge3:SetCode(4179255)
ge3:SetOperation(s.ctop)
Duel.RegisterEffect(ge3,0)
local ge4=ge1:Clone()
ge4:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge4:SetOperation(s.ctop3)
Duel.RegisterEffect(ge4,0)
end
end
function s.minct(tp)
return s.counter[tp] > 0 and 1 or 0
end
function s.maxct(tp)
return s.counter[tp]
end
function s.exop(e,tp,res)
if not res then return end
Scl_Utoland.LinkSummon(tp)
end
function s.ctop3(e,tp,eg,ep,ev,re,r,rp)
s.counter = { [0] = 0, [1] = 0 }
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local code1, code2 = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_CODE, CHAININFO_TRIGGERING_CODE2)
if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:GetHandler():IsType(TYPE_FIELD) or code1 == id or (code2 and code2 ==id) then return end
s.counter[rp]=s.counter[rp]+1
end
function s.ctop2(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:GetHandler():IsType(TYPE_FIELD) then return end
s.counter[rp]=s.counter[rp]-1
end
--乌托兰的织梦人
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl.AddTokenList(c, 10122011)
Scl_Utoland.Link(c)
local e1 = Scl_Utoland.Unaffected(c)
local e2 = Scl.CreateQuickOptionalEffect(c, "FreeChain", "SpecialSummonToken", {1,id}, "SpecialSummonToken", nil, "MonsterZone", nil, nil, Scl_Utoland.Token_Target(1, 1, nil, true), s.spop)
end
function s.spop(e,tp)
Scl_Utoland.SpecialSummonToken(e:GetHandler(), tp, 1, 1, s.buff)
end
function s.buff(c,tk)
local e1 = Scl.CreateSingleBuffEffect({c,tk}, "!BeUsedAsMaterial4LinkSummon", 1, "OnField", nil, RESETS_EP_SCL, {id,0}, nil, "ClientHint")
end
\ No newline at end of file
--乌托兰的盗梦者
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.Link(c)
local e1 = Scl_Utoland.Unaffected(c)
local e2 = Scl.CreateFieldTriggerOptionalEffect(c, "BePlacedOnField", "ActivateSpell", {1, id}, "ActivateSpell", "Delay", "MonsterZone", s.con, nil, {"~Target", "ActivateSpell", s.afilter, "Hand,Deck,GY" }, s.aop)
end
function s.cfilter(c,tp)
return c:IsCode(10122011) and c:IsFaceup() and c:IsControler(tp)
end
function s.con(e,tp,eg)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.afilter(c,e,tp)
local fc = Duel.GetFieldCard(tp,LOCATION_SZONE,5)
return c:IsSetCard(0xc333) and Scl.IsType(c,0,TYPE_SPELL+TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true) and (not fc or fc:IsFacedown() or not fc:IsCode(c:GetCode()))
end
function s.aop(e,tp)
Scl.SelectAndOperateCards("ActivateSpell",tp,aux.NecroValleyFilter(s.afilter),tp,"Hand,Deck,GY",0,1,1,nil,e,tp)()
end
\ No newline at end of file
--前往乌托兰深层的领路人
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
Scl_Utoland.Link(c)
local e1 = Scl_Utoland.Unaffected(c)
local e2 = Scl.CreateQuickOptionalEffect(c, "FreeChain", {id, 0}, {1, id}, nil, "Target", "MonsterZone", nil, nil, {"Target", "Opponent", s.cfilter, 0, "OnField"}, s.op)
end
function s.cfilter(c)
return c:IsFaceup() and c:GetFlagEffect(id) == 0
end
function s.op(e,tp)
local _,tc = Scl.GetTargetsReleate2Chain(Card.IsFaceup)
local c = e:GetHandler()
if not tc or tc:GetFlagEffect(id) ~= 0 then return end
tc:RegisterFlagEffect(id,RESETS_SCL,EFFECT_FLAG_CLIENT_HINT,1,tp,aux.Stringid(id,1))
local e1 = Scl.CreateSingleBuffEffect({c,tc,true}, "ExtraLinkMaterial", s.matval, "OnField", nil, RESETS_SCL)
e1:SetLabel(tp)
end
function s.matval(e,lc,mg,c,tp)
if not lc:IsSetCard(0xc333) or tp ~= e:GetLabel() then return false, nil end
return true,true
end
\ No newline at end of file
--乌托兰的造访者
local s,id = GetID()
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function s.initial_effect(c)
local e1, e2 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormal/SpecialSummoned", "Add2Hand", {1, id}, "Add2Hand", "Delay", nil, nil, { "~Target", "Add2Hand", s.thfilter, "GY,Deck" }, s.thop)
local e3 = Scl.CreateIgnitionEffect(c, "Add2Hand", {1, id}, "Add2Hand", nil, "GY", s.con, aux.bfgcost, { "~Target", "Add2Hand", s.thfilter2, "GY,Deck" }, s.thop2)
end
function s.thfilter(c)
return c:IsCode(10122009) and c:IsAbleToHand()
end
function s.thop(e,tp)
Scl.SelectAndOperateCards("Add2Hand",tp,aux.NecroValleyFilter(s.thfilter),tp,"GY,Deck", 0, 1, 1, nil)()
end
function s.con(e,tp)
local fc = Duel.GetFieldCard(tp,LOCATION_SZONE,5)
return fc and fc:IsFaceup() and fc:IsSetCard(0xc333)
end
function s.thfilter2(c)
return c:IsCode(10122010) and c:IsAbleToHand()
end
function s.thop2(e,tp)
Scl.SelectAndOperateCards("Add2Hand",tp,aux.NecroValleyFilter(s.thfilter2),tp,"GY,Deck", 0, 1, 1, nil)()
end
\ No newline at end of file
--量子驱动 α搜救机
if not pcall(function() require("expansions/script/c10100000") end) then require("script/c10100000") end
local s,id = Scl.SetID(10130001)
if Scl_Quantadrive then return end
Scl_Quantadrive = {}
Scl_Quantadrive.Summon = 0
Scl_Quantadrive.Summon_Limit = {}
Scl_Quantadrive.Summon_Buff = {}
function Scl_Quantadrive.FilpEffect(c, cs, cid, desc, ctgy, tg, op)
local e1 = Scl.CreateFlipMandatoryEffect(c, desc, nil, ctgy .. ",ChangePosition,Return2Hand", nil, nil, nil, tg, s.filp_op(op))
cs.Scl_Quantadrive_Filp_Effect = e1
return e1
end
function s.filp_op(op)
return function(e,tp,...)
local _, c = Scl.GetActivateCard(true)
if c and not c:IsStatus(STATUS_BATTLE_DESTROYED) then
local turn_set = c:IsOnField() and c:IsCanTurnSet() and c:GetFlagEffect(id) == 0
local spsum_set = not c:IsOnField() and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0
local st_set = not c:IsOnField() and c:IsSSetable()
local b1 = turn_set or spsum_set or st_set
local b2 = not c:IsLocation(LOCATION_HAND) and c:IsAbleToHand()
if b1 or b2 then
local op = Scl.SelectOption(tp, b1, {id, 1}, b2, {id, 2}, true, {id, 0})
if op == 1 then
if turn_set then
Duel.ChangePosition(c, POS_FACEDOWN_DEFENSE)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END,0,1)
elseif spsum_set then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) > 0 then
Duel.ConfirmCards(1-tp, c)
end
else
Duel.SSet(tp, c)
end
elseif op == 2 then
Scl.Send2Hand(c, nil, REASON_EFFECT, true)
end
end
end
op(e,tp,...)
end
end
function Scl_Quantadrive.NormalSummonEffect(c, cs, cid, event)
local e1 = Scl.CreateFieldTriggerOptionalEffect(c, event, "NormalSummon/Set", {1, cid}, "NormalSummon/Set", "Delay,DamageStep","Hand",s.normal_summon_con, { "Cost", "Reveal", aux.NOT(Card.IsPublic) }, {"~Target", "NormalSummon/Set", s.normal_summon_filter, "Hand,MonsterZone"}, s.normal_summon_op)
return e1
end
function s.normal_summon_cfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
end
function s.normal_summon_con(e,tp,eg)
return eg:IsExists(s.normal_summon_cfilter,1,nil,tp)
end
function s.normal_summon_filter(c)
return c:IsSetCard(0xa336) and c:IsType(TYPE_MONSTER) and (c:IsSummonable(true,nil) or c:IsMSetable(true,nil))
end
function s.normal_summon_op(e,tp)
Scl_Quantadrive.Summon = Scl_Quantadrive.Summon + 1
end
function s.shuffle_filter(c)
return c:IsFacedown() and c:GetSequence() < 5
end
function Scl_Quantadrive.Shuffle(tp)
local g = Duel.GetMatchingGroup(s.shuffle_filter,tp,LOCATION_MZONE,0,nil)
if #g > 0 then
Duel.ShuffleSetCard(g)
end
end
function Scl_Quantadrive.CreateNerveContact(cs, ...)
cs.Scl_Quantadrive_Effects = { ... }
for _, e in pairs({ ... }) do
local op = e:GetOperation() or aux.TRUE
e:SetOperation(s.nerve_op(op))
end
end
function s.nerve_filter(c,e,tp,eg,ep,ev,re,r,rp)
local code = c:GetOriginalCode()
if not c:IsSetCard(0xa336) or Duel.GetFlagEffect(tp, code) ~= 0 or code == e:GetHandler():GetOriginalCode() then return false end
local eft_arr = c.Scl_Quantadrive_Effects
if not eft_arr then return false end
for _, ae in pairs(eft_arr) do
local tg = ae:GetTarget() or aux.TRUE
if tg(e,tp,eg,ep,ev,re,r,rp,0) then
return true
end
end
return false
end
function s.summon_op(e,tp,eg,ep,ev,re,r,rp)
local ct = Scl_Quantadrive.Summon
--local ect = e:GetLabel() or 0
local tct = 1
local tc = e:GetLabelObject()
if ct > 1 then
local sum_buff = Scl_Quantadrive.Summon_Buff[tct] or aux.TRUE
local hc = Scl_Quantadrive.Summon_Limit[tct]
if not hc then
_, hc = Scl.SelectCards("NormalSummon/Set",tp,s.normal_summon_filter,tp,"Hand,MonsterZone",0,1,1,nil)
end
if hc then
local minct, maxct = hc:GetTributeRequirement()
if minct > 0 and Duel.CheckTribute(hc, minct) then
local g = Duel.SelectTribute(tp, hc, minct, maxct)
hc:SetMaterial(g)
Duel.Release(g, REASON_MATERIAL + REASON_SUMMON)
end
local pos = Duel.SelectPosition(tp, hc, POS_FACEUP_ATTACK + POS_FACEDOWN_DEFENSE)
sum_buff(hc, e,tp,eg,ep,ev,re,r,rp)
hc:RegisterFlagEffect(id + 100, RESETS_WITHOUT_TO_FIELD_SCL, 0, 1, hc:GetFieldID())
Duel.MoveToField(hc, tp, tp, LOCATION_MZONE, pos, true)
Debug.PreSummon(hc, minct > 0 and SUMMON_TYPE_ADVANCE or SUMMON_TYPE_NORMAL, LOCATION_HAND)
hc:SetStatus(STATUS_SUMMON_TURN, true)
if hc:IsFaceup() then
Duel.RaiseEvent(hc, EVENT_SUMMON_SUCCESS, nil, 0, tp, tp, 0)
Duel.RaiseSingleEvent(hc, EVENT_SUMMON_SUCCESS, nil, 0, tp, tp, 0)
else
Duel.RaiseEvent(hc, EVENT_MSET, nil, 0, tp, tp, 0)
Duel.RaiseSingleEvent(hc, EVENT_MSET, nil, 0, tp, tp, 0)
end
end
tct = tct + 1
end
if ct > 0 then
local hc = Scl_Quantadrive.Summon_Limit[tct]
if not hc then
_, hc = Scl.SelectCards("NormalSummon/Set",tp,s.normal_summon_filter,tp,"Hand,MonsterZone",0,1,1,nil)
end
local sum_buff = Scl_Quantadrive.Summon_Buff[tct] or aux.TRUE
sum_buff(hc, e,tp,eg,ep,ev,re,r,rp)
if hc then
hc:RegisterFlagEffect(id + 100, RESETS_WITHOUT_TO_FIELD_SCL, 0, 1, hc:GetFieldID())
Scl.NormalSummon(hc, tp, true, nil)
end
end
Scl_Quantadrive.Summon = 0
Scl_Quantadrive.Summon_Limit = { }
Scl_Quantadrive.Summon_Buff = { }
end
function s.nerve_op(op)
return function(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp)
if Scl_Quantadrive.NerveContact_Forbbiden or Scl_Quantadrive.NerveContact_Forbbiden2 then
s.summon_op(e,tp,eg,ep,ev,re,r,rp)
return
end
Scl_Quantadrive.NerveContact_Forbbiden = true
local arr = { Duel.IsPlayerAffectedByEffect(tp, 10130014) }
if #arr == 0 then
Scl_Quantadrive.NerveContact_Forbbiden = false
s.summon_op(e,tp,eg,ep,ev,re,r,rp)
return
end
local ae = arr[1]
local ac = ae:GetHandler()
if not ae:CheckCountLimit(tp) or ac:GetFlagEffect(1) == 0 then
Scl_Quantadrive.NerveContact_Forbbiden = false
s.summon_op(e,tp,eg,ep,ev,re,r,rp)
return
end
Scl.Mandatory_Effect_Target_Check = true
local g = Duel.GetMatchingGroup(s.nerve_filter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp,eg,ep,ev,re,r,rp)
Scl.Mandatory_Effect_Target_Check = false
if #g == 0 then
Scl_Quantadrive.NerveContact_Forbbiden = false
s.summon_op(e,tp,eg,ep,ev,re,r,rp)
return
end
if not Duel.SelectEffectYesNo(tp, ac, aux.Stringid(10130014, 0)) then
Scl_Quantadrive.NerveContact_Forbbiden = false
s.summon_op(e,tp,eg,ep,ev,re,r,rp)
return
end
Scl.HintCard(10130014)
local ct,og,tc = Scl.SelectAndOperateCardsFromGroup("Look",g,tp,aux.TRUE,1,1,nil)()
if not tc then
Scl_Quantadrive.NerveContact_Forbbiden = false
s.summon_op(e,tp,eg,ep,ev,re,r,rp)
return
end
Duel.RegisterFlagEffect(tp,tc:GetOriginalCode(),RESET_EP_SCL,0,1)
ae:UseCountLimit(tp, 1)
local eft_arr = tc.Scl_Quantadrive_Effects
local desc_arr = { }
local eft_arr2 = { }
Scl.Mandatory_Effect_Target_Check = true
for _, ae in pairs(eft_arr) do
local tg = ae:GetTarget() or aux.TRUE
if tg(e,tp,eg,ep,ev,re,r,rp,0) then
table.insert(desc_arr, ae:GetDescription())
table.insert(eft_arr2, ae)
end
end
Scl.Mandatory_Effect_Target_Check = false
Scl.HintSelect(tp, {10130014, 1})
local opt = Duel.SelectOption(tp, table.unpack(desc_arr)) + 1
local exop = eft_arr2[opt]:GetOperation() or aux.TRUE
exop(e,tp,eg,ep,ev,re,r,rp)
Scl_Quantadrive.NerveContact_Forbbiden = false
--s.summon_op(e,tp,eg,ep,ev,re,r,rp)
end
end
-------------------------------
if s then
-------------------------------
function s.initial_effect(c)
local e1 = Scl_Quantadrive.FilpEffect(c, s, id, "SetCard", "SetCard", { "~Target", "SetCard", s.setfilter, "GY" }, s.setop)
local e2 = Scl_Quantadrive.NormalSummonEffect(c, s, id, "BeFlippedFaceup")
Scl_Quantadrive.CreateNerveContact(s, e1, e2)
end
function s.setfilter(c,e,tp)
if c:IsType(TYPE_MONSTER) then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
else
return c:IsSSetable()
end
end
function s.setop(e,tp)
Scl.SelectAndOperateCards("SetCard",tp, aux.NecroValleyFilter(s.setfilter), tp, "GY", 0, 1, 1, nil,e,tp)()
end
-------------------------------
end
\ No newline at end of file
--量子驱动 β干扰机
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl_Quantadrive.FilpEffect(c, s, id, "NegateEffect", "NegateEffect", { "~Target", "NegateEffect", aux.NegateAnyFilter, 0, "OnField" }, s.negop)
local e2 = Scl_Quantadrive.NormalSummonEffect(c, s, id, "BeFlippedFaceup")
Scl_Quantadrive.CreateNerveContact(s, e1, e2)
end
function s.negop(e,tp)
Scl.SelectAndOperateCards("NegateEffect", tp, aux.NegateAnyFilter, tp, 0, "OnField", 1, 1, nil)(false, RESETS_EP_SCL)
end
\ No newline at end of file
--量子驱动 δ指令机
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl_Quantadrive.FilpEffect(c, s, id, "PlaceOnField", "PlaceOnField", { "~Target", "PlaceOnField", s.afilter, "Deck" }, s.aop)
local e2 = Scl.CreateQuickOptionalEffect(c, "FreeChain", "ChangePosition", {1, id}, "ChangePosition", nil, "Hand", nil, { "Cost", "Reveal", aux.NOT(Card.IsPublic) }, { "~Target", "ChangePosition", s.cpfilter, "MonsterZone" }, s.cpop)
Scl_Quantadrive.CreateNerveContact(s, e1, e2)
end
function s.afilter(c,e,tp)
--if you want to activate rather than place, then add the below filter, due to those spells/traps cannot activate during damage step, the filter will return false (like be filpped faceup because of a battle)
--c:GetActivateEffect():IsActivatable(tp, true, true)
return Scl.IsType(c, 0, TYPE_SPELL + TYPE_CONTINUOUS, TYPE_TRAP + TYPE_CONTINUOUS, TYPE_SPELL + TYPE_FIELD) and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE) > 0) and not c:IsForbidden() and c:IsSetCard(0xa336)
end
function s.aop(e,tp)
Scl.SelectAndOperateCards("PlaceOnField",tp,s.afilter,tp, "Deck",0,1,1,nil,e,tp)()
end
function s.cpfilter(c)
return c:IsFacedown() and c:IsCanChangePosition() and c:IsSetCard(0xa336)
end
function s.cpop(e,tp)
Scl.SelectAndOperateCards("Change2FaceupDefensePosition",tp,s.cpfilter,tp,"MonsterZone",0,1,1,nil)()
end
\ No newline at end of file
--量子驱动 ε装载机
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl_Quantadrive.FilpEffect(c, s, id, "AddFromDeck2Hand", "AddFromDeck2Hand", { "~Target", "AddFromDeck2Hand", s.thfilter, "Deck" }, s.thop)
local e2 = Scl.CreateQuickOptionalEffect(c, "FreeChain", "ChangePosition", {1, id}, "ChangePosition", nil, "Hand", nil, { "Cost", "Reveal", aux.NOT(Card.IsPublic) }, { "~Target", "ChangePosition", s.cpfilter, "MonsterZone" }, s.cpop)
Scl_Quantadrive.CreateNerveContact(s, e1, e2)
end
function s.thfilter(c)
return c:IsSetCard(0xa336) and c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsAbleToHand()
end
function s.thop(e,tp)
Scl.SelectAndOperateCards("AddFromDeck2Hand",tp,s.thfilter,tp, "Deck",0,1,1,nil)()
end
function s.cpfilter(c)
return c:IsFacedown() and c:IsCanChangePosition() and c:IsSetCard(0xa336)
end
function s.cpop(e,tp)
Scl.SelectAndOperateCards("Change2FaceupDefensePosition",tp,s.cpfilter,tp,"MonsterZone",0,1,1,nil)()
end
\ No newline at end of file
--量子驱动 ζ强击机
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl_Quantadrive.FilpEffect(c, s, id, "Destroy", "Destroy", { "~Target", "Destroy", aux.TRUE, 0, "MonsterZone" }, s.desop)
local e2 = Scl_Quantadrive.NormalSummonEffect(c, s, id, "BeSet")
Scl_Quantadrive.CreateNerveContact(s, e1, e2)
end
function s.desop(e,tp)
Scl.SelectAndOperateCards("Destroy",tp,aux.TRUE,tp,0,"MonsterZone",1,1,nil)()
end
\ No newline at end of file
--量子驱动 η侦查机
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl_Quantadrive.FilpEffect(c, s, id, "Banish", "Banish", { "~Target", "Banish", Card.IsAbleToRemove, 0, "Hand" }, s.rmop)
local e2 = Scl_Quantadrive.NormalSummonEffect(c, s, id, "BeSet")
Scl_Quantadrive.CreateNerveContact(s, e1, e2)
end
function s.rmop(e,tp)
local g = Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if #g == 0 then return end
Duel.ConfirmCards(tp,g)
local rg = g:Filter(Card.IsAbleToRemove,nil)
if #rg == 0 then return end
local rg2 = rg:RandomSelect(tp,1)
Scl.Banish(rg2,POS_FACEUP,REASON_EFFECT + REASON_TEMPORARY,1,2,PHASE_END)
Duel.ShuffleHand(1-tp)
end
\ No newline at end of file
--量子驱动-快装车间
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateFieldTriggerMandatoryEffect(c, "BeSet,BeFlippedFaceup", "Draw", nil, "Draw,ShuffleIn2Deck,AddFromDeck2Hand", nil, "Spell&TrapZone", s.drcon, nil, s.drtg, s.drop)
end
function s.dcfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function s.drcon(e,tp,eg)
return eg:IsExists(s.dcfilter, 1, nil,tp)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then
return true
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function s.drop(e,tp,eg)
--Scl_Quantadrive.Shuffle(tp)
if Duel.Draw(tp,1,REASON_EFFECT) == 0 or Scl.SelectAndOperateCards("ShuffleIn2Deck",tp,Card.IsAbleToDeck,tp,"Hand",0,1,1,nil)() == 0 or not Scl.IsCorrectlyOperated("Deck") or Duel.GetFlagEffect(tp, id) > 0 then
return
end
local tg = eg:Filter(s.cfilter,nil,tp)
if #tg > 0 and Scl.SelectYesNo(tp, {id, 0}) then
Duel.RegisterFlagEffect(tp, id, RESET_EP_SCL, 0, 1)
local tc = tg:GetFirst()
if #tg > 1 then
_,_,tc = Scl.SelectAndOperateCardsFromGroup("Look",tg,tp,aux.TRUE,1,1,nil)()
end
Scl.SelectAndOperateCards("Add2Hand",tp,s.thfilter,tp,"Deck",0,1,1,nil,tc:GetCode())()
end
end
function s.cfilter(c,tp)
return c:IsSetCard(0xa336) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function s.thfilter(c,code)
return c:IsSetCard(0xa336) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(code)
end
\ No newline at end of file
--量子驱动-广防力场
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateFieldBuffEffect(c, "UnaffectedByOpponentsActivatedEffects", 1, s.tg, { "MonsterZone", 0 }, "Spell&TrapZone",nil , nil, nil, nil, "SetAvailable")
local e3 = Scl.CreateFieldTriggerMandatoryEffect(c, "AtStartOfBP", "ChangePosition", 1, "ChangePosition", nil, "Spell&TrapZone", scl.cond_check_tp(1), nil, { "~Target", "ChangePosition", s.pfilter, "MonsterZone", 0, true }, s.cpop)
local e4,e5 = Scl.CreateFieldTriggerContinousEffect(c, "BeSet,BeFlippedFaceup", nil, nil, nil, "Spell&TrapZone", s.acon, s.aop)
end
function s.tg(e,c)
return c:IsSetCard(0xa336) or c:IsFacedown()
end
function s.pfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and c:IsSetCard(0xa336)
end
function s.cpop(e,tp)
local g = Duel.GetMatchingGroup(s.pfilter,tp,LOCATION_MZONE,0,nil)
if #g > 0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
function s.acfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function s.acon(e,tp,eg)
return eg:IsExists(s.acfilter, 1, nil,tp)
end
function s.aop(e,tp)
--Scl_Quantadrive.Shuffle(tp)
local c = e:GetHandler()
Scl.HintCard(id)
if not s.buff then
s.buff = 1
Scl.CreateFieldBuffEffect({c,tp},"+DEF",s.val,aux.TargetBoolFunction(Card.IsSetCard,0xa336),{"MonsterZone",0})
else
s.buff = s.buff + 1
end
c:SetHint(CHINT_NUMBER, s.buff)
end
function s.val(e,c)
return s.buff * 200
end
\ No newline at end of file
--量子驱动 渗透者Σ
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
Scl.SetSummonCondition(c, false, aux.FALSE)
local e1 = Scl.CreateSingleBuffEffect(c, "MaterialCheck", s.cpval, "AnyZone", nil, nil, nil, nil, "SetAvailable")
local e2 = Scl.CreateQuickOptionalEffect(c, "FreeChain", "Return2Hand", nil, "Return2Hand", "SetAvailable", "MonsterZone", nil, s.rtcost, { "~Target", "Return2Hand", Card.IsAbleToHand, 0, "OnField"}, s.rtop)
Scl_Quantadrive.CreateNerveContact(s, e2)
end
function s.cfilter(c)
return c:IsSetCard(0xa336) and Scl.IsType(c,0,"Monster,Flip") and c.Scl_Quantadrive_Filp_Effect
end
function s.cpval(e,c)
local mat = c:GetMaterial():Filter(s.cfilter,nil)
for tc in aux.Next(mat) do
local ce = tc.Scl_Quantadrive_Filp_Effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetDescription(ce:GetDescription())
e1:SetCategory(ce:GetCategory())
e1:SetTarget(ce:GetTarget())
e1:SetOperation(ce:GetOperation())
c:RegisterEffect(e1,true)
end
end
function s.rtcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk==0 then return c:IsFacedown() end
local pos = Duel.SelectPosition(tp, c, POS_FACEUP)
Duel.ChangePosition(c,pos)
end
function s.rtop(e,tp)
local _, c = Scl.GetActivateCard()
if c and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and c:IsAbleToHand() and Scl.SelectYesNo(tp, {id, 0}) then
Scl.Send2Hand(c, nil, REASON_EFFECT, true)
end
Scl.SelectAndOperateCards("Return2Hand",tp,Card.IsAbleToHand,tp,0,"OnField",1,1,nil)()
end
\ No newline at end of file
--量子驱动 破坏王Υ
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
Scl.SetSummonCondition(c, false, aux.FALSE)
local e1 = Scl.CreateSingleTriggerContinousEffect(c, "BeNormalSet", nil, nil, "SetAvailable,!NegateEffect,Uncopyable", s.cpcon, s.cpop)
local e2 = Scl.CreateQuickOptionalEffect(c, "FreeChain", "NegateEffect", nil, "NegateEffect,Return2Hand", "SetAvailable", "MonsterZone", nil, s.negcost, nil, s.negop)
Scl_Quantadrive.CreateNerveContact(s, e2)
end
function s.cpcon(e,tp)
local c = e:GetHandler()
local mat = c:GetMaterial()
return mat:IsExists(s.cfilter,1,nil)
end
function s.cfilter(c)
return c:IsSetCard(0xa336) and Scl.IsType(c,0,"Monster,Flip,Effect") and c:IsReason(REASON_RELEASE) and c.Scl_Quantadrive_Filp_Effect
end
function s.cpop(e,tp)
local c = e:GetHandler()
local mat = c:GetMaterial():Filter(s.cfilter,nil)
for tc in aux.Next(mat) do
local ce = tc.Scl_Quantadrive_Filp_Effect
Scl.CloneEffect({c,c,true}, ce, "Reset", RESETS_SCL)
end
end
function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk==0 then return c:IsFacedown() end
local pos = Duel.SelectPosition(tp, c, POS_FACEUP)
Duel.ChangePosition(c,pos)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local c0,c = Scl.GetActivateCard()
if c and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and c:IsAbleToHand() and Scl.SelectYesNo(tp, {id,0}) then
Scl.Send2Hand(c, nil, REASON_EFFECT, true)
end
--negate
local e1=Effect.CreateEffect(c0)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(s.negcon2)
e1:SetOperation(s.negop2)
Duel.RegisterEffect(e1,tp)
end
function s.negcon2(e,tp,eg,ep,ev,re,r,rp)
return rp ~= tp
end
function s.negop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.NegateEffect(ev,true)
end
\ No newline at end of file
--量子驱动-指挥中心
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreateQuickOptionalEffect(c, "FreeChain", "ChangePosition", {1, id}, "ChangePosition", nil, "Spell&TrapZone", nil, nil, { "~Target", "ChangePosition", s.pfilter, "MonsterZone" }, s.pop)
local e3 = Scl.CreateFieldBuffEffect(c, "AttackInDefensePosition", 1, aux.TargetBoolFunction(Card.IsSetCard, 0xa336), {"MonsterZone", 0}, "Spell&TrapZone")
--local e4 = Scl.CreateFieldTriggerMandatoryEffect(c, "BeFlippedFaceup", nil, "Damage", "PlayerTarget", "Spell&TrapZone", s.damcon, nil, {"PlayerTarget", "Damage", 0, 800}, s.damop)
end
function s.pfilter(c)
return c:IsSetCard(0xa336) and c:IsCanChangePosition()
end
function s.pop(e,tp)
local _,tc = Scl.SelectCards("ChangePosition",tp,s.pfilter,tp,"MonsterZone",0,1,1,nil)
if not tc then return end
local pos = Duel.SelectPosition(tp,tc,POS_FACEUP+POS_FACEDOWN_DEFENSE - tc:GetPosition())
Duel.ChangePosition(tc, pos)
end
function s.damcon(e,tp,eg)
return eg:IsExists(Card.IsControler, 1, nil, tp)
end
function s.damop(e,tp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
--量子驱动 后勤工蜂群
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1,e2 = Scl.CreateSingleTriggerOptionalEffect(c, "BeNormalSummoned,BeFlippedFaceup", "NormalSummon/Set", {1,id}, "NormalSummon/Set",nil,nil,nil,{ "~Target", "NormalSummon/Set",s.sumfilter,"Hand,MonsterZone" },s.sumop)
Scl_Quantadrive.CreateNerveContact(s, e1)
end
function s.sumfilter(c)
return c:IsSetCard(0xa336) and (c:IsSummonable(true, nil) or c:IsMSetable(true, nil))
end
function s.sumop(e,tp)
Scl_Quantadrive.Summon = Scl_Quantadrive.Summon + 1
Scl_Quantadrive.Summon_Buff[Scl_Quantadrive.Summon] = s.sumop2
end
function s.sumop2(hc, e,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_MSET)
e1:SetReset(RESET_EP_SCL)
e1:SetOperation(s.buff)
e1:SetLabel(hc:GetFieldID())
e1:SetLabelObject(hc)
Duel.RegisterEffect(e1,tp)
end
function s.buff(e, tp, eg)
local tc = e:GetLabelObject()
if tc and eg:IsContains(tc) and tc:GetFlagEffect(10130101) > 0 and tc:GetFlagEffectLabel(10130101) == e:GetLabel() then
local e1 = Scl.CreateIgnitionEffect({tc,tc,true}, "ChangePosition", nil, "ChangePosition", "SetAvailable", "MonsterZone", nil, s.cpcost, { "~Target", "ChangePosition", s.cpfilter,"MonsterZone" }, s.cpop, RESETS_SCL)
end
e:Reset()
end
function s.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk==0 then return c:IsFacedown() end
local pos = Duel.SelectPosition(tp, c, POS_FACEUP)
Duel.ChangePosition(c,pos)
end
function s.cpfilter(c)
return c:IsCanChangePosition()
end
function s.cpop(e,tp)
local _,tc = Scl.SelectCards("ChangePosition",tp,s.cpfilter,tp,"MonsterZone",0,1,1,nil)
if not tc then return end
local pos = Duel.SelectPosition(tp,tc,POS_FACEUP+POS_FACEDOWN_DEFENSE - tc:GetPosition())
Duel.ChangePosition(tc, pos)
end
\ No newline at end of file
--量子驱动 线程操作员
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,s.lfilter,1,1)
c:EnableReviveLimit()
local e1 = Scl.CreateIgnitionEffect(c, {id, 0}, {1, id}, "NormalSummon/Set", nil, "MonsterZone", nil, nil, s.tg, s.op)
local e2 = Scl.CreateFieldBuffEffect(c, "MustAttack", 1, nil, {0, "MonsterZone"}, "MonsterZone", s.setcon)
local e3 = Scl.CreatePlayerBuffEffect(c, "YouChooseAttackTargets4OpponentsAttacks", 1, nil, {0, 1}, "MonsterZone", s.setcon)
Scl_Quantadrive.CreateNerveContact(s, e1)
end
function s.lfilter(c)
return c:IsLinkRace(RACE_MACHINE) and c:IsSetCard(0xa336)
end
function s.cfilter(c,e,tp,eg,ep,ev,re,r,rp)
local fe = c.Scl_Quantadrive_Filp_Effect
if not fe then return false end
local tg = fe:GetTarget() or aux.TRUE
return not c:IsPublic() and c:IsSetCard(0xa336) and tg(e,tp,eg,ep,ev,re,r,rp,0)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then
Scl.Mandatory_Effect_Target_Check = true
local res = e:IsCostChecked() and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
Scl.Mandatory_Effect_Target_Check = false
return res
end
Scl.Mandatory_Effect_Target_Check = true
local ct, og, tc = Scl.SelectAndOperateCards("Reveal", tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, nil,e,tp,eg,ep,ev,re,r,rp)()
Scl.Mandatory_Effect_Target_Check = false
local fe = tc.Scl_Quantadrive_Filp_Effect
Duel.SetTargetCard(tc)
Duel.ClearOperationInfo(0)
e:SetProperty(fe:GetProperty())
local tg = fe:GetTarget()
if tg then
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
end
function s.op(e,tp)
local tc = Duel.GetFirstTarget()
local fe = tc.Scl_Quantadrive_Filp_Effect
local op = fe:GetOperation()
Scl_Quantadrive.NerveContact_Forbbiden2 = true
op(e,tp)
Scl_Quantadrive.NerveContact_Forbbiden2 = false
if tc:IsRelateToEffect(e) and (tc:IsSummonable(true, nil) or tc:IsMSetable(true, nil)) and Scl.SelectYesNo(tp, "NormalSummon/Set") then
Duel.BreakEffect()
Scl_Quantadrive.Summon = Scl_Quantadrive.Summon + 1
Scl_Quantadrive.Summon_Limit[Scl_Quantadrive.Summon] = tc
--Scl.NormalSummon(tc, tp, true, nil)
end
end
function s.setcon(e,tp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
--量子驱动-中枢神经网络
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local s,id = GetID()
function s.initial_effect(c)
local e1 = Scl.CreateActivateEffect(c)
local e2 = Scl.CreatePlayerBuffEffect(c, id, 1, nil, {1, 0}, "FieldZone", nil, nil, nil, 1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_FZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
end
--余火
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m,cm=rscf.DefineCard(10171001)
if rsds then return end
rsds=cm
function rsds.cost1(e,...)
e:SetLabel(100)
return rscost.cost(Card.IsReleasable,"res")(e,...)
end
function cm.costfun(e,tp)
e:SetValue(100)
end
function rsds.cost2(ct)
return function(e,...)
e:SetLabel(100)
return rscost.cost(cm.rmcfilter,"rm",LOCATION_GRAVE,LOCATION_GRAVE,ct,ct)(e,...)
end
end
function cm.rmcfilter(c,e,tp)
if not c:IsAbleToRemoveAsCost() or not c:IsType(TYPE_MONSTER) then return false end
return (c:IsCode(m) and c:IsControler(tp)) or (Duel.IsPlayerAffectedByEffect(tp,m+19) and not c:IsCode(e:GetHandler():GetCode()))
end
function rsds.SearchFun(c,scode,op)
local e1=rsef.STO(c,EVENT_SUMMON_SUCCESS,{m,0},nil,"se,th","de,dsp",nil,rsds.cost2(1),rsop.target(cm.thfilter(scode),"th",LOCATION_DECK),cm.thop(scode,op))
local e2=rsef.RegisterClone(c,e1,"code",EVENT_SPSUMMON_SUCCESS)
return e1,e2
end
function cm.thfilter(scode)
return function(c)
return c:IsCode(scode) and c:IsAbleToHand()
end
end
function cm.thop(scode,op)
return function(e,tp,...)
local ct,og,tc=rsop.SelectToHand(tp,cm.thfilter(scode),tp,LOCATION_DECK,0,1,1,nil,{})
if ct>0 and op then
op(tc,e,tp,...)
end
end
end
function rsds.ChainingFun(c,code,cate,flag,tg,op)
local e1=rsef.QO(c,EVENT_CHAINING,{code,0},1,cate,flag,LOCATION_MZONE,cm.cfcon,nil,tg,op)
return e1
end
function cm.cfcon(e,tp,eg,ep,ev,re,r,rp)
for i=1,ev do
local te,tep,tecode1,tecode2,teloc=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2,CHAININFO_TRIGGERING_LOCATION )
if tep==tp and (tecode1==m or (tecode2 and tecode2==m)) and teloc&LOCATION_HAND+LOCATION_ONFIELD ~=0 then
return true
end
end
return false
end
function rsds.ExtraSummonFun(c,code)
local e1=rscf.SetSummonCondition(c,false,cm.exsumval(code))
return e1
end
function cm.exsumval(code,excode)
return function(e,se,sp,st)
--if not e:GetHandler():IsLocation(LOCATION_EXTRA) then return true end
return se and se:GetHandler():IsCode(code,excode or 0)
end
end
function rsds.TributeFun(c,code,cate,flag,tg,op,isign)
local e1=rsef.QO(c,nil,{code,0},{1,code},cate,flag,LOCATION_HAND,nil,rsds.cost1,tg,op)
if isign then e1:SetType(EFFECT_TYPE_IGNITION) end
return e1
end
function rsds.SpExtraFun(c,code,rmcode,spcode,con,ct)
ct=ct or 1
local e1=rsef.QO(c,nil,{code,1},{1,code+100},"sp",nil,LOCATION_GRAVE,con,rscost.reglabel(100),cm.spetg(rmcode,spcode,ct),cm.speop(spcode))
return e1
end
function cm.spefilter(c,e,tp,spcode)
return c:IsCode(spcode) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sprmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and c:IsSetCard(0xa335)
end
function cm.specfilter(c,rmcode)
return c:IsCode(rmcode) and c:IsAbleToRemoveAsCost()
end
function cm.spgfilter(g,rmcode)
return g:IsExists(Card.IsCode,1,nil,rmcode)
end
function cm.spetg(rmcode,spcode,ct)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.spefilter,tp,LOCATION_EXTRA,0,nil,e,tp,spcode)
local rg=Duel.GetMatchingGroup(cm.sprmfilter,tp,LOCATION_GRAVE,0,c)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_FUSION)
if chk==0 then
if e:GetLabel()==100 then
return c:IsAbleToRemoveAsCost() and rg:IsExists(Card.IsCode,1,nil,rmcode) and #g>0
else
return #g>0 and ct==1
end
end
local sct=math.min(ct,#g)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then sct=1 end
if c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp] then sct=math.min(c29724053[tp],sct) end
sct=math.min(sct,ft)
local sct2=0
if e:GetLabel()==100 then
e:SetLabel(0)
rshint.Select(tp,"rm")
local rg2=rg:SelectSubGroup(tp,cm.spgfilter,false,1,sct,rmcode)
rg2:AddCard(c)
sct2=Duel.Remove(rg2,POS_FACEUP,REASON_COST)-1
end
e:SetValue(ct==1 and sct or sct2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,sct,tp,LOCATION_EXTRA)
end
end
function cm.speop(spcode)
return function(e,tp,...)
local sg=Duel.GetMatchingGroup(cm.spefilter,tp,LOCATION_EXTRA,0,nil,e,tp,spcode)
local sct=e:GetValue()
if sct<=0 or #sg<sct then return end
if sct>=2 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]<sct then return end
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_FUSION)
if ft<sct then return end
local ct,og=rsgf.SelectSpecialSummon(sg,tp,aux.TRUE,sct,sct,nil,{})
if #og>0 then
for tc in aux.Next(og) do
tc:CompleteProcedure()
end
end
end
end
-------------------------
function cm.initial_effect(c)
local e2=rsef.QO(c,nil,{m,2},nil,"sp",nil,LOCATION_HAND+LOCATION_MZONE,nil,rsds.cost1,rsop.target2(cm.resetfun,cm.spfilter,"sp",LOCATION_HAND),cm.spop)
local e3=rsef.QO(c,nil,{m,4},nil,"atk,def",nil,LOCATION_HAND+LOCATION_MZONE,nil,rsds.cost1,rsop.target2(cm.resetfun,cm.atkfilter,"dum",LOCATION_MZONE,LOCATION_MZONE),cm.atkop)
local e4=rsef.FTF(c,EVENT_LEAVE_FIELD,{m,0},nil,"th",nil,LOCATION_REMOVED,cm.embthcon,cm.embthcost,rsop.target(Card.IsAbleToHand,"th"),cm.embthop)
end
function cm.recop(e,tp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function cm.resetfun(g,e,tp)
e:SetLabel(0)
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xa335) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((e:GetLabel()==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (e:GetLabel()==100 and Duel.GetMZoneCount(tp,e:GetHandler(),tp)>0 and c~=e:GetHandler()))
end
function cm.spop(e,tp)
rsop.SelectSpecialSummon(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,{},e,tp)
end
function cm.rmfilter(c,e,tp)
return c:IsAbleToRemove() and c:IsFaceup() and (e:GetLabel()~=100 or c~=e:GetHandler())
end
function cm.rmop(e,tp)
local ct,og,tc=rsop.SelectRemove(tp,cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,{ POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY },e,tp)
if tc and tc:IsLocation(LOCATION_REMOVED) and Duel.ReturnToField(tc) then
local e1=rsef.SV_UPDATE({e:GetHandler(),tc},"atk",300,nil,rsreset.est,"cd")
end
end
function cm.atkfilter(c,e,tp)
return c:IsFaceup() and (e:GetLabel()~=100 or c~=e:GetHandler()) and c:IsSetCard(0xa335,0xc335)
end
function cm.atkop(e,tp)
local ct=rsop.SelectSolve(HINTMSG_FACEUP,tp,cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,aux.ExceptThisCard(e),cm.solvefun,e,tp)
end
function cm.solvefun(g,e,tp)
local tc=g:GetFirst()
local c=e:GetHandler()
local e1,e2=rscf.QuickBuff({c,tc},"atk+,def+",500,"rst",rsreset.est_pend)
tc:RegisterFlagEffect(m,rsreset.est_pend-RESET_LEAVE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,5))
local e3,e4=rsef.FV_CANNOT_DISABLE({c,tp},"neg,dise",cm.imval(tc),nil,nil,nil,rsreset.pend)
--local phase=Duel.GetCurrentPhase()
--if phase>PHASE_MAIN1 and phase<PHASE_MAIN2 then phase=PHASE_BATTLE end
--local e3=rsef.SV_IMMUNE_EFFECT({c,tc},rsval.imoe,cm.imcon(phase),rsreset.pend)
end
function cm.imval(tc)
return function(e,ev)
local te,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_LOCATION)
return tc:GetFlagEffect(m)>0 and loc&LOCATION_MZONE ~=0 and te:GetHandler()==tc
end
end
function cm.imcon(phase)
return function(e)
local cp=Duel.GetCurrentPhase()
if cp>PHASE_MAIN1 and cp<PHASE_MAIN2 then cp=PHASE_BATTLE end
return cp==phase
end
end
function cm.embthfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(0xa335,0xc335)
end
function cm.embthcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.embthfilter,1,nil)
end
function cm.embthcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentChain()==0 end
end
function cm.embthop(e,tp)
local c=aux.ExceptThisCard(e)
if c then Duel.SendtoHand(c,nil,REASON_EFFECT) end
end
--卡片读取士
--21.07.08
local m=11451550
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Check
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(cm.actarget)
e2:SetOperation(cm.checkop)
c:RegisterEffect(e2)
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
--continuously updating
local tab={90176467}
for _,code in pairs(tab) do
if te:GetHandler():GetOriginalCode()==code then return false end
end
return e:GetHandler():GetFlagEffect(m-1)==0
end
function cm.hook(f,args)
return function(...)
debug.sethook(function()
local fun=debug.getinfo(2).name
if fun=="IsCodeListed" or fun=="IsMaterialListCode" then
local k,v=debug.getlocal(2,3)
if type(v)~="userdata" then
k,v=debug.getlocal(2,2)
if type(v)=="number" then
local chk=true
for i=1,20 do
local a,b=debug.getlocal(3,i)
if b and b==v then chk=false end
end
if chk then
for _,eid in pairs(args) do
if not cm[eid] or type(cm[eid])~="table" then cm[eid]={} end
table.insert(cm[eid],v)
end
end
end
end
else
local res=false
for i=1,20 do
local _,v=debug.getlocal(2,i)
if v==aux.IsCodeListed or v==aux.IsMaterialListCode then res=true end
end
if res==false then return end
for i=1,20 do
local _,v=debug.getlocal(2,i)
if type(v)=="number" then
for i=1,20 do
local a,b=debug.getlocal(2,i)
if a=="*temporary" and aux.GetValueType(b)=="Card" and (b:IsCode(v) or b:IsOriginalCodeRule(v) or b:GetOriginalCode()==v) then chk=false end
end
local chk=true
for i=1,20 do
local a,b=debug.getlocal(3,i)
if b and b==v then chk=false end
end
if chk then
for _,eid in pairs(args) do
if not cm[eid] or type(cm[eid])~="table" then cm[eid]={} end
table.insert(cm[eid],v)
end
end
end
end
end
end,"c")
f(...)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local eid=Duel.GetCurrentChain()+1
if not cm[te] or type(cm[te])~="table" then
local con=te:GetCondition() or 0
local cost=te:GetCost() or 0
local tg=te:GetTarget() or 0
local op=te:GetOperation() or 0
cm[te]={con,cost,tg,op,eid}
if con~=0 then te:SetCondition(cm.hook(con,{eid})) end
if cost~=0 then te:SetCost(cm.hook(cost,{eid})) end
if tg~=0 then te:SetTarget(cm.hook(tg,{eid})) end
if op~=0 then te:SetOperation(cm.hook(op,{eid})) end
else
table.insert(cm[te],eid)
local args={}
for i=5,#cm[te] do table.insert(args,cm[te][i]) end
if cm[te][1]~=0 then te:SetCondition(cm.hook(cm[te][1],args)) end
if cm[te][2]~=0 then te:SetCost(cm.hook(cm[te][2],args)) end
if cm[te][3]~=0 then te:SetTarget(cm.hook(cm[te][3],args)) end
if cm[te][4]~=0 then te:SetOperation(cm.hook(cm[te][4],args)) end
end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetLabel(eid)
e1:SetLabelObject(te)
e1:SetCondition(cm.rscon)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,e:GetHandlerPlayer())
local e2=e1:Clone()
e2:SetCondition(cm.rscon2)
e2:SetOperation(cm.rsop2)
Duel.RegisterEffect(e2,e:GetHandlerPlayer())
end
function cm.rscon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject() and Duel.GetCurrentChain()==e:GetLabel()
end
function cm.thfilter(c,list)
if not list or type(list)~="table" then return false end
for _,code in pairs(list) do
if type(code)=="number" and c:IsCode(code) then return true end
end
return false
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local eid=Duel.GetCurrentChain()
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil,cm[eid])
if e:GetHandler():GetFlagEffect(m)~=0 and e:GetHandler():GetFlagEffect(m-1)==0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
e:GetHandler():RegisterFlagEffect(m-1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
cm[eid]=0
end
function cm.rscon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.rsop2(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not cm[te] or type(cm[te])~="table" then return end
if cm[te][1]~=0 then te:SetCondition(cm[te][1]) end
if cm[te][2]~=0 then te:SetCost(cm[te][2]) end
if cm[te][3]~=0 then te:SetTarget(cm[te][3]) end
if cm[te][4]~=0 then te:SetOperation(cm[te][4]) end
cm[te]=0
end
\ No newline at end of file
--结合纹章士 琉迩
function c11875299.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,11875299)
e2:SetTarget(c11875299.thtg)
e2:SetOperation(c11875299.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--move
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(function(e)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 end)
e4:SetTarget(c11875299.mvtg)
e4:SetOperation(c11875299.mvop)
c:RegisterEffect(e4)
end
c11875299.SetCard_tt_FireEmblem=true
function c11875299.thfilter(c)
return c.SetCard_tt_FireEmblem and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c11875299.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11875299.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11875299.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11875299.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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c11875299.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c11875299.splimit(e,c)
return not c.SetCard_tt_FireEmblem
end
function c11875299.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local x=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)+Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return x>0 end
end
function c11875299.sckfil(c,seq)
return c:GetSequence()==seq
end
function c11875299.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)+Duel.GetLocationCount(tp,LOCATION_MZONE)
if c:IsRelateToEffect(e) and x>0 then
local filter=0
for seq=1,5 do
local seq=seq-1
if (Duel.GetMatchingGroupCount(c11875299.sckfil,tp,LOCATION_MZONE,0,nil,seq)==0 and not Duel.CheckLocation(tp,LOCATION_MZONE,seq)) or c:GetSequence()==seq then
if seq==0 then filter=bit.bor(filter,1) end
if seq==1 then filter=bit.bor(filter,2) end
if seq==2 then filter=bit.bor(filter,4) end
if seq==3 then filter=bit.bor(filter,8) end
if seq==4 then filter=bit.bor(filter,16) end
end
end
filter=bit.bor(filter,4194336)
filter=bit.bor(filter,2097216)
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,0,filter)
local seq=math.log(zone,2)
if Duel.IsExistingMatchingCard(c11875299.sckfil,tp,LOCATION_MZONE,0,1,nil,seq) then
local tc=Duel.GetFirstMatchingCard(c11875299.sckfil,tp,LOCATION_MZONE,0,nil,seq)
Duel.SwapSequence(c,tc)
else
Duel.MoveSequence(c,seq)
end
end
end
--火焰纹章士 马尔斯
function c11875300.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,11875300)
e2:SetTarget(c11875300.thtg)
e2:SetOperation(c11875300.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--place
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,21875300)
e4:SetCondition(c11875300.plcon)
e4:SetTarget(c11875300.pltg)
e4:SetOperation(c11875300.plop)
c:RegisterEffect(e4)
end
c11875300.SetCard_tt_FireEmblem=true
function c11875300.thfilter(c)
return c.SetCard_tt_FireEmblem and c:IsType(TYPE_MONSTER) and not c:IsCode(11875300) and c:IsAbleToHand()
end
function c11875300.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11875300.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11875300.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11875300.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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c11875300.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c11875300.splimit(e,c)
return not c.SetCard_tt_FireEmblem
end
function c11875300.plcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and c:IsCode(11875299) end,tp,LOCATION_MZONE,0,1,nil)
end
function c11875300.plfil(c)
return c:IsCode(11875306) and not c:IsForbidden()
end
function c11875300.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11875300.plfil,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)==0 end
end
function c11875300.plop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11875300.plfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)==0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
--选择纹章士 神威
function c11875301.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11875301,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11875301)
e2:SetCondition(function(e)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 end)
e2:SetTarget(c11875301.destg)
e2:SetOperation(c11875301.desop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(e,c)
return c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem and c:GetEquipGroup():IsContains(e:GetHandler()) end)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
c11875301.SetCard_tt_FireEmblem=true
function c11875301.desfil(c,e,tp)
return e:GetHandler():GetColumnGroup():IsContains(c)
end
function c11875301.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c11875301.desfil,tp,0,LOCATION_ONFIELD,nil,e,tp)
if chk==0 then return g:GetCount()>0 and e:GetHandler():GetFlagEffect(11875301)==0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c11875301.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11875301.desfil,tp,0,LOCATION_ONFIELD,nil,e,tp)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
if c:IsRelateToEffect(e) then
c:RegisterFlagEffect(11875301,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
end
end
--圣战纹章士 辛格尔德
function c11875302.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--neg
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,11875302)
e2:SetCondition(c11875302.negcon)
e2:SetTarget(c11875302.negtg)
e2:SetOperation(c11875302.negop)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(function(e,c)
return c.SetCard_tt_FireEmblem end)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
end
c11875302.SetCard_tt_FireEmblem=true
function c11875302.negcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
if ct<2 then return end
local te,p=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return te and te:GetHandler().SetCard_tt_FireEmblem and p==tp and rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c11875302.negtg(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)
end
function c11875302.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
--烈火纹章士 琳
function c11875303.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--des damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11875303,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_MOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11875303)
e2:SetCondition(c11875303.ddcon)
e2:SetTarget(c11875303.ddtg)
e2:SetOperation(c11875303.ddop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(e,c)
return c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem and c:GetEquipGroup():IsContains(e:GetHandler()) end)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
c11875303.SetCard_tt_FireEmblem=true
function c11875303.mckfil(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_ONFIELD)
end
function c11875303.ddcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11875303.mckfil,1,nil)
end
function c11875303.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c11875303.ddop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
local dg=g:Select(tp,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
Duel.Damage(1-tp,500,REASON_EFFECT)
end
end
--封印纹章士 罗伊
function c11875304.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_MOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11875304)
e2:SetCondition(c11875304.spcon)
e2:SetTarget(c11875304.sptg)
e2:SetOperation(c11875304.spop)
c:RegisterEffect(e2)
end
c11875304.SetCard_tt_FireEmblem=true
function c11875304.mckfil(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_ONFIELD)
end
function c11875304.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11875304.mckfil,1,nil)
end
function c11875304.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c.SetCard_tt_FireEmblem and not c:IsCode(11875304)
end
function c11875304.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11875304.spfil,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11875304.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11875304.spfil,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c11875304.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c11875304.splimit(e,c)
return not c.SetCard_tt_FireEmblem
end
--风花纹章士 贝鲁特
function c11875305.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,11875305)
e2:SetTarget(c11875305.sptg)
e2:SetOperation(c11875305.spop)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c11875305.mvtg)
e3:SetOperation(c11875305.mvop)
c:RegisterEffect(e3)
end
c11875305.SetCard_tt_FireEmblem=true
function c11875305.thfil(c,e,tp)
return c:IsAbleToHand() and c.SetCard_tt_FireEmblem and c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp,c)>0
end
function c11875305.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(c11875305.thfil,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,e,tp) end
local g=Duel.SelectTarget(tp,c11875305.thfil,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11875305.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(11875305,0)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c11875305.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local x=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)+Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return x>0 and Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) end
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
end
function c11875305.sckfil(c,seq)
return c:GetSequence()==seq
end
function c11875305.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local x=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)+Duel.GetLocationCount(tp,LOCATION_MZONE)
if tc:IsRelateToEffect(e) and x>0 then
local filter=0
for seq=1,5 do
local seq=seq-1
if (Duel.GetMatchingGroupCount(c11875305.sckfil,tp,LOCATION_MZONE,0,nil,seq)==0 and not Duel.CheckLocation(tp,LOCATION_MZONE,seq)) or tc:GetSequence()==seq then
if seq==0 then filter=bit.bor(filter,1) end
if seq==1 then filter=bit.bor(filter,2) end
if seq==2 then filter=bit.bor(filter,4) end
if seq==3 then filter=bit.bor(filter,8) end
if seq==4 then filter=bit.bor(filter,16) end
end
end
filter=bit.bor(filter,4194336)
filter=bit.bor(filter,2097216)
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,0,filter)
local seq=math.log(zone,2)
if Duel.IsExistingMatchingCard(c11875305.sckfil,tp,LOCATION_MZONE,0,1,nil,seq) then
local sc=Duel.GetFirstMatchingCard(c11875305.sckfil,tp,LOCATION_MZONE,0,nil,seq)
Duel.SwapSequence(tc,sc)
else
Duel.MoveSequence(tc,seq)
end
end
end
--纹章结合
function c11875306.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:SetTarget(c11875306.target)
e1:SetOperation(c11875306.activate)
c:RegisterEffect(e1)
--Equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11875306,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetTarget(c11875306.eqtg)
e2:SetOperation(c11875306.eqop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11875306,2))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetTarget(c11875306.sptg)
e3:SetOperation(c11875306.spop)
c:RegisterEffect(e3)
end
c11875306.SetCard_tt_FireEmblem=true
function c11875306.filter(c,e,tp)
return c:IsCode(11875299) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11875306.thfil(c)
return c:IsAbleToHand() and c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem
end
function c11875306.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c11875306.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c11875306.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c11875306.thfil,tp,LOCATION_DECK,0,1,nil)
if (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(11875306,0)) then
local op=2
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(11875306,2),aux.Stringid(11875306,3))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(11875306,2))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(11875306,3))+1
end
if op==1 then
local g=Duel.SelectMatchingCard(tp,c11875306.thfil,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
elseif op==0 then
local g=Duel.SelectMatchingCard(tp,c11875306.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c11875306.eqfil(c)
return c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem and not c:IsForbidden()
end
function c11875306.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(function(c) return c:IsFaceup() and c:IsCode(11875299) end,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c11875306.eqfil,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
local g=Duel.SelectTarget(tp,function(c) return c:IsFaceup() and c:IsCode(11875299) end,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c11875306.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(c11875306.eqfil,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,nil)
if tc:IsRelateToEffect(e) and g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
local ec=g:Select(tp,1,1,nil):GetFirst()
if not Duel.Equip(tp,ec,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(tc)
e1:SetValue(function(e,c)
return e:GetLabelObject()==c end)
ec:RegisterEffect(e1)
local atk=tc:GetBaseAttack()
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
ec:RegisterEffect(e2)
end
local def=tc:GetBaseDefense()
if def>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(def)
ec:RegisterEffect(e2)
end
end
end
function c11875306.spfil(c,e,tp)
return c.SetCard_tt_FireEmblem and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11875306.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11875306.spfil,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c11875306.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11875306.spfil,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
--纹章呼唤
function c11875307.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:SetCountLimit(1,11875307+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c11875307.condition)
e1:SetTarget(c11875307.target)
e1:SetOperation(c11875307.activate)
c:RegisterEffect(e1)
end
c11875307.SetCard_tt_FireEmblem=true
function c11875307.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(function(c) return c:IsFacedown() or not c.SetCard_tt_FireEmblem end,tp,LOCATION_MZONE,0,1,nil)
end
function c11875307.filter(c,e,tp)
return c.SetCard_tt_FireEmblem and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c11875307.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11875307.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11875307.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11875307.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c11875307.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c11875307.splimit(e,c)
return not c.SetCard_tt_FireEmblem
end
--纹章觉醒
function c11875308.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,11875308)
e1:SetTarget(c11875308.eqtg)
e1:SetOperation(c11875308.eqop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,11875308)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c11875308.sptg)
e2:SetOperation(c11875308.spop)
c:RegisterEffect(e2)
end
c11875308.SetCard_tt_FireEmblem=true
function c11875308.eqfil(c)
return c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem and not c:IsForbidden()
end
function c11875308.xeqfil(c,e,tp)
return c:IsFaceup() and c:IsCode(11875299) and Duel.IsExistingMatchingCard(c11875308.eqfil,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
function c11875308.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c11875308.xeqfil,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.SelectTarget(tp,c11875308.xeqfil,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
end
function c11875308.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(c11875308.eqfil,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,tc)
local x=Duel.GetLocationCount(tp,LOCATION_SZONE)
if tc:IsRelateToEffect(e) and g:GetCount()>0 and x>0 then
local xeg=g:Select(tp,1,x,nil)
local ec=xeg:GetFirst()
while ec do
if not Duel.Equip(tp,ec,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(tc)
e1:SetValue(function(e,c)
return e:GetLabelObject()==c end)
ec:RegisterEffect(e1)
local atk=tc:GetBaseAttack()
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
ec:RegisterEffect(e2)
end
local def=tc:GetBaseDefense()
if def>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(def)
ec:RegisterEffect(e2)
end
ec=xeg:GetNext()
end
end
end
function c11875308.spfil(c,e,tp)
return c:IsCode(11875299) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11875308.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11875308.spfil,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c11875308.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11875308.spfil,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--圣魔纹章士 伊弗列姆&艾瑞珂
function c11875310.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(function(e,c,sump,sumtype,sumpos,targetp,se)
return not c.SetCard_tt_FireEmblem and sumtype&SUMMON_TYPE_PENDULUM==SUMMON_TYPE_PENDULUM end)
c:RegisterEffect(e1)
--p_G
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11875310,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c11875310.pendcon)
e1:SetOperation(c11875310.pendop)
e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--to grave and sp
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,11875310)
e2:SetTarget(c11875310.tgsptg)
e2:SetOperation(c11875310.tgspop)
c:RegisterEffect(e2)
--place
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetTarget(c11875310.pentg)
e3:SetOperation(c11875310.penop)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CHAIN_NEGATED)
e3:SetRange(0xff)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCondition(c11875310.pencon)
e3:SetTarget(c11875310.pentg)
e3:SetOperation(c11875310.penop)
c:RegisterEffect(e3)
end
c11875310.SetCard_tt_FireEmblem=true
function c11875310.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
local bool=aux.PendulumSummonableBool(c)
return (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden()
and (aux.PendulumChecklist&(0x1<<tp)==0 or aux.PConditionExtraFilter(c,e,tp,lscale,rscale,eset)) and Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)==1
end
function c11875310.pendcon(e,c,og)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if aux.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end
local lscale=3
local rscale=5
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
if og then
return og:Filter(Card.IsLocation,nil,loc):IsExists(c11875310.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
else
return Duel.IsExistingMatchingCard(c11875310.PConditionFilter,tp,loc,0,1,nil,e,tp,lscale,rscale,eset)
end
end
function c11875310.pendop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local tp=e:GetHandlerPlayer()
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local lscale=3
local rscale=5
if lscale>rscale then lscale,rscale=rscale,lscale end
local tg=nil
local loc=0
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft=Duel.GetUsableMZoneCount(tp)
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(c11875310.PConditionFilter,nil,e,tp,lscale,rscale,eset)
else
tg=Duel.GetMatchingGroup(c11875310.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
end
local ce=nil
local b1=aux.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0
if b1 and b2 then
local options={1163}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
if op>0 then
ce=eset[op]
end
elseif b2 and not b1 then
local options={}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
ce=eset[op+1]
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:FilterSelect(tp,aux.PConditionExtraFilterSpecific,0,ft,nil,e,tp,lscale,rscale,ce)
if #g==0 then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:UseCountLimit(tp)
else
aux.PendulumChecklist=aux.PendulumChecklist|(0x1<<tp)
end
Duel.Hint(HINT_CARD,0,11875310)
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c))
end
function c11875310.tgfil(c)
return c:IsAbleToGrave() and c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem
end
function c11875310.tgsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11875310.tgfil,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11875310.tgspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11875310.tgfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c11875310.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re:GetHandler()==e:GetHandler()
end
function c11875310.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c11875310.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--回声纹章士 阿鲁姆
function c11875311.initial_effect(c)
--fusion
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,11875300,aux.FilterBoolFunction(function(c) return c.SetCard_tt_FireEmblem end),1,true,true)
aux.AddContactFusionProcedure(c,Card.IsReleasable,LOCATION_MZONE+LOCATION_HAND,0,Duel.Release,REASON_COST+REASON_MATERIAL)
--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(function(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION end)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11875311,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_MOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11875311)
e2:SetCondition(c11875311.tgcon)
e2:SetTarget(c11875311.tgtg)
e2:SetOperation(c11875311.tgop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(e,c)
return c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem and c:GetEquipGroup():IsContains(e:GetHandler()) end)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
c11875311.SetCard_tt_FireEmblem=true
function c11875311.mckfil(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_ONFIELD)
end
function c11875311.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11875311.mckfil,1,nil)
end
function c11875311.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c11875311.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c11875311.xtgcon)
e1:SetOperation(c11875311.xtgop)
Duel.RegisterEffect(e1,tp)
end
function c11875311.xtgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetTurnCount()~=e:GetLabel()
end
function c11875311.xtgop(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
if Duel.GetTurnPlayer()==tp and Duel.GetTurnCount()~=e:GetLabel() and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_CARD,0,11875311)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
--神龙姬 娜琪
function c11875312.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(function(c) return c.SetCard_tt_FireEmblem end),2,2)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(function(e,c)
return not e:GetHandler():GetColumnGroup():IsContains(c) end)
e1:SetValue(function(e,c)
return c==e:GetHandler() end)
c:RegisterEffect(e1)
--to hand and equip
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11875312)
e2:SetTarget(c11875312.thetg)
e2:SetOperation(c11875312.theop)
c:RegisterEffect(e2)
end
c11875312.SetCard_tt_FireEmblem=true
function c11875312.thfil(c)
return c:IsAbleToHand() and c:GetSequence()<5
end
function c11875312.xeqfil(c,e,tp)
return c:IsFaceup() and c.SetCard_tt_FireEmblem and Duel.IsExistingMatchingCard(c11875312.eqfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil)
end
function c11875312.eqfil(c)
return c:IsType(TYPE_MONSTER) and c.SetCard_tt_FireEmblem and not c:IsForbidden()
end
function c11875312.thetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c11875312.thfil,tp,LOCATION_SZONE,0,1,nil) and Duel.IsExistingMatchingCard(c11875312.xeqfil,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.SelectTarget(tp,c11875312.thfil,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c11875312.theop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT) and Duel.IsExistingMatchingCard(c11875312.xeqfil,tp,LOCATION_MZONE,0,1,nil,e,tp) then
local sc=Duel.SelectMatchingCard(tp,c11875312.xeqfil,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
local ec=Duel.SelectMatchingCard(tp,c11875312.eqfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if not Duel.Equip(tp,ec,sc) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(sc)
e1:SetValue(function(e,c)
return e:GetLabelObject()==c end)
ec:RegisterEffect(e1)
end
end
--向全体机凯种致以最崇高的敬意
local m=60000101
local cm=_G["c"..m]
cm.name="向全体机凯种致以最崇高的敬意"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.xxtg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
end
cm.named_with_ExMachina=true
function cm.cfilter(c)
return c:IsSetCard(0x6a0) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,cm.cfilter,1,1,REASON_COST,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.xxfilter(c)
return c:IsSetCard(0x6a0)
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0))
if not Duel.IsExistingMatchingCard(cm.xxfilter,tp,LOCATION_DECK,0,1,nil) then
e:SetLabel(1)
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
dg=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
--NGNL 机凯种 休比·多拉
local m=60000102
local cm=_G["c"..m]
cm.name="NGNL 机凯种 休比·多拉"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
--to hand
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetCondition(cm.thcon)
e5:SetTarget(cm.thtg)
e5:SetOperation(cm.thop)
c:RegisterEffect(e5)
end
cm.named_with_ExMachina=true
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x6a0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.thfilter(c)
return c.named_with_ExMachina and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.eqlimit(e,c)
return (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT)) or e:GetHandler():GetEquipTarget()==c
end
--NGNL 机凯伪典 焉龙啸
local m=60000103
local cm=_G["c"..m]
cm.name="NGNL 机凯伪典 焉龙啸"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.actg)
e1:SetOperation(cm.acop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.xxtg)
e3:SetOperation(cm.xxop)
c:RegisterEffect(e3)
end
cm.named_with_ExMachina=true
cm.named_with_WeiDian=true
function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) and Duel.GetTurnPlayer()~=tp then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
local sg=Duel.GetMatchingGroup(Card.IsAttackBelow,tp,0,LOCATION_MZONE,nil,2000)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,nil,Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_MZONE,nil),0,0)
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
local dg=Duel.GetMatchingGroup(Card.IsAttack,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0)
Duel.Destroy(dg,REASON_EFFECT)
end
function cm.xxfilter(c)
return c:IsSetCard(0x6a0)
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0))
if (not Duel.IsExistingMatchingCard(cm.xxfilter,tp,LOCATION_DECK,0,1,nil)) or (Duel.IsExistingMatchingCard(cm.mkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ttkfilter,tp,LOCATION_SZONE,0,1,nil)) then
e:SetLabel(1)
end
end
function cm.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
--NGNL 机凯伪典 天击
local m=60000104
local cm=_G["c"..m]
cm.name="NGNL 机凯伪典 天击"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_ATTACK,0x11e0)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.xxtg)
e3:SetOperation(cm.xxop)
c:RegisterEffect(e3)
end
cm.named_with_ExMachina=true
cm.named_with_WeiDian=true
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_RULE)
end
end
function cm.xxfilter(c)
return c:IsSetCard(0x6a0)
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0))
if (not Duel.IsExistingMatchingCard(cm.xxfilter,tp,LOCATION_DECK,0,1,nil)) or (Duel.IsExistingMatchingCard(cm.mkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ttkfilter,tp,LOCATION_SZONE,0,1,nil)) then
e:SetLabel(1)
end
end
function cm.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
\ No newline at end of file
--NGNL 机凯伪典 天移
local m=60000105
local cm=_G["c"..m]
cm.name="NGNL 机凯伪典 天移"
function cm.initial_effect(c)
--Negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.xxtg)
e3:SetOperation(cm.xxop)
c:RegisterEffect(e3)
end
cm.named_with_ExMachina=true
cm.named_with_WeiDian=true
function cm.cfilter(c)
return c:IsOnField() and c:IsType(TYPE_MONSTER)
end
function cm.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(cm.cfilter,nil)-tg:GetCount()>0
end
function cm.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 cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function cm.xxfilter(c)
return c:IsSetCard(0x6a0)
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0))
if (not Duel.IsExistingMatchingCard(cm.xxfilter,tp,LOCATION_DECK,0,1,nil)) or (Duel.IsExistingMatchingCard(cm.mkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ttkfilter,tp,LOCATION_SZONE,0,1,nil)) then
e:SetLabel(1)
end
end
function cm.desfilter1(c)
return Duel.IsExistingMatchingCard(nil,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function cm.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.desfilter1,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g1==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1)
g1:Merge(g2)
Duel.HintSelection(g1)
Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
end
end
--NGNL 机凯真典 Org.0000杀星者
local m=60000106
local cm=_G["c"..m]
cm.name="NGNL 机凯真典 Org.0000杀星者"
function cm.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(SUMMON_TYPE_XYZ)
e1:SetCondition(cm.sprcon)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
--actlimit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.actcon1)
e3:SetOperation(cm.actop)
c:RegisterEffect(e3)
end
cm.named_with_NGNL=true
cm.named_with_ExMachina=true
cm.named_with_ZhenDian=true
function cm.sprfilter(c,tp,g,sc)
local lv=c:GetLevel()
return c:IsFaceup() and lv==9 or c.named_with_WeiDian or c.named_with_ExMachina
end
function cm.spgckfil(g,e,tp)
return Duel.GetLocationCountFromEx(tp,tp,g,nil)
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_ONFIELD,0,nil)
return g:CheckSubGroup(cm.spgckfil,5,5,e,tp)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=g:SelectSubGroup(tp,cm.spgckfil,false,5,5,e,tp)
c:SetMaterial(g1)
Duel.Overlay(c,g1)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_ONFIELD)
end
function cm.ckfil(c)
return not c.named_with_NGNL
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()<=0 then return end
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
if not c:GetOverlayGroup():IsExists(cm.ckfil,1,nil) then
Duel.BreakEffect()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function cm.actcon(e)
local ph=Duel.GetCurrentPhase()
return (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) and not e:GetHandler():GetOverlayGroup():IsExists(cm.ckfil,1,nil)
end
function cm.actcon1(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler()==e:GetHandler() and not e:GetHandler():GetOverlayGroup():IsExists(cm.ckfil,1,nil)
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.SetChainLimit(cm.chainlm)
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
--NGNL 种族之棋 Ex-Machina
local m=60000112
local cm=_G["c"..m]
cm.name="NGNL 种族之棋 Ex-Machina"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m+10000000)
e3:SetTarget(cm.xxtg)
e3:SetOperation(cm.xxop)
c:RegisterEffect(e3)
end
cm.named_with_ExMachina=true
cm.named_with_Chess=true
function cm.thfilter(c)
return c.named_with_ExMachina and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function cm.atktg(e,c)
return c.named_with_ExMachina
end
function cm.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0))
if not Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x6a0) then
e:SetLabel(1)
end
end
function cm.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
Duel.SendtoHand(c,tp,REASON_EFFECT)
end
end
\ No newline at end of file
--NGNL 机凯种 休瓦尔扎
local m=60000113
local cm=_G["c"..m]
cm.name="NGNL 机凯种 休瓦尔扎"
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.mfilter,1)
c:EnableReviveLimit()
--avoid destruction
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
end
cm.named_with_ExMachina=true
function cm.mfilter(c)
return c:IsLevelBelow(4) and c:IsLinkRace(RACE_MACHINE)
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c.named_with_ExMachina and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--NGNL 机凯种 伊米露·爱因
local m=60000116
local cm=_G["c"..m]
cm.name="NGNL 机凯种 伊米露·爱因"
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.mfilter,2,2)
c:EnableReviveLimit()
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.sctg)
e2:SetOperation(cm.scop)
c:RegisterEffect(e2)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+10000000)
e2:SetTarget(cm.rmtg)
e2:SetOperation(cm.rmop)
c:RegisterEffect(e2)
end
cm.named_with_ExMachina=true
function cm.mfilter(c)
return c:IsLinkRace(RACE_MACHINE)
end
function cm.ckfil(c)
return not c:IsSetCard(0x6a0)
end
function cm.filter(c)
return c:IsAbleToDeck()
end
function cm.thfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,5,nil) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,5,5,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.scop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,Duel.GetFieldGroup(tp,LOCATION_DECK,0),Duel.GetFieldGroupCount(tp,LOCATION_DECK,0),tp,LOCATION_DECK)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
g:KeepAlive()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(g)
e1:SetOperation(cm.tdop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local g1=g:Filter(cm.ckfil,nil)
local tc1=g1:GetFirst()
while tc1 do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(cm.distg)
e1:SetLabelObject(tc1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(cm.discon)
e2:SetOperation(cm.disop)
e2:SetLabelObject(tc1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
tc1=g1:GetNext()
end
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
function cm.distg(e,c)
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--NGNL 机凯种 距离同步完成剩余251秒
local m=60000117
local cm=_G["c"..m]
cm.name="NGNL 机凯种 距离同步完成剩余251秒"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.xxtg)
e3:SetOperation(cm.xxop)
c:RegisterEffect(e3)
end
cm.named_with_ExMachina=true
function cm.filter(c)
return c.named_with_ExMachina and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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
function cm.xxfilter(c)
return c:IsSetCard(0x6a0)
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,Duel.GetFieldGroup(tp,LOCATION_DECK,0))
if (not Duel.IsExistingMatchingCard(cm.xxfilter,tp,LOCATION_DECK,0,1,nil)) or (Duel.IsExistingMatchingCard(cm.mkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ttkfilter,tp,LOCATION_SZONE,0,1,nil)) then
e:SetLabel(1)
end
end
function cm.filter2(c,e)
return c:IsFaceup() and c:IsSetCard(0x6a0) and not c:IsImmuneToEffect(e)
end
function cm.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 then
local sg=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_MZONE,0,nil,e)
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1000)
tc:RegisterEffect(e1)
tc=sg:GetNext()
end
end
end
--机凯伪典 终点天击
local m=60001095
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,160001095)
e2:SetCost(cm.descost)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
end
cm.named_with_ExMachina=true
cm.named_with_WeiDian=true
function cm.costrfilter(c)
return c:IsAbleToGraveAsCost() and c.named_with_ExMachina and not c:IsCode(m)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costrfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costrfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.tgrfilter(c)
return c:IsAbleToRemove() and c:IsType(TYPE_MONSTER) and c:IsAttackAbove(2000)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgrfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_MZONE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.tgrfilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function cm.namedfilter(c)
return c.named_with_ExMachina
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.ConfirmCards(1-tp,g)
if not (Duel.IsExistingMatchingCard(cm.namedfilter,tp,LOCATION_DECK,0,1,nil)) or (Duel.IsExistingMatchingCard(cm.mkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ttkfilter,tp,LOCATION_SZONE,0,1,nil)) then
e:SetLabel(1)
end
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetLabel()==1 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
end
function cm.opdfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(60000106) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.opxyzfilter(c)
return c:IsCanOverlay() and c.named_with_ExMachina
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 and Duel.IsExistingMatchingCard(cm.opdfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.opdfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) and c:IsRelateToEffect(e) and
Duel.IsExistingMatchingCard(cm.opxyzfilter,tp,LOCATION_GRAVE,0,1,nil) and c:IsCanOverlay() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local gg=Duel.SelectMatchingCard(tp,cm.opxyzfilter,tp,LOCATION_GRAVE,0,1,1,c)
if gg then
Duel.Overlay(tc,gg)
end
Duel.Overlay(tc,c)
end
end
end
\ No newline at end of file
--典开:极限模式
local m=60001096
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,160001096)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.descost)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
end
cm.named_with_WeiDian=true
function cm.tgfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c.named_with_ExMachina
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
tc:RegisterEffect(e3)
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
end
function cm.filter(c)
return c:IsFaceup()
end
function cm.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 cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local atk=tc:GetAttack()
local def=tc:GetDefense()
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 then
local lp=Duel.GetLP(1-tp)-(atk+def)/2
Duel.SetLP(1-tp,lp)
end
end
end
function cm.namedfilter(c)
return c.named_with_ExMachina
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.ConfirmCards(1-tp,g)
if not (Duel.IsExistingMatchingCard(cm.namedfilter,tp,LOCATION_DECK,0,1,nil)) or (Duel.IsExistingMatchingCard(cm.mkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ttkfilter,tp,LOCATION_SZONE,0,1,nil)) then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 and c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
\ No newline at end of file
--典开:极零模式
local m=60001097
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,160001097)
e2:SetCost(cm.descost)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
end
cm.named_with_WeiDian=true
function cm.tgfilter(c)
return c:IsFaceup() and c.named_with_ExMachina and c:IsType(TYPE_MONSTER)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(2000)
tc:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(cm.discon)
e4:SetCost(cm.discost)
e4:SetTarget(cm.distg)
e4:SetOperation(cm.disop)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and rp==1-tp
end
function cm.discost(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.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function cm.distg(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 cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function cm.namedfilter(c)
return c.named_with_ExMachina
end
function cm.mkfilter(c)
return c.named_with_ExMachina and c:IsType(TYPE_LINK) and c:IsAttackAbove(2500)
end
function cm.ttkfilter(c)
return c:IsCode(60000112)
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.ConfirmCards(1-tp,g)
if not (Duel.IsExistingMatchingCard(cm.namedfilter,tp,LOCATION_DECK,0,1,nil)) or (Duel.IsExistingMatchingCard(cm.mkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ttkfilter,tp,LOCATION_SZONE,0,1,nil)) then
e:SetLabel(1)
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==1 and c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
\ No newline at end of file
--机装重组
local m=60001098
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,160001098)
e2:SetCost(cm.descost)
e2:SetOperation(cm.immop)
c:RegisterEffect(e2)
end
cm.named_with_ExMachina=true
function cm.tgfilter(c,e,tp)
return c:IsFaceup() and c.named_with_ExMachina and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and
Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode()) and
(not (c:GetSequence()>4) or Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
end
function cm.spfilter(c,e,tp,code)
return c.named_with_ExMachina and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(code)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.namedfilter(c)
return c.named_with_ExMachina
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
Duel.ConfirmCards(1-tp,g)
if not Duel.IsExistingMatchingCard(cm.namedfilter,tp,LOCATION_DECK,0,1,nil) then
e:SetLabel(1)
end
end
function cm.immop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
local e5=Effect.CreateEffect(e:GetHandler())
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_DISEFFECT)
e5:SetValue(cm.effectfilter)
Duel.RegisterEffect(e5,tp)
end
end
function cm.effectfilter(e,ct)
local p=e:GetHandler():GetControler()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return p==tp and te:GetHandler().named_with_ExMachina and bit.band(loc,LOCATION_ONFIELD)~=0
end
\ No newline at end of file
--多元随风旅鸟×雪猫头鹰
local m=60002071
local cm=_G["c"..m]
cm.name="多元随风旅鸟×雪猫头鹰"
function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_HAND)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_DRAW_PHASE+TIMING_CHAIN_END+TIMING_END_PHASE)
e3:SetCost(cm.sumcost2)
e3:SetTarget(cm.sumtg2)
e3:SetOperation(cm.sumop2)
c:RegisterEffect(e3)
--normal summon/set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.sumcon)
e1:SetTarget(cm.sumtg)
e1:SetOperation(cm.sumop)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_PIERCE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(cm.sumcon)
c:RegisterEffect(e2)
--turn set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCondition(cm.poscon)
e3:SetCost(cm.poscost)
e3:SetTarget(cm.postg)
e3:SetOperation(cm.posop)
c:RegisterEffect(e3)
end
function cm.sumcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end
function cm.sumtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSummonable(false,nil) or e:GetHandler():IsMSetable(false,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,e:GetHandler(),1,0,0)
end
function cm.sumop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local s1=c:IsSummonable(false,nil)
local s2=c:IsMSetable(false,nil)
if (s1 and s2 and Duel.SelectPosition(tp,c,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,c,false,nil)
elseif s2 then
Duel.MSet(tp,c,false,nil)
end
end
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=0
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_SET_SUMMON_COUNT_LIMIT)}
for _,te in ipairs(ce) do
ct=math.max(ct,te:GetValue())
end
return ct<3
end
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(3)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function cm.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.posfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsFaceup() and c:IsCanTurnSet()
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.posfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
--虚饰之星渡使
function c67200810.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--maintain
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_PZONE)
e0:SetCode(EVENT_PHASE+PHASE_STANDBY)
e0:SetCountLimit(1)
e0:SetOperation(c67200810.desop)
c:RegisterEffect(e0)
--remove
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c67200810.rmcon)
e1:SetTarget(c67200810.rmtarget)
e1:SetTargetRange(0xff,0xff)
e1:SetValue(LOCATION_DECK)
c:RegisterEffect(e1)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200810,4))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c67200810.stcon)
e2:SetTarget(c67200810.sttg)
e2:SetOperation(c67200810.stop)
c:RegisterEffect(e2)
end
function c67200810.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and g3:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(67200810,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg3=g3:RandomSelect(tp,1)
sg:Merge(sg3)
Duel.SendtoGrave(sg,REASON_COST)
else Duel.Destroy(c,REASON_COST) end
end
--
function c67200810.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x67b)
end
function c67200810.rmcon(e)
return Duel.IsExistingMatchingCard(c67200810.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c67200810.rmtarget(e,c)
return not c:IsSetCard(0x67b)
end
--
function c67200810.stcon(e)
return e:GetHandler():GetFlagEffect(67200810)==0
end
function c67200810.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b2=Duel.GetLocationCount(tp,LOCATION_PZONE,0)
local b3=Duel.GetLocationCount(tp,LOCATION_PZONE,1)
if chk==0 then return b1>0 or (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
c:RegisterFlagEffect(67200810,RESET_CHAIN,0,1)
local off=1
local ops,opval={},{}
if b1>0 then
ops[off]=aux.Stringid(67200810,1)
opval[off]=0
off=off+1
end
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
ops[off]=aux.Stringid(67200810,2)
opval[off]=1
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
end
function c67200810.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if c:IsRelateToEffect(e) then
if sel==0 then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200810,5))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(c67200810.disop)
e1:SetTargetRange(1,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c67200810.pcfilter(c)
return c:IsSetCard(0x67b) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c67200810.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or not Duel.IsExistingMatchingCard(c67200810.pcfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) then return end
if Duel.GetFlagEffect(tp,67200810)==0 and Duel.SelectYesNo(tp,aux.Stringid(67200810,3)) then
Duel.RegisterFlagEffect(tp,67200810,RESET_PHASE+PHASE_END,0,1)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c67200810.repop)
end
end
function c67200810.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(1-tp,c67200810.pcfilter,tp,0,LOCATION_DECK+LOCATION_EXTRA,1,1,nil)
local g1=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
local g2=Duel.GetLocationCount(1-tp,LOCATION_PZONE,0)
local g3=Duel.GetLocationCount(1-tp,LOCATION_PZONE,1)
local opt=0
if g1>0 and ((Duel.CheckLocation(1-tp,LOCATION_PZONE,0) or Duel.CheckLocation(1-tp,LOCATION_PZONE,1))) then
opt=Duel.SelectOption(1-tp,aux.Stringid(67200810,1),aux.Stringid(67200810,2))
elseif g1>0 then
opt=Duel.SelectOption(1-tp,aux.Stringid(67200810,1))
elseif (Duel.CheckLocation(1-tp,LOCATION_PZONE,0) or Duel.CheckLocation(1-tp,LOCATION_PZONE,1)) then
opt=Duel.SelectOption(1-tp,aux.Stringid(67200810,2))+1
else return end
if opt==0 then
Duel.MoveToField(g:GetFirst(),1-tp,1-tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(g:GetFirst(),1-tp,1-tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--暴食之星渡使
function c67200812.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--maintain
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_PZONE)
e0:SetCode(EVENT_PHASE+PHASE_STANDBY)
e0:SetCountLimit(1)
e0:SetOperation(c67200812.desop)
c:RegisterEffect(e0)
--act limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(1,1)
e1:SetCondition(c67200812.limcon)
e1:SetValue(c67200812.limval)
c:RegisterEffect(e1)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200812,4))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c67200812.stcon)
e2:SetTarget(c67200812.sttg)
e2:SetOperation(c67200812.stop)
c:RegisterEffect(e2)
end
function c67200812.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and g3:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(67200812,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg3=g3:RandomSelect(tp,1)
sg:Merge(sg3)
Duel.SendtoGrave(sg,REASON_COST)
else Duel.Destroy(c,REASON_COST) end
end
--
function c67200812.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x67b)
end
function c67200812.limcon(e)
return Duel.IsExistingMatchingCard(c67200812.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c67200812.limval(e,re,rp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and not rc:IsSetCard(0x67b)
end
--
function c67200812.stcon(e)
return e:GetHandler():GetFlagEffect(67200812)==0
end
function c67200812.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b2=Duel.GetLocationCount(tp,LOCATION_PZONE,0)
local b3=Duel.GetLocationCount(tp,LOCATION_PZONE,1)
if chk==0 then return b1>0 or (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
c:RegisterFlagEffect(67200812,RESET_CHAIN,0,1)
local off=1
local ops,opval={},{}
if b1>0 then
ops[off]=aux.Stringid(67200812,1)
opval[off]=0
off=off+1
end
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
ops[off]=aux.Stringid(67200812,2)
opval[off]=1
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
end
function c67200812.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if c:IsRelateToEffect(e) then
if sel==0 then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200812,5))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(c67200812.disop)
e1:SetTargetRange(1,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
end
function c67200812.pcfilter(c)
return c:IsSetCard(0x67b) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c67200812.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(c67200812.pcfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) then return end
if Duel.GetFlagEffect(tp,67200812)==0 and Duel.SelectYesNo(tp,aux.Stringid(67200812,3)) then
Duel.RegisterFlagEffect(tp,67200812,RESET_PHASE+PHASE_END,0,1)
Duel.NegateSummon(eg)
if Duel.Destroy(eg,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c67200812.pcfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local g1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local opt=0
if g1>0 and ((Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))) then
opt=Duel.SelectOption(tp,aux.Stringid(67200812,1),aux.Stringid(67200812,2))
elseif g1>0 then
opt=Duel.SelectOption(tp,aux.Stringid(67200812,1))
elseif (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
opt=Duel.SelectOption(tp,aux.Stringid(67200812,2))+1
else return end
if opt==0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
end
--怠惰之星渡使
function c67200814.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--maintain
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_PZONE)
e0:SetCode(EVENT_PHASE+PHASE_STANDBY)
e0:SetCountLimit(1)
e0:SetOperation(c67200814.desop)
c:RegisterEffect(e0)
--act limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(1,1)
e1:SetCondition(c67200814.limcon)
e1:SetTarget(c67200814.sumlimit)
c:RegisterEffect(e1)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200814,4))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c67200814.stcon)
e2:SetTarget(c67200814.sttg)
e2:SetOperation(c67200814.stop)
c:RegisterEffect(e2)
end
function c67200814.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and g3:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(67200814,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg3=g3:RandomSelect(tp,1)
sg:Merge(sg3)
Duel.SendtoGrave(sg,REASON_COST)
else Duel.Destroy(c,REASON_COST) end
end
--
function c67200814.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x67b)
end
function c67200814.limcon(e)
return Duel.IsExistingMatchingCard(c67200814.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c67200814.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x67b)
end
--
function c67200814.stcon(e)
return e:GetHandler():GetFlagEffect(67200814)==0
end
function c67200814.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b2=Duel.GetLocationCount(tp,LOCATION_PZONE,0)
local b3=Duel.GetLocationCount(tp,LOCATION_PZONE,1)
if chk==0 then return b1>0 or (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
c:RegisterFlagEffect(67200814,RESET_CHAIN,0,1)
local off=1
local ops,opval={},{}
if b1>0 then
ops[off]=aux.Stringid(67200814,1)
opval[off]=0
off=off+1
end
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
ops[off]=aux.Stringid(67200814,2)
opval[off]=1
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
end
function c67200814.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if c:IsRelateToEffect(e) then
if sel==0 then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200814,5))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCondition(c67200814.discon)
e1:SetOperation(c67200814.disop)
e1:SetTargetRange(1,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c67200814.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c67200814.spcfilter,1,nil,tp)
end
function c67200814.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsSetCard(0x67b)
end
function c67200814.pcfilter(c)
return c:IsSetCard(0x67b) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c67200814.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(c67200814.pcfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) then return end
if Duel.GetFlagEffect(tp,67200814)==0 and Duel.SelectYesNo(tp,aux.Stringid(67200814,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c67200814.pcfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local g1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local opt=0
if g1>0 and ((Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))) then
opt=Duel.SelectOption(tp,aux.Stringid(67200814,1),aux.Stringid(67200814,2))
elseif g1>0 then
opt=Duel.SelectOption(tp,aux.Stringid(67200814,1))
elseif (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
opt=Duel.SelectOption(tp,aux.Stringid(67200814,2))+1
else return end
if opt==0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
--色欲之星渡使
function c67200816.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--maintain
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_PZONE)
e0:SetCode(EVENT_PHASE+PHASE_STANDBY)
e0:SetCountLimit(1)
e0:SetOperation(c67200816.desop)
c:RegisterEffect(e0)
--act limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_PZONE)
e4:SetTargetRange(1,1)
e4:SetCondition(c67200816.limcon)
e4:SetValue(c67200816.limval)
c:RegisterEffect(e4)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200816,4))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c67200816.stcon)
e2:SetTarget(c67200816.sttg)
e2:SetOperation(c67200816.stop)
c:RegisterEffect(e2)
end
function c67200816.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and g3:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(67200816,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg3=g3:RandomSelect(tp,1)
sg:Merge(sg3)
Duel.SendtoGrave(sg,REASON_COST)
else Duel.Destroy(c,REASON_COST) end
end
--
function c67200816.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x67b)
end
function c67200816.limcon(e)
return Duel.IsExistingMatchingCard(c67200816.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c67200816.limval(e,re,rp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_SPELL) and not rc:IsSetCard(0x67b)
end
--
function c67200816.stcon(e)
return e:GetHandler():GetFlagEffect(67200816)==0
end
function c67200816.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b2=Duel.GetLocationCount(tp,LOCATION_PZONE,0)
local b3=Duel.GetLocationCount(tp,LOCATION_PZONE,1)
if chk==0 then return b1>0 or (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
c:RegisterFlagEffect(67200816,RESET_CHAIN,0,1)
local off=1
local ops,opval={},{}
if b1>0 then
ops[off]=aux.Stringid(67200816,1)
opval[off]=0
off=off+1
end
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
ops[off]=aux.Stringid(67200816,2)
opval[off]=1
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
end
function c67200816.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if c:IsRelateToEffect(e) then
if sel==0 then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200816,5))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(c67200816.disop)
e1:SetTargetRange(1,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c67200816.pcfilter(c)
return c:IsSetCard(0x67b) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c67200816.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c67200816.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp)
if ep==tp then return end
if Duel.GetFlagEffect(tp,67200816)==0 and Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1
and Duel.GetUsableMZoneCount(tp)>=2
and g:CheckSubGroup(c67200816.fselect,2,2,tp) and Duel.SelectYesNo(tp,aux.Stringid(67200816,3)) then
Duel.RegisterFlagEffect(tp,67200816,RESET_PHASE+PHASE_END,0,1)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c67200816.repop)
end
end
--
function c67200816.spfilter(c,e,tp)
return c:IsLevelAbove(1) and c:IsSetCard(0x67b) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c67200816.fselect(g,tp)
return g:GetClassCount(Card.GetLocation)==g:GetCount() and g:GetClassCount(Card.GetLevel)==1
and Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,g,2,2)
end
function c67200816.repop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c67200816.spfilter),1-tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(1-tp,c67200816.fselect,false,2,2,tp)
if sg and sg:GetCount()==2 then
local tc1=sg:GetFirst()
local tc2=sg:GetNext()
Duel.SpecialSummonStep(tc1,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(tc2,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
Duel.AdjustAll()
--if sg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local xyzg=Duel.GetMatchingGroup(Card.IsXyzSummonable,1-tp,LOCATION_EXTRA,0,nil,sg,2,2)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(1-tp,1,1,nil):GetFirst()
Duel.XyzSummon(1-tp,xyz,sg)
end
end
end
--强欲之星渡使
function c67200818.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--maintain
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_PZONE)
e0:SetCode(EVENT_PHASE+PHASE_STANDBY)
e0:SetCountLimit(1)
e0:SetOperation(c67200818.desop)
c:RegisterEffect(e0)
--act limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_PZONE)
e4:SetTargetRange(1,1)
e4:SetCondition(c67200818.limcon)
e4:SetValue(c67200818.limval)
c:RegisterEffect(e4)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200818,4))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c67200818.stcon)
e2:SetTarget(c67200818.sttg)
e2:SetOperation(c67200818.stop)
c:RegisterEffect(e2)
end
function c67200818.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and g3:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(67200818,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg3=g3:RandomSelect(tp,1)
sg:Merge(sg3)
Duel.SendtoGrave(sg,REASON_COST)
else Duel.Destroy(c,REASON_COST) end
end
--
function c67200818.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x67b)
end
function c67200818.limcon(e)
return Duel.IsExistingMatchingCard(c67200818.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c67200818.limval(e,re,rp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_SPELL) and not rc:IsSetCard(0x67b)
end
--
function c67200818.stcon(e)
return e:GetHandler():GetFlagEffect(67200818)==0
end
function c67200818.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b2=Duel.GetLocationCount(tp,LOCATION_PZONE,0)
local b3=Duel.GetLocationCount(tp,LOCATION_PZONE,1)
if chk==0 then return b1>0 or (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
c:RegisterFlagEffect(67200818,RESET_CHAIN,0,1)
local off=1
local ops,opval={},{}
if b1>0 then
ops[off]=aux.Stringid(67200818,1)
opval[off]=0
off=off+1
end
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
ops[off]=aux.Stringid(67200818,2)
opval[off]=1
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
end
function c67200818.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if c:IsRelateToEffect(e) then
if sel==0 then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_MZONE,POS_FACEUP,true)
else
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200818,5))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetOperation(c67200818.disop)
e1:SetTargetRange(1,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
Duel.RegisterEffect(e2,tp)
end
end
function c67200818.tgfilter(c,tp,ec)
local mg=Group.FromCards(ec,c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c67200818.lfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function c67200818.lfilter(c,mg)
return c:IsLinkSummonable(mg,nil,2,2)
end
function c67200818.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or Duel.IsExistingMatchingCard(c67200818.repfilter,tp,LOCATION_MZONE,0,1,nil) then return end
if Duel.GetFlagEffect(tp,67200818)==0 and Duel.SelectYesNo(tp,aux.Stringid(67200818,3)) then
Duel.RegisterFlagEffect(tp,67200818,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc2=Duel.SelectMatchingCard(tp,c67200818.repfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc1=Duel.SelectMatchingCard(tp,c67200818.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,tp,tc2:GetFirst())
local mg=Group.FromCards(tc1,tc2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c67200818.lfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local lc=g:GetFirst()
if lc then
Duel.LinkSummon(tp,lc,mg,nil,2,2)
end
end
end
function c67200818.repfilter(c)
return c:IsFaceup() and c:IsSetCard(0x67b)
end
--星渡之先导者
function c67200820.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c67200820.lcheck)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200820,0))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_EXTRA)
--e1:SetCountLimit(1,67200820)
e1:SetCondition(c67200820.discon)
e1:SetOperation(c67200820.disop)
c:RegisterEffect(e1)
end
function c67200820.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x67b)
end
--
function c67200820.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c67200820.spcfilter,1,nil,tp) and eg:IsExists(c67200820.filter1,2,nil,tp)
end
function c67200820.filter1(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c67200820.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSetCard(0x67b)
end
function c67200820.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFlagEffect(tp,67200820)==0 and Duel.SelectYesNo(tp,aux.Stringid(67200820,1)) then
Duel.RegisterFlagEffect(tp,67200820,RESET_PHASE+PHASE_END,0,1)
if Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,true)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200820,2))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_DECK)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_ONFIELD))
e1:SetTargetRange(1,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
--白垩纪 三角雷龙
local m=91010014
local cm=c91010014
function c91010014.initial_effect(c)
aux.EnablePendulumAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_PZONE+LOCATION_EXTRA)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--e1
end
function cm.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsRace(RACE_DINOSAUR)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return ((c:IsLocation(LOCATION_PZONE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.con(c,tp)
return Duel.SelectYesNo(tp,aux.Stringid(m,0))
end
function cm.xyzfilter(c)
return c:IsXyzSummonable(nil) or c:IsSynchroSummonable(nil)
end
function cm.splimit(e,c)
return not c:IsRace(RACE_DINOSAUR)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.AnnounceLevel(tp,1,12)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ct)
e1:SetReset(RESET_EVENT+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(TYPE_TUNER)
c:RegisterEffect(e2)
end
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local g=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=g:Select(tp,1,1,nil)
local og=tg:GetFirst()
if og:IsType(TYPE_XYZ) then
Duel.XyzSummon(tp,tg:GetFirst(),nil)
end
if og:IsType(TYPE_SYNCHRO) then
Duel.SynchroSummon(tp,tg:GetFirst(),nil,mg)
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment