Commit da5ebcfb authored by 聖園ミカ's avatar 聖園ミカ 🐟

null

parent 0483d578
No preview for this file type
--形魔-特瑞安格 --形魔-特瑞安格
function c21520161.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520171)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520161.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520161.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520161.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520161.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--Attribute Dark --Attribute Dark
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -33,31 +35,31 @@ function c21520161.initial_effect(c) ...@@ -33,31 +35,31 @@ function c21520161.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520161,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520161.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520161.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520161.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520161.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520161.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520161.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520161.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520161,0),aux.Stringid(21520161,1),aux.Stringid(21520161,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520161,1),aux.Stringid(21520161,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -84,28 +86,28 @@ function c21520161.ccost(e,tp) ...@@ -84,28 +86,28 @@ function c21520161.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520161.ctfilter(c,e) function s.ctfilter(c,e)
return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(c21520161.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520171,Group.FromCards(e:GetHandler(),c)) return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520171,Group.FromCards(e:GetHandler(),c))
end end
function c21520161.ctspfilter(c,code,sg) function s.ctspfilter(c,code,sg)
return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0 return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0
end end
function c21520161.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520161.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520161.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end if chkkc then return s.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(c21520161.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c21520161.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c21520161.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local gg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(c21520161.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520171,gg) then if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520171,gg) then
local fg=Duel.GetMatchingGroup(c21520161.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520171,gg) local fg=Duel.GetMatchingGroup(s.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520171,gg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:Select(tp,1,1,nil) local sg=fg:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(gg) sg:GetFirst():SetMaterial(gg)
...@@ -115,10 +117,10 @@ function c21520161.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -115,10 +117,10 @@ function c21520161.ctop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
--[[ --[[
function c21520161.indval(e,re,tp) function s.indval(e,re,tp)
return tp~=e:GetHandlerPlayer() return tp~=e:GetHandlerPlayer()
end end
function c21520161.adcon(e,tp,eg,ep,ev,re,r,rp) function s.adcon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsAttackPos() then if e:GetHandler():IsAttackPos() then
return not e:GetHandler():IsDisabled() and e:GetHandler():IsRelateToBattle() return not e:GetHandler():IsDisabled() and e:GetHandler():IsRelateToBattle()
elseif e:GetHandler():IsDefensePos() then elseif e:GetHandler():IsDefensePos() then
...@@ -127,12 +129,12 @@ function c21520161.adcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -127,12 +129,12 @@ function c21520161.adcon(e,tp,eg,ep,ev,re,r,rp)
return false return false
end end
end end
function c21520161.adtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return true end if chk==0 then return true end
return true return true
end end
function c21520161.adop(e,tp,eg,ep,ev,re,r,rp) function s.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsAttackPos() then if c:IsAttackPos() then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
--形魔-瑞克坦 --形魔-瑞克坦
function c21520162.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520172)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520162.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520162.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520162.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520162.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--Attribute Light --Attribute Light
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,14 +22,14 @@ function c21520162.initial_effect(c) ...@@ -20,14 +22,14 @@ function c21520162.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520162,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c21520162.target) e2:SetTarget(s.target)
e2:SetOperation(c21520162.activate) e2:SetOperation(s.activate)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_1=e2:Clone() local e2_1=e2:Clone()
e2_1:SetCode(EVENT_SPSUMMON_SUCCESS) e2_1:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -36,31 +38,31 @@ function c21520162.initial_effect(c) ...@@ -36,31 +38,31 @@ function c21520162.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520162,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520162.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520162.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520162.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520162.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520162.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520162.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520162.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520162,0),aux.Stringid(21520162,1),aux.Stringid(21520162,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520162,1),aux.Stringid(21520162,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -87,11 +89,11 @@ function c21520162.ccost(e,tp) ...@@ -87,11 +89,11 @@ function c21520162.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520162.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_MZONE)
end end
function c21520162.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()<=0 then return end if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
...@@ -99,28 +101,28 @@ function c21520162.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -99,28 +101,28 @@ function c21520162.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(sg) Duel.HintSelection(sg)
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
end end
function c21520162.ctfilter(c,e) function s.ctfilter(c,e)
return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(c21520162.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520172,Group.FromCards(e:GetHandler(),c)) return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520172,Group.FromCards(e:GetHandler(),c))
end end
function c21520162.ctspfilter(c,code,sg) function s.ctspfilter(c,code,sg)
return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0 return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0
end end
function c21520162.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520162.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520162.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end if chkkc then return s.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(c21520162.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c21520162.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c21520162.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local gg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(c21520162.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520172,gg) then if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520172,gg) then
local fg=Duel.GetMatchingGroup(c21520162.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520172,gg) local fg=Duel.GetMatchingGroup(s.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520172,gg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:Select(tp,1,1,nil) local sg=fg:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(gg) sg:GetFirst():SetMaterial(gg)
......
--形魔-彭特贡 --形魔-彭特贡
function c21520163.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520173)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520163.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520163.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520163.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520163.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--Attribute Dark --Attribute Dark
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,44 +22,44 @@ function c21520163.initial_effect(c) ...@@ -20,44 +22,44 @@ function c21520163.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520163,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetCategory(CATEGORY_DRAW) e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCost(c21520163.drcost) e2:SetCost(s.drcost)
e2:SetTarget(c21520163.drtg) e2:SetTarget(s.drtg)
e2:SetOperation(c21520163.drop) e2:SetOperation(s.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--continuous trap --continuous trap
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520163,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520163.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520163.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520163.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520163.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520163.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520163.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520163.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520163,0),aux.Stringid(21520163,1),aux.Stringid(21520163,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520163,1),aux.Stringid(21520163,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -84,47 +86,47 @@ function c21520163.ccost(e,tp) ...@@ -84,47 +86,47 @@ function c21520163.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520163.rfilter(c) function s.rfilter(c)
return (c:IsAttribute(ATTRIBUTE_DARK) or c:IsAttribute(ATTRIBUTE_LIGHT)) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return (c:IsAttribute(ATTRIBUTE_DARK) or c:IsAttribute(ATTRIBUTE_LIGHT)) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function c21520163.drcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520163.rfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c21520163.rfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.rfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,POS_FACEUP,REASON_COST) Duel.SendtoGrave(g,POS_FACEUP,REASON_COST)
end end
function c21520163.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1) Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c21520163.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
function c21520163.ctfilter(c,e) function s.ctfilter(c,e)
return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(c21520163.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520173,Group.FromCards(e:GetHandler(),c)) return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520173,Group.FromCards(e:GetHandler(),c))
end end
function c21520163.ctspfilter(c,code,sg) function s.ctspfilter(c,code,sg)
return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0 return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0
end end
function c21520163.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520163.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520163.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end if chkkc then return s.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(c21520163.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c21520163.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c21520163.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local gg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(c21520163.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520173,gg) then if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520173,gg) then
local fg=Duel.GetMatchingGroup(c21520163.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520173,gg) local fg=Duel.GetMatchingGroup(s.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520173,gg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:Select(tp,1,1,nil) local sg=fg:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(gg) sg:GetFirst():SetMaterial(gg)
......
--形魔-合克萨根 --形魔-合克萨根
function c21520164.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520174)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520164.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520164.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520164.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520164.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--Attribute Light --Attribute Light
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,43 +22,43 @@ function c21520164.initial_effect(c) ...@@ -20,43 +22,43 @@ function c21520164.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520164,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(c21520164.tg) e2:SetTarget(s.tg)
e2:SetOperation(c21520164.op) e2:SetOperation(s.op)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--continuous trap --continuous trap
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520164,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520164.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520164.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520164.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520164.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520164.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520164.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520164.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520164,0),aux.Stringid(21520164,1),aux.Stringid(21520164,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520164,1),aux.Stringid(21520164,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -83,45 +85,45 @@ function c21520164.ccost(e,tp) ...@@ -83,45 +85,45 @@ function c21520164.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520164.filter(c,e,tp) function s.filter(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4) and c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(4) and c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER)
end end
function c21520164.tg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c21520164.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end end
function c21520164.op(e,tp,eg,ep,ev,re,r,rp) function s.op(e,tp,eg,ep,ev,re,r,rp)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1<=0 then return end if ft1<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c21520164.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c21520164.ctfilter(c,e) function s.ctfilter(c,e)
return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(c21520164.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520174,Group.FromCards(e:GetHandler(),c)) return c:IsFaceup() and c:IsRace(RACE_FIEND) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520174,Group.FromCards(e:GetHandler(),c))
end end
function c21520164.ctspfilter(c,code,sg) function s.ctspfilter(c,code,sg)
return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0 return c:IsCode(code) and c:IsFusionSummonableCard() and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0
end end
function c21520164.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520164.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520164.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end if chkkc then return s.ctfilter(chkc,e) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(c21520164.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c21520164.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c21520164.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local gg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(c21520164.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520174,gg) then if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.ctspfilter,tp,LOCATION_EXTRA,0,1,nil,21520174,gg) then
local fg=Duel.GetMatchingGroup(c21520164.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520174,gg) local fg=Duel.GetMatchingGroup(s.ctspfilter,tp,LOCATION_EXTRA,0,nil,21520174,gg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:Select(tp,1,1,nil) local sg=fg:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(gg) sg:GetFirst():SetMaterial(gg)
......
--形魔-克洛萨 --形魔-克洛萨
function c21520165.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--[[ --cost --[[ --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +8,8 @@ function c21520165.initial_effect(c) ...@@ -7,8 +8,8 @@ function c21520165.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520165.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520165.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00)--]] c:RegisterEffect(e00)--]]
--Attribute Dark --Attribute Dark
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,54 +21,54 @@ function c21520165.initial_effect(c) ...@@ -20,54 +21,54 @@ function c21520165.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--summon with no tribute --summon with no tribute
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520165,3)) e3:SetDescription(aux.Stringid(id,3))
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SUMMON_PROC) e3:SetCode(EFFECT_SUMMON_PROC)
e3:SetCondition(c21520165.ntcon) e3:SetCondition(s.ntcon)
e3:SetOperation(c21520165.ntop) e3:SetOperation(s.ntop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--double atk & def --double atk & def
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(21520165,4)) e4:SetDescription(aux.Stringid(id,4))
e4:SetType(EFFECT_TYPE_IGNITION) e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetCost(c21520165.cost1) e4:SetCost(s.cost1)
e4:SetOperation(c21520165.operation) e4:SetOperation(s.operation)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--negate --negate
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(21520165,5)) e5:SetDescription(aux.Stringid(id,5))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_ATTACK_ANNOUNCE) e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetCost(c21520165.cost) e5:SetCost(s.cost)
e5:SetOperation(c21520165.negop1) e5:SetOperation(s.negop1)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(21520165,5)) e6:SetDescription(aux.Stringid(id,5))
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_BE_BATTLE_TARGET) e6:SetCode(EVENT_BE_BATTLE_TARGET)
e6:SetCost(c21520165.cost) e6:SetCost(s.cost)
e6:SetOperation(c21520165.negop2) e6:SetOperation(s.negop2)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c21520165.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520165.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520165.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520165.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520165,0),aux.Stringid(21520165,1),aux.Stringid(21520165,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520165,1),aux.Stringid(21520165,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -94,12 +95,12 @@ function c21520165.ccost(e,tp) ...@@ -94,12 +95,12 @@ function c21520165.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520165.ntcon(e,c) function s.ntcon(e,c)
if c==nil then return true end if c==nil then return true end
local mi,ma=c:GetTributeRequirement() local mi,ma=c:GetTributeRequirement()
return mi>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 return mi>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end end
function c21520165.ntop(e,tp,eg,ep,ev,re,r,rp,c) function s.ntop(e,tp,eg,ep,ev,re,r,rp,c)
--change attack and defence to 0 until turn end --change attack and defence to 0 until turn end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -114,26 +115,26 @@ function c21520165.ntop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -114,26 +115,26 @@ function c21520165.ntop(e,tp,eg,ep,ev,re,r,rp,c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21520165.cfilter(c,stname) function s.cfilter(c,stname)
if stname==nil then if stname==nil then
return (c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsAttribute(ATTRIBUTE_DARK)) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return (c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsAttribute(ATTRIBUTE_DARK)) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
else else
return c:IsSetCard(stname) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return c:IsSetCard(stname) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end end
end end
function c21520165.cost1(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520165.cfilter,tp,LOCATION_DECK,0,1,nil,0x490) end if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK,0,1,nil,0x490) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c21520165.cfilter,tp,LOCATION_DECK,0,1,1,nil,0x490) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK,0,1,1,nil,0x490)
Duel.SendtoGrave(g,POS_FACEUP,REASON_COST) Duel.SendtoGrave(g,POS_FACEUP,REASON_COST)
end end
function c21520165.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520165.cfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c21520165.cfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,POS_FACEUP,REASON_COST) Duel.SendtoGrave(g,POS_FACEUP,REASON_COST)
end end
function c21520165.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -147,7 +148,7 @@ function c21520165.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -147,7 +148,7 @@ function c21520165.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(c:GetDefense()*2) e2:SetValue(c:GetDefense()*2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21520165.negop1(e,tp,eg,ep,ev,re,r,rp) function s.negop1(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.GetAttackTarget() local dc=Duel.GetAttackTarget()
if dc then if dc then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -162,7 +163,7 @@ function c21520165.negop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -162,7 +163,7 @@ function c21520165.negop1(e,tp,eg,ep,ev,re,r,rp)
dc:RegisterEffect(e2) dc:RegisterEffect(e2)
end end
end end
function c21520165.negop2(e,tp,eg,ep,ev,re,r,rp) function s.negop2(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker() local ac=Duel.GetAttacker()
if ac then if ac then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
--形魔-瑟科尔 --形魔-瑟科尔
function c21520166.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
--[[ --cost --[[ --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520166.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520166.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520166.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520166.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00)--]] c:RegisterEffect(e00)--]]
--Attribute Light --Attribute Light
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -24,7 +26,7 @@ function c21520166.initial_effect(c) ...@@ -24,7 +26,7 @@ function c21520166.initial_effect(c)
e3:SetCode(EFFECT_SPSUMMON_PROC) e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE) e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND) e3:SetRange(LOCATION_HAND)
e3:SetCondition(c21520166.spcon) e3:SetCondition(s.spcon)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--atk & def --atk & def
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -32,38 +34,38 @@ function c21520166.initial_effect(c) ...@@ -32,38 +34,38 @@ function c21520166.initial_effect(c)
e4:SetCode(EFFECT_SET_ATTACK) e4:SetCode(EFFECT_SET_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetValue(c21520166.adval) e4:SetValue(s.adval)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=e4:Clone() local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE) e5:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--add card --add card
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(21520166,3)) e6:SetDescription(aux.Stringid(id,3))
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_BATTLE_DAMAGE) e6:SetCode(EVENT_BATTLE_DAMAGE)
e6:SetCondition(c21520166.thcon) e6:SetCondition(s.thcon)
e6:SetTarget(c21520166.thtg) e6:SetTarget(s.thtg)
e6:SetOperation(c21520166.thop) e6:SetOperation(s.thop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c21520166.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520166.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520166.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520166.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520166,0),aux.Stringid(21520166,1),aux.Stringid(21520166,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520166,1),aux.Stringid(21520166,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -90,33 +92,33 @@ function c21520166.ccost(e,tp) ...@@ -90,33 +92,33 @@ function c21520166.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520166.spfilter(c) function s.spfilter(c)
return c:IsSetCard(0x490) and c:IsFaceup() return c:IsSetCard(0x490) and c:IsFaceup()
end end
function c21520166.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==Duel.GetMatchingGroupCount(c21520166.spfilter,c:GetControler(),LOCATION_MZONE,0,nil) return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==Duel.GetMatchingGroupCount(s.spfilter,c:GetControler(),LOCATION_MZONE,0,nil)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end end
function c21520166.adfliter(c,attr) function s.adfliter(c,attr)
return c:IsAttribute(attr) and c:IsFaceup() return c:IsAttribute(attr) and c:IsFaceup()
end end
function c21520166.adval(e,c) function s.adval(e,c)
return (Duel.GetMatchingGroupCount(c21520166.adfliter,c:GetControler(),LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,nil,ATTRIBUTE_LIGHT)+Duel.GetMatchingGroupCount(c21520166.adfliter,c:GetControler(),LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,nil,ATTRIBUTE_DARK))*200 return (Duel.GetMatchingGroupCount(s.adfliter,c:GetControler(),LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,nil,ATTRIBUTE_LIGHT)+Duel.GetMatchingGroupCount(s.adfliter,c:GetControler(),LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,nil,ATTRIBUTE_DARK))*200
end end
function c21520166.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep~=tp
end end
function c21520166.thfilter(c) function s.thfilter(c)
return ((c:IsSetCard(0x490) and c:IsLevelBelow(4) and c:IsType(TYPE_MONSTER)) or c:IsCode(21520181)) and c:IsAbleToHand() return ((c:IsSetCard(0x490) and c:IsLevelBelow(4) and c:IsType(TYPE_MONSTER)) or c:IsCode(21520181)) and c:IsAbleToHand()
end end
function c21520166.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520166.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c21520166.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c21520166.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
......
--等形魔-特瑞安格 --等形魔-特瑞安格
function c21520167.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520161)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520167.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520167.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520167.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520167.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--change code --change code
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,43 +22,43 @@ function c21520167.initial_effect(c) ...@@ -20,43 +22,43 @@ function c21520167.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Activate --Activate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520167,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
-- e2:SetCondition(c21520167.condition) -- e2:SetCondition(s.condition)
e2:SetCost(c21520167.cost) e2:SetCost(s.cost)
e2:SetOperation(c21520167.operation) e2:SetOperation(s.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--continuous trap --continuous trap
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TODECK+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520167,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520167.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520167.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520167.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520167.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520167.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520167.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520167.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520167,0),aux.Stringid(21520167,1),aux.Stringid(21520167,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520167,1),aux.Stringid(21520167,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -83,22 +85,22 @@ function c21520167.ccost(e,tp) ...@@ -83,22 +85,22 @@ function c21520167.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520167.cfilter(c) function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x490) return c:IsFaceup() and c:IsSetCard(0x490)
end end
function c21520167.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c21520167.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function c21520167.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function c21520167.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c21520167.sefilter1) e1:SetTarget(s.sefilter1)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1) e1:SetValue(1)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
...@@ -106,28 +108,39 @@ function c21520167.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -106,28 +108,39 @@ function c21520167.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
function c21520167.sefilter1(e,c) function s.sefilter1(e,c)
return c:IsSetCard(0x490) and c:IsFaceup() and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x490) and c:IsFaceup() and c:IsType(TYPE_MONSTER)
end end
function c21520167.ctfilter(c) function s.ctfilter(c,tc)
return c:IsFaceup() and c:IsCode(21520161) and c:IsAbleToHand() return c:IsCode(21520161) and c:IsAbleToDeck() and tc:IsAbleToDeck() and Duel.IsExistingMatchingCard(s.dfsfilter,tp,LOCATION_EXTRA,0,1,nil,Group.FromCards(c,tc))
end end
function c21520167.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.dfsfilter(c,mg)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FIEND) and c:CheckFusionMaterial(mg) and Duel.GetLocationCountFromEx(c:GetControler())>0
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520167.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520167.ctfilter(chkc) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end if chkkc then return s.ctfilter(chkc,e:GetHandler()) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingTarget(c21520167.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c21520167.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE)
end end
function c21520167.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local mg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then local g=Duel.GetMatchingGroup(s.dfsfilter,tp,LOCATION_EXTRA,0,nil,mg)
Duel.SendtoHand(gg,nil,REASON_EFFECT) if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and g:GetCount()>0 and Duel.GetLocationCountFromEx(tp)>0 then
Duel.ConfirmCards(1-tp,gg) if aux.NecroValleyNegateCheck(tc) then return end
if not aux.NecroValleyFilter()(tc) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(mg)
Duel.HintSelection(mg)
Duel.SendtoDeck(mg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.SpecialSummon(sg,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end end
end end
--等形魔-瑞克坦 --等形魔-瑞克坦
function c21520168.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520162)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520168.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520168.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520168.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520168.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--change code --change code
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,47 +22,47 @@ function c21520168.initial_effect(c) ...@@ -20,47 +22,47 @@ function c21520168.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Activate --Activate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520168,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCategory(CATEGORY_TODECK) e2:SetCategory(CATEGORY_TODECK)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCost(c21520168.cost) e2:SetCost(s.cost)
e2:SetTarget(c21520168.target) e2:SetTarget(s.target)
e2:SetOperation(c21520168.operation) e2:SetOperation(s.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_1=e2:Clone() local e2_1=e2:Clone()
e2_1:SetCode(EVENT_SPSUMMON_SUCCESS) e2_1:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2_1) c:RegisterEffect(e2_1)
--continuous trap --continuous trap
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TODECK+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520168,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520168.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520168.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520168.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520168.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520168.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520168.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520168.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520168,0),aux.Stringid(21520168,1),aux.Stringid(21520168,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520168,1),aux.Stringid(21520168,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -87,7 +89,7 @@ function c21520168.ccost(e,tp) ...@@ -87,7 +89,7 @@ function c21520168.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520168.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
--[[ if chk==0 then return e:GetHandler():IsReleasable() end --[[ if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -95,7 +97,7 @@ function c21520168.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -95,7 +97,7 @@ function c21520168.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(c21520168.splimit) e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone() local e2=e1:Clone()
...@@ -104,61 +106,72 @@ function c21520168.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -104,61 +106,72 @@ function c21520168.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local e3=e1:Clone() local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e3,tp)--]] Duel.RegisterEffect(e3,tp)--]]
if chk==0 then return Duel.IsExistingMatchingCard(c21520168.afilter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.afilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c21520168.afilter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.afilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
function c21520168.afilter(c) function s.afilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520168.splimit(e,c,sump,sumtype,sumpos,targetp,se) function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x490) return not c:IsSetCard(0x490)
end end
function c21520168.tdfilter(c) function s.tdfilter(c)
return c:IsAbleToDeck() return c:IsAbleToDeck()
end end
function c21520168.stdfilter(sg) function s.stdfilter(sg)
return sg:GetCount()>=1 and sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1 and sg:FilterCount(Card.IsLocation,nil,LOCATION_ONFIELD)<=1 return sg:GetCount()>=1 and sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1 and sg:FilterCount(Card.IsLocation,nil,LOCATION_ONFIELD)<=1
end end
function c21520168.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
return Duel.IsExistingMatchingCard(c21520168.tdfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
or Duel.GetMatchingGroupCount(Duel.IsPlayerCanDraw,tp,LOCATION_DECK,0,nil,tp)>=1 end or Duel.GetMatchingGroupCount(Duel.IsPlayerCanDraw,tp,LOCATION_DECK,0,nil,tp)>=1 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end end
function c21520168.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c21520168.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local g1=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(c21520168.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil) local g2=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if g1:GetCount()>0 or g2:GetCount()>0 then if g1:GetCount()>0 or g2:GetCount()>0 then
local g=Group.CreateGroup() local g=Group.CreateGroup()
g:Merge(g1) g:Merge(g1)
g:Merge(g2) g:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,c21520168.stdfilter,false,1,2) local sg=g:SelectSubGroup(tp,s.stdfilter,false,1,2)
Duel.HintSelection(sg) Duel.HintSelection(sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end end
end end
function c21520168.ctfilter(c) function s.ctfilter(c,tc)
return c:IsFaceup() and c:IsCode(21520162) and c:IsAbleToHand() return c:IsCode(21520162) and c:IsAbleToDeck() and tc:IsAbleToDeck() and Duel.IsExistingMatchingCard(s.dfsfilter,tp,LOCATION_EXTRA,0,1,nil,Group.FromCards(c,tc))
end end
function c21520168.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.dfsfilter(c,mg)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FIEND) and c:CheckFusionMaterial(mg) and Duel.GetLocationCountFromEx(c:GetControler())>0
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520168.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520168.ctfilter(chkc) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end if chkkc then return s.ctfilter(chkc,e:GetHandler()) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingTarget(c21520168.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c21520168.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE)
end end
function c21520168.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local mg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then local g=Duel.GetMatchingGroup(s.dfsfilter,tp,LOCATION_EXTRA,0,nil,mg)
Duel.SendtoHand(gg,nil,REASON_EFFECT) if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and g:GetCount()>0 and Duel.GetLocationCountFromEx(tp)>0 then
Duel.ConfirmCards(1-tp,gg) if aux.NecroValleyNegateCheck(tc) then return end
if not aux.NecroValleyFilter()(tc) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(mg)
Duel.HintSelection(mg)
Duel.SendtoDeck(mg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.SpecialSummon(sg,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end end
end end
--等形魔-彭特贡 --等形魔-彭特贡
function c21520169.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520163)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520169.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520169.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520169.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520169.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--change code --change code
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -22,41 +24,41 @@ function c21520169.initial_effect(c) ...@@ -22,41 +24,41 @@ function c21520169.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetDescription(aux.Stringid(21520169,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetCategory(CATEGORY_DRAW) e2:SetCategory(CATEGORY_DRAW)
e2:SetCost(c21520169.cost) e2:SetCost(s.cost)
e2:SetTarget(c21520169.target) e2:SetTarget(s.target)
e2:SetOperation(c21520169.operation) e2:SetOperation(s.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--continuous trap --continuous trap
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TODECK+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520169,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520169.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520169.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520169.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520169.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520169.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520169.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520169.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520169,0),aux.Stringid(21520169,1),aux.Stringid(21520169,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520169,1),aux.Stringid(21520169,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -83,47 +85,58 @@ function c21520169.ccost(e,tp) ...@@ -83,47 +85,58 @@ function c21520169.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520169.dfilter(c) function s.dfilter(c)
return (c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsAttribute(ATTRIBUTE_DARK)) and c:IsType(TYPE_MONSTER) and not c:IsPublic() return (c:IsAttribute(ATTRIBUTE_LIGHT) or c:IsAttribute(ATTRIBUTE_DARK)) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end end
function c21520169.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520169.dfilter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c21520169.dfilter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
function c21520169.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2) Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end end
function c21520169.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
Duel.BreakEffect() Duel.BreakEffect()
local g1=Duel.GetFieldGroup(p,LOCATION_HAND,0):Select(p,1,1,nil) local g1=Duel.GetFieldGroup(p,LOCATION_HAND,0):Select(p,1,1,nil)
Duel.SendtoDeck(g1,nil,1,REASON_EFFECT) Duel.SendtoDeck(g1,nil,1,REASON_EFFECT)
end end
function c21520169.ctfilter(c) function s.ctfilter(c,tc)
return c:IsFaceup() and c:IsCode(21520163) and c:IsAbleToHand() return c:IsCode(21520163) and c:IsAbleToDeck() and tc:IsAbleToDeck() and Duel.IsExistingMatchingCard(s.dfsfilter,tp,LOCATION_EXTRA,0,1,nil,Group.FromCards(c,tc))
end end
function c21520169.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.dfsfilter(c,mg)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FIEND) and c:CheckFusionMaterial(mg) and Duel.GetLocationCountFromEx(c:GetControler())>0
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520169.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520169.ctfilter(chkc) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end if chkkc then return s.ctfilter(chkc,e:GetHandler()) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingTarget(c21520169.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c21520169.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE)
end end
function c21520169.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local mg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then local g=Duel.GetMatchingGroup(s.dfsfilter,tp,LOCATION_EXTRA,0,nil,mg)
Duel.SendtoHand(gg,nil,REASON_EFFECT) if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and g:GetCount()>0 and Duel.GetLocationCountFromEx(tp)>0 then
Duel.ConfirmCards(1-tp,gg) if aux.NecroValleyNegateCheck(tc) then return end
if not aux.NecroValleyFilter()(tc) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(mg)
Duel.HintSelection(mg)
Duel.SendtoDeck(mg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.SpecialSummon(sg,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end end
end end
--等形魔-合克萨根 --等形魔-合克萨根
function c21520170.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520164)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -7,8 +9,8 @@ function c21520170.initial_effect(c) ...@@ -7,8 +9,8 @@ function c21520170.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520170.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520170.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--change code --change code
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,43 +22,43 @@ function c21520170.initial_effect(c) ...@@ -20,43 +22,43 @@ function c21520170.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Activate --Activate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520170,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(c21520170.target) e2:SetTarget(s.target)
e2:SetOperation(c21520170.operation) e2:SetOperation(s.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--continuous trap --continuous trap
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TODECK+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520170,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520170.ctcon) e3:SetCondition(s.ctcon)
e3:SetTarget(c21520170.cttg) e3:SetTarget(s.cttg)
e3:SetOperation(c21520170.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520170.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520170.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520170.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520170.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520170,0),aux.Stringid(21520170,1),aux.Stringid(21520170,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520170,1),aux.Stringid(21520170,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -83,16 +85,16 @@ function c21520170.ccost(e,tp) ...@@ -83,16 +85,16 @@ function c21520170.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520170.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_MONSTER) return c:IsLevelBelow(4) and c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_MONSTER)
end end
function c21520170.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520170.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c21520170.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end end
function c21520170.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
...@@ -120,25 +122,36 @@ function c21520170.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -120,25 +122,36 @@ function c21520170.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
end end
function c21520170.ctfilter(c) function s.ctfilter(c,tc)
return c:IsFaceup() and c:IsCode(21520164) and c:IsAbleToHand() return c:IsCode(21520164) and c:IsAbleToDeck() and tc:IsAbleToDeck() and Duel.IsExistingMatchingCard(s.dfsfilter,tp,LOCATION_EXTRA,0,1,nil,Group.FromCards(c,tc))
end end
function c21520170.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.dfsfilter(c,mg)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FIEND) and c:CheckFusionMaterial(mg) and Duel.GetLocationCountFromEx(c:GetControler())>0
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
end end
function c21520170.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkkc then return c21520170.ctfilter(chkc) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end if chkkc then return s.ctfilter(chkc,e:GetHandler()) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingTarget(c21520170.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c21520170.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,s.ctfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED+LOCATION_GRAVE)
end end
function c21520170.ctop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
local gg=Group.FromCards(c,tc) local mg=Group.FromCards(c,tc)
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then local g=Duel.GetMatchingGroup(s.dfsfilter,tp,LOCATION_EXTRA,0,nil,mg)
Duel.SendtoHand(gg,nil,REASON_EFFECT) if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and g:GetCount()>0 and Duel.GetLocationCountFromEx(tp)>0 then
Duel.ConfirmCards(1-tp,gg) if aux.NecroValleyNegateCheck(tc) then return end
if not aux.NecroValleyFilter()(tc) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():SetMaterial(mg)
Duel.HintSelection(mg)
Duel.SendtoDeck(mg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.SpecialSummon(sg,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end end
end end
--柱形魔-斯瑞 --柱形魔-斯瑞
function c21520171.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,21520161,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true) aux.AddFusionProcCodeFun(c,21520161,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true)
...@@ -8,7 +9,7 @@ function c21520171.initial_effect(c) ...@@ -8,7 +9,7 @@ function c21520171.initial_effect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c21520171.splimit) e0:SetValue(s.splimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
...@@ -17,8 +18,8 @@ function c21520171.initial_effect(c) ...@@ -17,8 +18,8 @@ function c21520171.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520171.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520171.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--attribute --attribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -34,32 +35,32 @@ function c21520171.initial_effect(c) ...@@ -34,32 +35,32 @@ function c21520171.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(3,21520171) e2:SetCountLimit(3,id)
e2:SetCondition(c21520171.adcon) e2:SetCondition(s.adcon)
e2:SetTarget(c21520171.adtg) e2:SetTarget(s.adtg)
e2:SetOperation(c21520171.adop) e2:SetOperation(s.adop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to hand --to hand
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520171,3)) e3:SetDescription(aux.Stringid(id,3))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TOHAND)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c21520171.con) e3:SetCondition(s.con)
e3:SetTarget(c21520171.tg) e3:SetTarget(s.tg)
e3:SetOperation(c21520171.op) e3:SetOperation(s.op)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520171.adcon(e,tp,eg,ep,ev,re,r,rp) function s.adcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsDisabled() return not e:GetHandler():IsDisabled()
end end
function c21520171.adtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return true end if chk==0 then return true end
return true return true
end end
function c21520171.adop(e,tp,eg,ep,ev,re,r,rp) function s.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetCategory(CATEGORY_ATKCHANGE)
...@@ -75,21 +76,21 @@ function c21520171.adop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,21 +76,21 @@ function c21520171.adop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21520171.con(e,tp,eg,ep,ev,re,r,rp) function s.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)
end end
function c21520171.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c21520171.thfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c21520171.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),tp) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c21520171.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function c21520171.thfilter(c,tp) function s.thfilter(c,tp)
return c:IsSetCard(0x490) and c:IsAbleToHand() and Duel:IsPlayerCanDraw(tp,1) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x490) and c:IsAbleToHand() and Duel:IsPlayerCanDraw(tp,1) and c:IsType(TYPE_MONSTER)
end end
function c21520171.op(e,tp,eg,ep,ev,re,r,rp) function s.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
...@@ -98,25 +99,25 @@ function c21520171.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,25 +99,25 @@ function c21520171.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
function c21520171.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520171.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520171.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520171.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520171.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520171,0),aux.Stringid(21520171,1),aux.Stringid(21520171,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520171,1),aux.Stringid(21520171,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
......
--柱形魔-弗沃尔 --柱形魔-弗沃尔
function c21520172.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,21520162,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true) aux.AddFusionProcCodeFun(c,21520162,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true)
...@@ -8,7 +9,7 @@ function c21520172.initial_effect(c) ...@@ -8,7 +9,7 @@ function c21520172.initial_effect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c21520172.splimit) e0:SetValue(s.splimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
...@@ -17,8 +18,8 @@ function c21520172.initial_effect(c) ...@@ -17,8 +18,8 @@ function c21520172.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520172.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520172.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--attribute --attribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -30,47 +31,47 @@ function c21520172.initial_effect(c) ...@@ -30,47 +31,47 @@ function c21520172.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--return to deck --return to deck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520172,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetCategory(CATEGORY_TODECK) e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c21520172.retcon) e2:SetCondition(s.retcon)
e2:SetTarget(c21520172.rettg) e2:SetTarget(s.rettg)
e2:SetOperation(c21520172.retop) e2:SetOperation(s.retop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to hand --to hand
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520172,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c21520172.thcon) e3:SetCondition(s.thcon)
e3:SetTarget(c21520172.thtg) e3:SetTarget(s.thtg)
e3:SetOperation(c21520172.thop) e3:SetOperation(s.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520172.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520172.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520172.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520172.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520172.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520172,0),aux.Stringid(21520172,1),aux.Stringid(21520172,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520172,1),aux.Stringid(21520172,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -97,44 +98,44 @@ function c21520172.ccost(e,tp) ...@@ -97,44 +98,44 @@ function c21520172.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520172.retcon(e,tp,eg,ep,ev,re,r,rp) function s.retcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520172.rtfilter(c,rc) function s.rtfilter(c,rc)
return c:IsAttackBelow(rc:GetAttack()) or c:IsFacedown() return c:IsAttackBelow(rc:GetAttack()) or c:IsFacedown()
end end
function c21520172.rettg(e,tp,eg,ep,ev,re,r,rp,chk) function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520172.rtfilter,tp,0,LOCATION_MZONE,1,nil,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(s.rtfilter,tp,0,LOCATION_MZONE,1,nil,e:GetHandler()) end
local g=Duel.GetMatchingGroup(c21520172.rtfilter,tp,0,LOCATION_MZONE,nil,e:GetHandler()) local g=Duel.GetMatchingGroup(s.rtfilter,tp,0,LOCATION_MZONE,nil,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,nil,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,nil,0,0)
end end
function c21520172.retop(e,tp,eg,ep,ev,re,r,rp) function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c21520172.rtfilter,tp,0,LOCATION_MZONE,nil,c) local g=Duel.GetMatchingGroup(s.rtfilter,tp,0,LOCATION_MZONE,nil,c)
if g:GetCount()>0 and c:IsRelateToEffect(e) then if g:GetCount()>0 and c:IsRelateToEffect(e) then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT) Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end end
end end
function c21520172.thfilter(c,rc) function s.thfilter(c,rc)
return bit.band(c:GetReason(),0x40008)==0x40008 and c:IsAbleToHand() and c:IsLocation(LOCATION_GRAVE) and c:GetReasonCard()==rc return bit.band(c:GetReason(),0x40008)==0x40008 and c:IsAbleToHand() and c:IsLocation(LOCATION_GRAVE) and c:GetReasonCard()==rc
end end
function c21520172.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)
end end
function c21520172.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return e:GetHandler():GetMaterial():IsContains(chkc) and chkc:IsLocation(LOCATION_GRAVE) end
-- if chk==0 then return Duel.IsExistingTarget(c21520172.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
-- if chk==0 then return e:GetHandler():GetMaterial():IsExists(c21520172.thfilter,1,nil,e:GetHandler()) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=e:GetHandler():GetMaterial() local g1=e:GetHandler():GetMaterial()
local g=g1:FilterSelect(tp,c21520172.thfilter,1,1,nil,e:GetHandler()) if chkc then return g1:IsContains(chkc) and chkc:IsLocation(LOCATION_GRAVE) end
-- local g=Duel.SelectTarget(tp,c21520172.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) -- if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return g1:IsExists(s.thfilter,1,nil,e:GetHandler()) end
-- if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=g1:FilterSelect(tp,s.thfilter,1,1,nil,e:GetHandler())
-- local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function c21520172.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e) local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then if sg:GetCount()>0 then
......
--柱形魔-富艾夫 --柱形魔-富艾夫
function c21520173.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,21520163,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true) aux.AddFusionProcCodeFun(c,21520163,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true)
...@@ -8,7 +9,7 @@ function c21520173.initial_effect(c) ...@@ -8,7 +9,7 @@ function c21520173.initial_effect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c21520173.splimit) e0:SetValue(s.splimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
...@@ -17,8 +18,8 @@ function c21520173.initial_effect(c) ...@@ -17,8 +18,8 @@ function c21520173.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520173.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520173.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--attribute --attribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -30,44 +31,44 @@ function c21520173.initial_effect(c) ...@@ -30,44 +31,44 @@ function c21520173.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520173,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_DAMAGE) e2:SetCategory(CATEGORY_DRAW+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(c21520173.drtg) e2:SetTarget(s.drtg)
e2:SetOperation(c21520173.drop) e2:SetOperation(s.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--sort --sort
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520173,4)) e3:SetDescription(aux.Stringid(id,4))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c21520173.sortcon) e3:SetCondition(s.sortcon)
e3:SetTarget(c21520173.sorttg) e3:SetTarget(s.sorttg)
e3:SetOperation(c21520173.sortop) e3:SetOperation(s.sortop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520173.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520173.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520173.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520173.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520173.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520173,0),aux.Stringid(21520173,1),aux.Stringid(21520173,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520173,1),aux.Stringid(21520173,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -94,11 +95,11 @@ function c21520173.ccost(e,tp) ...@@ -94,11 +95,11 @@ function c21520173.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520173.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c21520173.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
local tc=Duel.GetOperatedGroup():GetFirst() local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
...@@ -109,15 +110,17 @@ function c21520173.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,15 +110,17 @@ function c21520173.drop(e,tp,eg,ep,ev,re,r,rp)
end end
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
end end
function c21520173.sortcon(e,tp,eg,ep,ev,re,r,rp) function s.sortcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)
end end
function c21520173.sorttg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sorttg(e,tp,eg,ep,ev,re,r,rp,chk)
-- if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
if chk==0 then return true end -- if chk==0 then return true end
end end
function c21520173.sortop(e,tp,eg,ep,ev,re,r,rp) function s.sortop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<5 then return end if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<5 then return end
Duel.SortDecktop(tp,tp,5) Duel.SortDecktop(tp,tp,5)
Duel.BreakEffect()
Duel.Draw(tp,1)
end end
--柱形魔-司库斯 --柱形魔-司库斯
function c21520174.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,21520164,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true) aux.AddFusionProcCodeFun(c,21520164,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),1,true,true)
...@@ -8,7 +9,7 @@ function c21520174.initial_effect(c) ...@@ -8,7 +9,7 @@ function c21520174.initial_effect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c21520174.splimit) e0:SetValue(s.splimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
...@@ -17,8 +18,8 @@ function c21520174.initial_effect(c) ...@@ -17,8 +18,8 @@ function c21520174.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520174.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520174.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--attribute --attribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -30,47 +31,47 @@ function c21520174.initial_effect(c) ...@@ -30,47 +31,47 @@ function c21520174.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520174,3)) e2:SetDescription(aux.Stringid(id,3))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c21520174.drcon) e2:SetCondition(s.drcon)
e2:SetTarget(c21520174.drtg) e2:SetTarget(s.drtg)
e2:SetOperation(c21520174.drop) e2:SetOperation(s.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--special summon --special summon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520174,4)) e2:SetDescription(aux.Stringid(id,4))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c21520174.spcon) e3:SetCondition(s.spcon)
e3:SetTarget(c21520174.sptg) e3:SetTarget(s.sptg)
e3:SetOperation(c21520174.spop) e3:SetOperation(s.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520174.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520174.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520174.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520174.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520174.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520174,0),aux.Stringid(21520174,1),aux.Stringid(21520174,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520174,1),aux.Stringid(21520174,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -97,19 +98,19 @@ function c21520174.ccost(e,tp) ...@@ -97,19 +98,19 @@ function c21520174.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520174.drcon(e,tp,eg,ep,ev,re,r,rp) function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD+LOCATION_HAND,0) local ct1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD+LOCATION_HAND,0)
local ct2=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD+LOCATION_HAND) local ct2=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD+LOCATION_HAND)
if ct1>=ct2 then return false end if ct1>=ct2 then return false end
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520174.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end end
function c21520174.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
local count1=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,e:GetHandler()) local count1=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,e:GetHandler())
local count2=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,e:GetHandler()) local count2=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,e:GetHandler())
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
...@@ -118,28 +119,28 @@ function c21520174.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,28 +119,28 @@ function c21520174.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,count1,REASON_EFFECT) Duel.Draw(tp,count1,REASON_EFFECT)
Duel.Draw(1-tp,count2,REASON_EFFECT) Duel.Draw(1-tp,count2,REASON_EFFECT)
end end
function c21520174.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_MONSTER)
end end
function c21520174.spsgfilter(sg) function s.spsgfilter(sg)
return sg:GetCount()<=3 and #sg==sg:GetClassCount(Card.GetCode) return sg:GetCount()<=3 and #sg==sg:GetClassCount(Card.GetCode)
end end
function c21520174.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)
end end
function c21520174.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c21520174.spfilter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
-- if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c21520174.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end -- if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
if chk==0 then return true end if chk==0 then return true end
local mg=Duel.GetMatchingGroup(c21520174.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) local mg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
local ct=math.min(3,Duel.GetMZoneCount(tp)) local ct=math.min(3,Duel.GetMZoneCount(tp))
if Duel.IsPlayerAffectedByEffect(tp,59822133) and ct>1 then ct=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) and ct>1 then ct=1 end
local g=mg:SelectSubGroup(tp,aux.dncheck,false,1,ct) local g=mg:SelectSubGroup(tp,aux.dncheck,false,1,ct)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end end
function c21520174.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end
...@@ -151,7 +152,7 @@ function c21520174.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -151,7 +152,7 @@ function c21520174.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
--[[ --[[
function c21520174.group_unique_code(g) function s.group_unique_code(g)
local check={} local check={}
local tg=Group.CreateGroup() local tg=Group.CreateGroup()
local tc=g:GetFirst() local tc=g:GetFirst()
......
--终形魔-戈罗波 --终形魔-戈罗波
function c21520175.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
c:EnableReviveLimit() c:EnableReviveLimit()
--fusion material --fusion material
aux.AddFusionProcMixRep(c,false,false,c21520175.sefilter,3,200) aux.AddFusionProcMixRep(c,false,false,s.sefilter,3,100)
--[[ local e0=Effect.CreateEffect(c) --[[ local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_FUSION_MATERIAL) e0:SetCode(EFFECT_FUSION_MATERIAL)
e0:SetCondition(c21520175.fscondition) e0:SetCondition(s.fscondition)
e0:SetOperation(c21520175.fsoperation) e0:SetOperation(s.fsoperation)
c:RegisterEffect(e0)]] c:RegisterEffect(e0)]]
--spsummon condition --spsummon condition
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c21520175.splimit) e0:SetValue(s.splimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
...@@ -24,8 +26,8 @@ function c21520175.initial_effect(c) ...@@ -24,8 +26,8 @@ function c21520175.initial_effect(c)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520175.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520175.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--attribute --attribute
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -39,13 +41,13 @@ function c21520175.initial_effect(c) ...@@ -39,13 +41,13 @@ function c21520175.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MATERIAL_CHECK) e4:SetCode(EFFECT_MATERIAL_CHECK)
e4:SetValue(c21520175.matcheck) e4:SetValue(s.matcheck)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--[[ local e5=Effect.CreateEffect(c) --[[ local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(c21520175.regcon) e5:SetCondition(s.regcon)
e5:SetOperation(c21520175.regop) e5:SetOperation(s.regop)
e5:SetLabelObject(e4) e5:SetLabelObject(e4)
c:RegisterEffect(e5)--]] c:RegisterEffect(e5)--]]
--can not be effect target --can not be effect target
...@@ -58,36 +60,36 @@ function c21520175.initial_effect(c) ...@@ -58,36 +60,36 @@ function c21520175.initial_effect(c)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--draw --draw
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(21520175,3)) e7:SetDescription(aux.Stringid(id,3))
e7:SetCategory(CATEGORY_DAMAGE+CATEGORY_DRAW) e7:SetCategory(CATEGORY_DAMAGE+CATEGORY_DRAW)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e7:SetCode(EVENT_TO_GRAVE) e7:SetCode(EVENT_TO_GRAVE)
e7:SetCondition(c21520175.drcon) e7:SetCondition(s.drcon)
-- e7:SetCost(c21520175.drcost) -- e7:SetCost(s.drcost)
e7:SetTarget(c21520175.drtg) e7:SetTarget(s.drtg)
e7:SetOperation(c21520175.drop) e7:SetOperation(s.drop)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function c21520175.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520175.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520175.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520175.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
local g1=Duel.GetMatchingGroup(c21520175.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520175,0),aux.Stringid(21520175,1),aux.Stringid(21520175,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520175,1),aux.Stringid(21520175,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -114,7 +116,7 @@ function c21520175.ccost(e,tp) ...@@ -114,7 +116,7 @@ function c21520175.ccost(e,tp)
Duel.Destroy(e:GetHandler(),REASON_RULE) Duel.Destroy(e:GetHandler(),REASON_RULE)
end end
end end
function c21520175.matcheck(e,c) function s.matcheck(e,c)
-- local g=c:GetMaterial() -- local g=c:GetMaterial()
-- e:SetLabel(g:GetClassCount(Card.GetOriginalCode)) -- e:SetLabel(g:GetClassCount(Card.GetOriginalCode))
local ct=c:GetMaterialCount() local ct=c:GetMaterialCount()
...@@ -128,10 +130,10 @@ function c21520175.matcheck(e,c) ...@@ -128,10 +130,10 @@ function c21520175.matcheck(e,c)
de:SetCode(EFFECT_SET_BASE_DEFENSE) de:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(de) c:RegisterEffect(de)
end end
function c21520175.regcon(e,tp,eg,ep,ev,re,r,rp) function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520175.regop(e,tp,eg,ep,ev,re,r,rp) function s.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel() local ct=e:GetLabelObject():GetLabel()
local c=e:GetHandler() local c=e:GetHandler()
local ae=Effect.CreateEffect(c) local ae=Effect.CreateEffect(c)
...@@ -144,11 +146,11 @@ function c21520175.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -144,11 +146,11 @@ function c21520175.regop(e,tp,eg,ep,ev,re,r,rp)
de:SetCode(EFFECT_UPDATE_DEFENSE) de:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(de) c:RegisterEffect(de)
end end
function c21520175.drcon(e,tp,eg,ep,ev,re,r,rp) function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) --and c:IsReason(REASON_BATTLE) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) --and c:IsReason(REASON_BATTLE)
end end
function c21520175.drcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if e:GetHandler():IsStatus(STATUS_SPSUMMON_TURN) then if e:GetHandler():IsStatus(STATUS_SPSUMMON_TURN) then
return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==1 return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==1
...@@ -170,40 +172,40 @@ function c21520175.drcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -170,40 +172,40 @@ function c21520175.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
e3:SetCode(EFFECT_CANNOT_MSET) e3:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
end end
function c21520175.drfilter(c) function s.drfilter(c)
return c:IsSetCard(0x490) and c:IsFaceup() return c:IsSetCard(0x490) and c:IsFaceup()
end end
function c21520175.fcfilter(c) function s.fcfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520175.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local gc=Duel.GetMatchingGroupCount(c21520175.drfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil) local gc=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local h=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) local h=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local fchk=Duel.GetMatchingGroupCount(c21520175.fcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local fchk=Duel.GetMatchingGroupCount(s.fcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local d=gc*100 local d=gc*100
if fchk>0 then d=d*(2^fchk) end if fchk>0 then d=d*(2^fchk) end
local ops=Duel.SelectOption(tp,aux.Stringid(21520175,3),aux.Stringid(21520175,4)) local ops=Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))
e:SetLabel(ops) e:SetLabel(ops)
if ops==0 then if ops==0 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520175,3)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,3))
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(d) Duel.SetTargetParam(d)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,d) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,d)
elseif ops==1 then elseif ops==1 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520175,4)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,4))
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(3-h) Duel.SetTargetParam(3-h)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3-h) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3-h)
end end
end end
function c21520175.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ops=e:GetLabel() local ops=e:GetLabel()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local fchk=Duel.GetMatchingGroupCount(c21520175.fcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local fchk=Duel.GetMatchingGroupCount(s.fcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if ops==0 then if ops==0 then
local gc=Duel.GetMatchingGroupCount(c21520175.drfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)*100 local gc=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)*100
if fchk>0 then gc=gc*(2^fchk) end if fchk>0 then gc=gc*(2^fchk) end
Duel.Damage(p,gc,REASON_EFFECT) Duel.Damage(p,gc,REASON_EFFECT)
elseif ops==1 then elseif ops==1 then
...@@ -211,22 +213,22 @@ function c21520175.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -211,22 +213,22 @@ function c21520175.drop(e,tp,eg,ep,ev,re,r,rp)
if hc>=3 then return end if hc>=3 then return end
Duel.Draw(p,3-hc,REASON_EFFECT) Duel.Draw(p,3-hc,REASON_EFFECT)
local hg=Duel.GetFieldGroup(1-p,LOCATION_HAND,0) local hg=Duel.GetFieldGroup(1-p,LOCATION_HAND,0)
if fchk<=0 and hg:GetCount()>0 and Duel.SelectYesNo(1-p,aux.Stringid(21520175,5)) then if fchk<=0 and hg:GetCount()>0 and Duel.SelectYesNo(1-p,aux.Stringid(id,5)) then
Duel.Hint(HINT_CARD,p,21520175) Duel.Hint(HINT_CARD,p,id)
Duel.SendtoGrave(hg,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(hg,REASON_EFFECT+REASON_DISCARD)
Duel.Draw(1-p,3-Duel.GetFieldGroupCount(1-p,LOCATION_HAND,0),REASON_EFFECT) Duel.Draw(1-p,3-Duel.GetFieldGroupCount(1-p,LOCATION_HAND,0),REASON_EFFECT)
end end
end end
end end
function c21520175.sefilter(c) function s.sefilter(c)
return c:IsFusionSetCard(0x490) and c:IsFusionType(TYPE_MONSTER) return c:IsFusionSetCard(0x490) and c:IsFusionType(TYPE_MONSTER)
end end
function c21520175.fscondition(e,g,gc,chkf) function s.fscondition(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
if gc then return false end if gc then return false end
return g:IsExists(c21520175.sefilter,3,nil) return g:IsExists(s.sefilter,3,nil)
end end
function c21520175.fsoperation(e,tp,eg,ep,ev,re,r,rp,gc) function s.fsoperation(e,tp,eg,ep,ev,re,r,rp,gc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
Duel.SetFusionMaterial(eg:FilterSelect(tp,c21520175.sefilter,3,100,nil)) Duel.SetFusionMaterial(eg:FilterSelect(tp,s.sefilter,3,100,nil))
end end
--塑形 --塑形
function c21520176.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
...@@ -7,9 +8,9 @@ function c21520176.initial_effect(c) ...@@ -7,9 +8,9 @@ function c21520176.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_COUNT_LIMIT) e1:SetProperty(EFFECT_FLAG_COUNT_LIMIT)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
-- e1:SetCountLimit(1) -- e1:SetCountLimit(1)
e1:SetCondition(c21520176.spcon) e1:SetCondition(s.spcon)
e1:SetTarget(c21520176.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(c21520176.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -19,27 +20,27 @@ function c21520176.initial_effect(c) ...@@ -19,27 +20,27 @@ function c21520176.initial_effect(c)
-- e2:SetProperty(EFFECT_FLAG_COUNT_LIMIT) -- e2:SetProperty(EFFECT_FLAG_COUNT_LIMIT)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCondition(c21520176.thcon) e2:SetCondition(s.thcon)
e2:SetCost(c21520176.thcost) e2:SetCost(s.thcost)
e2:SetTarget(c21520176.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(c21520176.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21520176.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x490) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x490) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c21520176.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity() return Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity()
end end
function c21520176.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c21520176.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c21520176.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c21520176.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummonStep(g:GetFirst(),0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(g:GetFirst(),0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -48,57 +49,57 @@ function c21520176.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,57 +49,57 @@ function c21520176.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
g:GetFirst():RegisterEffect(e1,true) g:GetFirst():RegisterEffect(e1,true)
g:GetFirst():RegisterFlagEffect(21520176,RESET_EVENT+0x1fe0000,0,1) g:GetFirst():RegisterFlagEffect(id,RESET_EVENT+0x1fe0000,0,1)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(g:GetFirst()) e2:SetLabelObject(g:GetFirst())
e2:SetCondition(c21520176.descon) e2:SetCondition(s.descon)
e2:SetOperation(c21520176.desop) e2:SetOperation(s.desop)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
end end
function c21520176.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if tc:GetFlagEffect(21520176)~=0 then if tc:GetFlagEffect(id)~=0 then
return true return true
else else
e:Reset() e:Reset()
return false return false
end end
end end
function c21520176.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end end
function c21520176.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x490) and c:IsAbleToRemove() return c:IsSetCard(0x490) and c:IsAbleToRemove()
end end
function c21520176.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520176.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(Card.IsAbleToRemoveAsCost,tp,LOCATION_DECK,0,nil)>0 end if chk==0 then return Duel.GetMatchingGroupCount(Card.IsAbleToRemoveAsCost,tp,LOCATION_DECK,0,nil)>0 end
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
local tf=0 local tf=0
if g:GetFirst():IsSetCard(0x490) then tf=1 end if g:GetFirst():IsSetCard(0x490) and g:GetFirst():IsType(TYPE_MONSTER) then tf=1 end
e:SetLabel(tf) e:SetLabel(tf)
end end
function c21520176.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
-- if chk==0 then return e:GetHandler():IsAbleToHand() and Duel.IsExistingMatchingCard(c21520176.thfilter,tp,LOCATION_DECK,0,1,nil) end -- if chk==0 then return e:GetHandler():IsAbleToHand() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return e:GetHandler():IsAbleToHand() end if chk==0 then return e:GetHandler():IsAbleToHand() end
local tf=e:GetLabel() local tf=e:GetLabel()
if tf==1 then Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,LOCATION_GRAVE) end if tf==1 then Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,LOCATION_GRAVE) end
end end
function c21520176.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tf=e:GetLabel() local tf=e:GetLabel()
-- if c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(c21520176.thfilter,tp,LOCATION_DECK,0,1,nil) then -- if c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) then
if tf==1 then if tf==1 then
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
......
--扭曲揉合 --扭曲揉合
function c21520177.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetDescription(aux.Stringid(21520177,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,21520177) e1:SetCountLimit(1,id)
e1:SetCondition(c21520177.condition) e1:SetCondition(s.condition)
e1:SetCost(c21520177.cost) e1:SetCost(s.cost)
e1:SetTarget(c21520177.target) e1:SetTarget(s.target)
e1:SetOperation(c21520177.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND)
e2:SetDescription(aux.Stringid(21520177,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c21520177.thcon) e2:SetCondition(s.thcon)
e2:SetTarget(c21520177.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(c21520177.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21520177.filter1(c,e,tp) function s.filter1(c,e,tp)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end end
function c21520177.filter2(c,e,tp,m,f,chkf) function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x3490) return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x3490)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c21520177.filter0(c,e,tp,m,f,chkf) function s.filter0(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x490) return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x490)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c21520177.tdfilter(c) function s.tdfilter(c)
-- return (not c:IsSetCard(0x490) and not c:IsDisabled() and (not c:IsType(TYPE_NORMAL) or bit.band(c:GetOriginalType(),TYPE_EFFECT)~=0)) or not c:IsFaceup() -- return (not c:IsSetCard(0x490) and not c:IsDisabled() and (not c:IsType(TYPE_NORMAL) or bit.band(c:GetOriginalType(),TYPE_EFFECT)~=0)) or not c:IsFaceup()
return not c:IsSetCard(0x490) or not c:IsFaceup() return not c:IsSetCard(0x490) or not c:IsFaceup()
end end
function c21520177.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 return Duel.GetTurnPlayer()==tp and Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0
end end
function c21520177.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 end if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 end
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -57,16 +58,16 @@ function c21520177.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -57,16 +58,16 @@ function c21520177.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e2:SetCode(EFFECT_CANNOT_MSET) e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
function c21520177.cfilter(c) function s.cfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA return c:GetSummonLocation()==LOCATION_EXTRA
end end
function c21520177.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetMatchingGroup(c21520177.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,nil,e,tp) local mg1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
local res=Duel.IsExistingMatchingCard(c21520177.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if Duel.IsExistingMatchingCard(c21520177.cfilter,tp,0,LOCATION_MZONE,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then
res=Duel.IsExistingMatchingCard(c21520177.filter0,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) res=Duel.IsExistingMatchingCard(s.filter0,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
end end
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -74,9 +75,9 @@ function c21520177.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -74,9 +75,9 @@ function c21520177.target(e,tp,eg,ep,ev,re,r,rp,chk)
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp) local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c21520177.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
if Duel.IsExistingMatchingCard(c21520177.cfilter,tp,0,LOCATION_MZONE,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then
res=Duel.IsExistingMatchingCard(c21520177.filter0,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) res=Duel.IsExistingMatchingCard(s.filter0,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end end
end end
end end
...@@ -84,24 +85,24 @@ function c21520177.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -84,24 +85,24 @@ function c21520177.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c21520177.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local chkf=tp local chkf=tp
local mg1=Duel.GetMatchingGroup(c21520177.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,nil,e,tp) local mg1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
local sg1=Duel.GetMatchingGroup(c21520177.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
if Duel.IsExistingMatchingCard(c21520177.cfilter,tp,0,LOCATION_MZONE,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then
sg1=Duel.GetMatchingGroup(c21520177.filter0,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) sg1=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
end end
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp) mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c21520177.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
if Duel.IsExistingMatchingCard(c21520177.cfilter,tp,0,LOCATION_MZONE,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil) then
sg2=Duel.GetMatchingGroup(c21520177.filter0,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) sg2=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end end
end end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
...@@ -126,31 +127,31 @@ function c21520177.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -126,31 +127,31 @@ function c21520177.activate(e,tp,eg,ep,ev,re,r,rp)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PRE_BATTLE_DAMAGE) e4:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e4:SetCondition(c21520177.rdcon) e4:SetCondition(s.rdcon)
e4:SetOperation(c21520177.rdop) e4:SetOperation(s.rdop)
e4:SetReset(RESET_EVENT+0x1fe0000) e4:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e4) tc:RegisterEffect(e4)
end end
-- local tdg=Duel.GetMatchingGroup(c21520177.tdfilter,tp,LOCATION_MZONE,0,nil) -- local tdg=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_MZONE,0,nil)
-- Duel.SendtoDeck(tdg,nil,2,REASON_RULE) -- Duel.SendtoDeck(tdg,nil,2,REASON_RULE)
end end
function c21520177.rdcon(e,tp,eg,ep,ev,re,r,rp) function s.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep~=tp
end end
function c21520177.rdop(e,tp,eg,ep,ev,re,r,rp) function s.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2) Duel.ChangeBattleDamage(ep,ev/2)
end end
function c21520177.thfilter(c,tp) function s.thfilter(c,tp)
return c:IsSetCard(0x490) and c:IsType(TYPE_FUSION) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) return c:IsSetCard(0x490) and c:IsType(TYPE_FUSION) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
end end
function c21520177.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c21520177.thfilter,1,nil,tp) and bit.band(r,REASON_DESTROY)~=0 return eg:IsExists(s.thfilter,1,nil,tp) and bit.band(r,REASON_DESTROY)~=0
end end
function c21520177.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end end
function c21520177.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
......
--折合拆分 --折合拆分
function c21520178.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21520178,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c21520178.target) e1:SetTarget(s.target)
e1:SetOperation(c21520178.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to field --to field
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520178,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_LEAVE_GRAVE) e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
-- e2:SetCondition(aux.exccon) -- e2:SetCondition(aux.exccon)
e2:SetCost(c21520178.sscost) e2:SetCost(s.sscost)
e2:SetTarget(c21520178.sstg) e2:SetTarget(s.sstg)
e2:SetOperation(c21520178.ssop) e2:SetOperation(s.ssop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21520178.thfilter(c,e,tp) function s.thfilter(c,e,tp)
local lv=c:GetLevel() local lv=c:GetLevel()
return c:IsFaceup() and c:IsAbleToHand() and c:IsSetCard(0x490) return c:IsFaceup() and c:IsAbleToHand() and c:IsSetCard(0x490)
and Duel.IsExistingMatchingCard(c21520178.spfilter,tp,LOCATION_DECK,0,1,nil,lv,e,tp,c) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,lv,e,tp,c)
end end
function c21520178.spfilter(c,lv,e,tp,tc) function s.spfilter(c,lv,e,tp,tc)
if tc:IsSetCard(0x5490) then if tc:IsSetCard(0x5490) then
return c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x490) and not c:IsSetCard(0x5490) return c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x490) and not c:IsSetCard(0x5490)
else else
return c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x5490) return c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x5490)
end end
end end
function c21520178.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c21520178.thfilter(chkc) end if chkc then return chkc:IsFaceup() and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.thfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c21520178.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c21520178.thfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c21520178.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
Duel.SendtoHand(tc,tp,REASON_EFFECT) Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c21520178.spfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetLevel(),e,tp,tc) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetLevel(),e,tp,tc)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c21520178.sscost(e,tp,eg,ep,ev,re,r,rp,chk) function s.sscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c21520178.ssfilter(c) function s.ssfilter(c)
return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER)
end end
function c21520178.sstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520178.ssfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end if chk==0 then return Duel.IsExistingMatchingCard(s.ssfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end end
function c21520178.ssop(e,tp,eg,ep,ev,re,r,rp) function s.ssop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end if ft<=0 then return end
local g=Duel.GetMatchingGroup(c21520178.ssfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(s.ssfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()<=0 then return end if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local ct=Duel.SelectOption(tp,aux.Stringid(21520178,2),aux.Stringid(21520178,3)) local ct=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
local typ=0 local typ=0
if ct==0 then typ=TYPE_SPELL+TYPE_CONTINUOUS if ct==0 then typ=TYPE_SPELL+TYPE_CONTINUOUS
else typ=TYPE_TRAP+TYPE_CONTINUOUS end else typ=TYPE_TRAP+TYPE_CONTINUOUS end
...@@ -80,7 +81,7 @@ function c21520178.ssop(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +81,7 @@ function c21520178.ssop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(tg) do for tc in aux.Next(tg) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(21520178,ct+2)) e1:SetDescription(aux.Stringid(id,ct+2))
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
......
--揉合成形 --揉合成形
function c21520179.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21520179,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TODECK) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,21520179) e1:SetCountLimit(1,id)
e1:SetTarget(c21520179.target) e1:SetTarget(s.target)
e1:SetOperation(c21520179.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520179,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW) e2:SetCategory(CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c21520179.drcon) e2:SetCondition(s.drcon)
e2:SetTarget(c21520179.drtg) e2:SetTarget(s.drtg)
e2:SetOperation(c21520179.drop) e2:SetOperation(s.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c21520179.filter1(c,e,tp) function s.filter1(c,e,tp)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) and c:IsAbleToDeck() return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
end end
function c21520179.filter2(c,e,tp,m,f,chkf) function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x490) and Duel.GetMZoneCount(tp,m)>0 return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x490) and Duel.GetMZoneCount(tp,m)>0
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,true,true) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,true,true) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c21520179.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetMatchingGroup(c21520179.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp) local mg1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
local res=Duel.IsExistingMatchingCard(c21520179.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg1,nil,chkf)
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp) local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c21520179.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg2,mf,chkf) res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg2,mf,chkf)
end end
end end
return res return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function c21520179.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetMatchingGroup(c21520179.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp) local mg1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
local sg1=Duel.GetMatchingGroup(c21520179.filter2,tp,LOCATION_GRAVE,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_GRAVE,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -58,7 +59,7 @@ function c21520179.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,7 +59,7 @@ function c21520179.activate(e,tp,eg,ep,ev,re,r,rp)
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp) mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c21520179.filter2,tp,LOCATION_GRAVE,0,nil,e,tp,mg2,mf,chkf) sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_GRAVE,0,nil,e,tp,mg2,mf,chkf)
end end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone() local sg=sg1:Clone()
...@@ -91,16 +92,16 @@ function c21520179.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,16 +92,16 @@ function c21520179.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c21520179.drcon(e,tp,eg,ep,ev,re,r,rp) function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN) and bit.band(r,REASON_EFFECT)==REASON_EFFECT return not e:GetHandler():IsReason(REASON_RETURN) and bit.band(r,REASON_EFFECT)==REASON_EFFECT
end end
function c21520179.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) end if chk==0 then return Duel.IsPlayerCanDraw(tp) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1) Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c21520179.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
--镜面结合 --镜面结合
function c21520180.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21520180,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
-- e1:SetCountLimit(1,21520180) -- e1:SetCountLimit(1,id)
e1:SetTarget(c21520180.target) e1:SetTarget(s.target)
e1:SetOperation(c21520180.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--fusion summon --fusion summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520180,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_REMOVE) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,21520180) e2:SetCountLimit(1,id)
e2:SetCost(c21520180.fscost) e2:SetCost(s.fscost)
e2:SetTarget(c21520180.fstg) e2:SetTarget(s.fstg)
e2:SetOperation(c21520180.fsop) e2:SetOperation(s.fsop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--[[ --silence --[[ --silence
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520180,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetProperty(EFFECT_FLAG_CLIENT_HINT) e3:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCondition(c21520180.actcon) e3:SetCondition(s.actcon)
e3:SetOperation(c21520180.actop) e3:SetOperation(s.actop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e3_2=e3:Clone() local e3_2=e3:Clone()
e3_2:SetCode(EVENT_BE_BATTLE_TARGET) e3_2:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e3_2)--]] c:RegisterEffect(e3_2)--]]
end end
function c21520180.tgfilter(c) function s.tgfilter(c)
return c:IsSetCard(0x490) and c:IsCanBeEffectTarget() and c:IsFaceup() and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x490) and c:IsCanBeEffectTarget() and c:IsFaceup() and c:IsType(TYPE_MONSTER)
end end
function c21520180.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsSetCard(0x490) end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsSetCard(0x490) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,nil,0,0x11,0,0,nil,RACE_FIEND,ATTRIBUTE_DARK) and Duel.IsPlayerCanSpecialSummonMonster(tp,nil,0,0x11,0,0,nil,RACE_FIEND,ATTRIBUTE_DARK) and
Duel.IsExistingMatchingCard(c21520180.tgfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=Duel.SelectTarget(tp,c21520180.tgfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) local sg=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,1,0,0)
end end
function c21520180.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local ec=Duel.GetFirstTarget() local ec=Duel.GetFirstTarget()
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and if c:IsRelateToEffect(e) and
...@@ -89,17 +90,17 @@ function c21520180.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -89,17 +90,17 @@ function c21520180.activate(e,tp,eg,ep,ev,re,r,rp)
--[[ e8:SetType(EFFECT_TYPE_SINGLE) --[[ e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) e8:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB)
e8:SetProperty(EFFECT_FLAG_UNCOPYABLE) e8:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e8:SetCondition(c21520180.repcon) e8:SetCondition(s.repcon)
e8:SetOperation(c21520180.repop) e8:SetOperation(s.repop)
c:RegisterEffect(e8)--]] c:RegisterEffect(e8)--]]
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
end end
end end
function c21520180.repcon(e) function s.repcon(e)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY) return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY)
end end
function c21520180.repop(e,tp,eg,ep,ev,re,r,rp) function s.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
...@@ -109,28 +110,28 @@ function c21520180.repop(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,28 +110,28 @@ function c21520180.repop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c21520180.fmfilter(c,e) function s.fmfilter(c,e)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end end
function c21520180.fsfilter(c,e,tp,mg) function s.fsfilter(c,e,tp,mg)
return c:IsSetCard(0x490) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) return c:IsSetCard(0x490) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
and c:CheckFusionMaterial(mg) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0 and c:CheckFusionMaterial(mg) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end end
function c21520180.fscost(e,tp,eg,ep,ev,re,r,rp,chk) function s.fscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c21520180.fstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetMatchingGroup(c21520180.fmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(s.fmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e)
return Duel.GetLocationCountFromEx(tp)>0 return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c21520180.fsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg) end and Duel.IsExistingMatchingCard(s.fsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c21520180.fsop(e,tp,eg,ep,ev,re,r,rp) function s.fsop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end if Duel.GetLocationCountFromEx(tp)<=0 then return end
local mg=Duel.GetMatchingGroup(c21520180.fmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e) local mg=Duel.GetMatchingGroup(s.fmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,e)
local sg=Duel.GetMatchingGroup(c21520180.fsfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg) local sg=Duel.GetMatchingGroup(s.fsfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg)
if sg:GetCount()>0 then if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
...@@ -143,21 +144,21 @@ function c21520180.fsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -143,21 +144,21 @@ function c21520180.fsop(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
function c21520180.actcon(e,tp,eg,ep,ev,re,r,rp) function s.actcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
return tc and tc:IsControler(tp) and tc:IsSetCard(0x490) return tc and tc:IsControler(tp) and tc:IsSetCard(0x490)
end end
function c21520180.actop(e,tp,eg,ep,ev,re,r,rp) function s.actop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1) e1:SetTargetRange(0,1)
e1:SetValue(c21520180.aclimit) e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE) e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c21520180.aclimit(e,re,tp) function s.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e) return not re:GetHandler():IsImmuneToEffect(e)
end end
--奇形异阵 --奇形异阵
function c21520181.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--active --active
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
...@@ -7,37 +8,37 @@ function c21520181.initial_effect(c) ...@@ -7,37 +8,37 @@ function c21520181.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520181,0)) e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
-- e2:SetCountLimit(1,21520181) -- e2:SetCountLimit(1,id)
e2:SetCondition(c21520181.thcon) e2:SetCondition(s.thcon)
e2:SetTarget(c21520181.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(c21520181.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--[[ --draw --[[ --draw
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520181,1)) e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e3:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK) e3:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CHANGE_POS) e3:SetCode(EVENT_CHANGE_POS)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,21520181) e3:SetCountLimit(1,id)
e3:SetCondition(c21520181.drcon) e3:SetCondition(s.drcon)
e3:SetTarget(c21520181.drtg) e3:SetTarget(s.drtg)
e3:SetOperation(c21520181.drop) e3:SetOperation(s.drop)
c:RegisterEffect(e3)--]] c:RegisterEffect(e3)--]]
--replace --replace
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EFFECT_SEND_REPLACE) e4:SetCode(EFFECT_SEND_REPLACE)
e4:SetRange(LOCATION_FZONE) e4:SetRange(LOCATION_FZONE)
e4:SetTarget(c21520181.reptg) e4:SetTarget(s.reptg)
e4:SetValue(c21520181.repval) e4:SetValue(s.repval)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--atk & def --atk & def
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
...@@ -46,49 +47,50 @@ function c21520181.initial_effect(c) ...@@ -46,49 +47,50 @@ function c21520181.initial_effect(c)
e5:SetRange(LOCATION_FZONE) e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_MZONE,0) e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x490)) e5:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x490))
e5:SetValue(c21520181.adval) e5:SetValue(s.adval)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e5_2=e5:Clone() local e5_2=e5:Clone()
e5_2:SetCode(EFFECT_UPDATE_DEFENSE) e5_2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5_2) c:RegisterEffect(e5_2)
end end
function c21520181.confilter(c,tp) function s.confilter(c,tp)
return c:IsSetCard(0x490) and c:GetPreviousControler()==tp and c:GetPreviousLocation()==LOCATION_MZONE return (c:IsSetCard(0x490) or c:IsPreviousSetCard(0x490)) and c:GetPreviousControler()==tp and (c:GetPreviousLocation()==LOCATION_MZONE or c:GetPreviousLocation()==LOCATION_SZONE)
end end
function c21520181.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x490) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x490) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end end
function c21520181.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c21520181.confilter,1,nil,tp) return eg:IsExists(s.confilter,1,nil,tp)
end end
function c21520181.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520181.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c21520181.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
if not (e:GetHandler():IsOnField() and e:GetHandler():IsFaceup()) then return end if not (e:GetHandler():IsOnField() and e:GetHandler():IsFaceup()) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c21520181.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c21520181.repfilter(c,tp) function s.repfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsReason(REASON_DESTROY) return c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and c:IsReason(REASON_DESTROY)
and c:IsSetCard(0x490) and c:GetControler()==tp and c:IsLevelBelow(10) and not c:IsType(TYPE_FUSION) and c:GetOriginalCode()~=21520180 and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER and c:IsSetCard(0x490) and c:GetControler()==tp
end end
function c21520181.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local count=eg:FilterCount(c21520181.repfilter,nil,tp) local count=eg:FilterCount(s.repfilter,nil,tp)
return count>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=count return count>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=count
end end
if Duel.SelectYesNo(tp,aux.Stringid(21520181,1)) then if Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
local reptype=nil local reptype=nil
local ct=0 local ct=0
local g=eg:Filter(c21520181.repfilter,nil,tp) local g=eg:Filter(s.repfilter,nil,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
Duel.DisableSelfDestroyCheck()
while tc do while tc do
if tc:IsSetCard(0x5490) then if tc:IsSetCard(0x5490) then
reptype=TYPE_SPELL+TYPE_CONTINUOUS reptype=TYPE_SPELL+TYPE_CONTINUOUS
...@@ -100,7 +102,7 @@ function c21520181.reptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -100,7 +102,7 @@ function c21520181.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
tc:CancelToGrave() tc:CancelToGrave()
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(tc)
e1:SetDescription(aux.Stringid(21520181,ct)) e1:SetDescription(aux.Stringid(id,ct))
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
...@@ -111,39 +113,40 @@ function c21520181.reptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -111,39 +113,40 @@ function c21520181.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext() tc=g:GetNext()
end end
Duel.DisableSelfDestroyCheck(false)
Duel.RaiseEvent(eg,EVENT_DESTROYED,re,r,rp,ep,ev) Duel.RaiseEvent(eg,EVENT_DESTROYED,re,r,rp,ep,ev)
-- Duel.RaiseEvent(g,EVENT_DESTROYED,e,0,0,0,0) -- Duel.RaiseEvent(g,EVENT_DESTROYED,e,0,0,0,0)
return true return true
else return false end else return false end
end end
function c21520181.repval(e,c) function s.repval(e,c)
-- return true -- return true
return c:IsSetCard(0x490) and c:GetControler()==e:GetHandlerPlayer() and c:IsLevelBelow(10) and not c:IsType(TYPE_FUSION) return c:IsSetCard(0x490) and c:GetControler()==e:GetHandlerPlayer() and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER
end end
function c21520181.adfilter(c) function s.adfilter(c)
return c:IsSetCard(0x490) and c:IsFaceup() return c:IsSetCard(0x490) and c:IsFaceup()
end end
function c21520181.adval(e,c) function s.adval(e,c)
return Duel.GetMatchingGroupCount(c21520181.adfilter,c:GetControler(),LOCATION_SZONE,0,nil)*300 return Duel.GetMatchingGroupCount(s.adfilter,c:GetControler(),LOCATION_SZONE,0,nil)*300
end end
--[[ --[[
function c21520181.drfilter(c,tp) function s.drfilter(c,tp)
return c:IsSetCard(0x490) and c:IsControler(tp) and ((c:IsPreviousPosition(POS_FACEUP_ATTACK) and c:IsPosition(POS_FACEUP_DEFENSE)) return c:IsSetCard(0x490) and c:IsControler(tp) and ((c:IsPreviousPosition(POS_FACEUP_ATTACK) and c:IsPosition(POS_FACEUP_DEFENSE))
or (c:IsPreviousPosition(POS_FACEUP_DEFENSE) and c:IsPosition(POS_FACEUP_ATTACK))) or (c:IsPreviousPosition(POS_FACEUP_DEFENSE) and c:IsPosition(POS_FACEUP_ATTACK)))
end end
function c21520181.drcon(e,tp,eg,ep,ev,re,r,rp) function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c21520181.drfilter,1,nil,tp) return eg:IsExists(s.drfilter,1,nil,tp)
end end
function c21520181.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) end if chk==0 then return Duel.IsPlayerCanDraw(tp) end
Duel.SetOperationInfo(0,CATEGORY_DRAW+CATEGORY_TODECK,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_DRAW+CATEGORY_TODECK,nil,0,tp,0)
end end
function c21520181.dfilter(c) function s.dfilter(c)
return c:IsSetCard(0x490) and c:IsFaceup() return c:IsSetCard(0x490) and c:IsFaceup()
end end
function c21520181.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
if not (e:GetHandler():IsOnField() and e:GetHandler():IsFaceup()) then return end if not (e:GetHandler():IsOnField() and e:GetHandler():IsFaceup()) then return end
local ct=Duel.GetMatchingGroupCount(c21520181.dfilter,tp,LOCATION_MZONE,0,nil) local ct=Duel.GetMatchingGroupCount(s.dfilter,tp,LOCATION_MZONE,0,nil)
local dc=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local dc=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if dc<ct then return end if dc<ct then return end
Duel.Draw(tp,ct,REASON_EFFECT) Duel.Draw(tp,ct,REASON_EFFECT)
......
--幻形魔-昂千德 --幻形魔-昂千德
function c21520182.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
c:EnableReviveLimit() c:EnableReviveLimit()
--fusion material --fusion material
aux.AddFusionProcMixRep(c,false,false,c21520182.sefilter,3,200) aux.AddFusionProcMixRep(c,false,false,s.sefilter,3,200)
--spsummon condition --spsummon condition
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c21520182.splimit) e0:SetValue(s.splimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--cost --cost
local e00=Effect.CreateEffect(c) local e00=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e00:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e00:SetDescription(aux.Stringid(21520182,4)) e00:SetDescription(aux.Stringid(id,4))
e00:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e00:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e00:SetCode(EVENT_PHASE+PHASE_END) e00:SetCode(EVENT_PHASE+PHASE_END)
e00:SetCountLimit(1) e00:SetCountLimit(1)
e00:SetRange(LOCATION_MZONE) e00:SetRange(LOCATION_MZONE)
e00:SetCondition(c21520182.ccon) e00:SetCondition(s.ccon)
e00:SetOperation(c21520182.ccost) e00:SetOperation(s.ccost)
c:RegisterEffect(e00) c:RegisterEffect(e00)
--attribute --attribute
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -34,25 +36,25 @@ function c21520182.initial_effect(c) ...@@ -34,25 +36,25 @@ function c21520182.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MATERIAL_CHECK) e4:SetCode(EFFECT_MATERIAL_CHECK)
e4:SetValue(c21520182.matcheck) e4:SetValue(s.matcheck)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--[[ local e5=Effect.CreateEffect(c) --[[ local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(c21520182.regcon) e5:SetCondition(s.regcon)
e5:SetOperation(c21520182.regop) e5:SetOperation(s.regop)
e5:SetLabelObject(e4) e5:SetLabelObject(e4)
c:RegisterEffect(e5)--]] c:RegisterEffect(e5)--]]
--copy --copy
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_QUICK_O) e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetDescription(aux.Stringid(21520182,3)) e6:SetDescription(aux.Stringid(id,3))
e6:SetProperty(EFFECT_FLAG_CARD_TARGET) e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetCode(EVENT_FREE_CHAIN) e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1,21520182) e6:SetCountLimit(1,id)
e6:SetTarget(c21520182.cptg) e6:SetTarget(s.cptg)
e6:SetOperation(c21520182.cpop) e6:SetOperation(s.cpop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--draw --draw
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
...@@ -60,29 +62,29 @@ function c21520182.initial_effect(c) ...@@ -60,29 +62,29 @@ function c21520182.initial_effect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e7:SetCode(EVENT_TO_GRAVE) e7:SetCode(EVENT_TO_GRAVE)
e7:SetCondition(c21520182.drcon) e7:SetCondition(s.drcon)
e7:SetTarget(c21520182.drtg) e7:SetTarget(s.drtg)
e7:SetOperation(c21520182.drop) e7:SetOperation(s.drop)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function c21520182.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520182.cfilter1(c) function s.cfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic()
end end
function c21520182.ccon(e,tp,eg,ep,ev,re,r,rp) function s.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c21520182.ccost(e,tp) function s.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end if tp~=Duel.GetTurnPlayer() then return end
local c=e:GetHandler() local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(c21520182.cfilter1,tp,LOCATION_HAND,0,nil) local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_HAND,0,nil)
local opselect=2 local opselect=2
if g1:GetCount()>0 then if g1:GetCount()>0 then
opselect=Duel.SelectOption(tp,aux.Stringid(21520182,0),aux.Stringid(21520182,1),aux.Stringid(21520182,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2))
else else
opselect=Duel.SelectOption(tp,aux.Stringid(21520182,1),aux.Stringid(21520182,2)) opselect=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
opselect=opselect+1 opselect=opselect+1
end end
if opselect==0 then if opselect==0 then
...@@ -110,39 +112,39 @@ function c21520182.ccost(e,tp) ...@@ -110,39 +112,39 @@ function c21520182.ccost(e,tp)
end end
end end
--[[ --[[
function c21520182.ffilter(c,cat,fc,race) function s.ffilter(c,cat,fc,race)
if cat~=nil and race==nil then if cat~=nil and race==nil then
return c:IsFusionSetCard(0x490) and c:IsCanBeFusionMaterial(fc) return c:IsFusionSetCard(0x490) and c:IsCanBeFusionMaterial(fc)
elseif cat==nil and race~=nil then elseif cat==nil and race~=nil then
return c:IsRace(RACE_FIEND) and c:IsCanBeFusionMaterial(fc) return c:IsRace(RACE_FIEND) and c:IsCanBeFusionMaterial(fc)
end end
end end
function c21520182.fscondition(e,g,gc,chkf) function s.fscondition(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
if gc then return false end if gc then return false end
local g1=g:Filter(c21520182.ffilter,nil,0x490,e:GetHandler(),nil) local g1=g:Filter(s.ffilter,nil,0x490,e:GetHandler(),nil)
local c1=g1:GetCount() local c1=g1:GetCount()
local g2=g:Filter(c21520182.ffilter,nil,nil,e:GetHandler(),RACE_FIEND) local g2=g:Filter(s.ffilter,nil,nil,e:GetHandler(),RACE_FIEND)
local c2=g2:GetCount() local c2=g2:GetCount()
local ag=g1:Clone() local ag=g1:Clone()
ag:Merge(g2) ag:Merge(g2)
if chkf~=PLAYER_NONE and not ag:IsExists(aux.FConditionCheckF,1,nil,chkf) then return false end if chkf~=PLAYER_NONE and not ag:IsExists(aux.FConditionCheckF,1,nil,chkf) then return false end
return c1>0 and c2>1 and ag:GetCount()>=3 return c1>0 and c2>1 and ag:GetCount()>=3
end end
function c21520182.fsoperation(e,tp,eg,ep,ev,re,r,rp,gc) function s.fsoperation(e,tp,eg,ep,ev,re,r,rp,gc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=g:Filter(c21520182.ffilter,nil,0x490,e:GetHandler(),nil) local g1=g:Filter(s.ffilter,nil,0x490,e:GetHandler(),nil)
local g2=g:Filter(c21520182.ffilter,nil,nil,e:GetHandler(),RACE_FIEND) local g2=g:Filter(s.ffilter,nil,nil,e:GetHandler(),RACE_FIEND)
local ag=g1:Clone() local ag=g1:Clone()
ag:Merge(g2) ag:Merge(g2)
local tc=nil local tc=nil
local f1=0 local f1=0
local f2=0 local f2=0
local mg=Group.CreateGroup() local mg=Group.CreateGroup()
Duel.SetFusionMaterial(eg:FilterSelect(tp,c21520182.ffilter,3,100,nil)) Duel.SetFusionMaterial(eg:FilterSelect(tp,s.ffilter,3,100,nil))
end end
]] ]]
function c21520182.matcheck(e,c) function s.matcheck(e,c)
-- local g=c:GetMaterial() -- local g=c:GetMaterial()
-- e:SetLabel(g:GetClassCount(Card.GetOriginalCode)) -- e:SetLabel(g:GetClassCount(Card.GetOriginalCode))
local ct=c:GetMaterialCount() local ct=c:GetMaterialCount()
...@@ -156,10 +158,10 @@ function c21520182.matcheck(e,c) ...@@ -156,10 +158,10 @@ function c21520182.matcheck(e,c)
de:SetCode(EFFECT_SET_BASE_DEFENSE) de:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(de) c:RegisterEffect(de)
end end
function c21520182.regcon(e,tp,eg,ep,ev,re,r,rp) function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c21520182.regop(e,tp,eg,ep,ev,re,r,rp) function s.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel() local ct=e:GetLabelObject():GetLabel()
local c=e:GetHandler() local c=e:GetHandler()
local ae=Effect.CreateEffect(c) local ae=Effect.CreateEffect(c)
...@@ -172,18 +174,18 @@ function c21520182.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -172,18 +174,18 @@ function c21520182.regop(e,tp,eg,ep,ev,re,r,rp)
de:SetCode(EFFECT_UPDATE_DEFENSE) de:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(de) c:RegisterEffect(de)
end end
function c21520182.cpfilter(c) function s.cpfilter(c)
return c:IsType(TYPE_EFFECT) and c:IsFaceup() return c:IsType(TYPE_EFFECT) and c:IsFaceup()
end end
function c21520182.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c21520182.cpfilter(chkc) end if chkc then return s.cpfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c21520182.cpfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(s.cpfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,c21520182.cpfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,e:GetHandler()) local g1=Duel.SelectTarget(tp,s.cpfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,e:GetHandler())
-- local loc=g1:GetFirst():GetLocation() -- local loc=g1:GetFirst():GetLocation()
-- Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,1,tp,loc) -- Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,1,tp,loc)
end end
function c21520182.cpop(e,tp,eg,ep,ev,re,r,rp) function s.cpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsOnField() or c:IsFacedown() then return end if not c:IsOnField() or c:IsFacedown() then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
...@@ -213,15 +215,15 @@ function c21520182.cpop(e,tp,eg,ep,ev,re,r,rp) ...@@ -213,15 +215,15 @@ function c21520182.cpop(e,tp,eg,ep,ev,re,r,rp)
-- Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) -- Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end end
end end
function c21520182.drcon(e,tp,eg,ep,ev,re,r,rp) function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)
end end
function c21520182.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end end
function c21520182.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED) local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,0,REASON_EFFECT) Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
...@@ -237,8 +239,8 @@ function c21520182.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -237,8 +239,8 @@ function c21520182.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(1-tp,1,REASON_EFFECT) Duel.Draw(1-tp,1,REASON_EFFECT)
end end
end end
if Duel.IsExistingMatchingCard(c21520182.fcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then if Duel.IsExistingMatchingCard(s.fcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
local cg=Duel.GetMatchingGroup(c21520182.cgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local cg=Duel.GetMatchingGroup(s.cgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(cg) do for tc in aux.Next(cg) do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -251,12 +253,12 @@ function c21520182.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -251,12 +253,12 @@ function c21520182.drop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c21520182.fcfilter(c) function s.fcfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520182.cgfilter(c) function s.cgfilter(c)
return (not c:IsSetCard(0x490)) and c:IsFaceup() return (not c:IsSetCard(0x490)) and c:IsFaceup()
end end
function c21520182.sefilter(c) function s.sefilter(c)
return c:IsFusionSetCard(0x490) and c:IsFusionType(TYPE_MONSTER) return c:IsFusionSetCard(0x490) and c:IsFusionType(TYPE_MONSTER)
end end
--曲形魔-克莱因 --曲形魔-克莱因
function c21520183.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,c21520183.mfilter,nil,4,99) aux.AddXyzProcedureLevelFree(c,s.mfilter,nil,4,99)
--spsummon condition --spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c21520183.splimit) e1:SetValue(s.splimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon rule --special summon rule
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -15,19 +16,19 @@ function c21520183.initial_effect(c) ...@@ -15,19 +16,19 @@ function c21520183.initial_effect(c)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_GRAVE+LOCATION_EXTRA) e2:SetRange(LOCATION_GRAVE+LOCATION_EXTRA)
e2:SetCondition(c21520183.spcon) e2:SetCondition(s.spcon)
e2:SetOperation(c21520183.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--draw --draw
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW) e3:SetCategory(CATEGORY_DRAW)
e3:SetDescription(aux.Stringid(21520183,0)) e3:SetDescription(aux.Stringid(id,0))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCost(c21520183.drcost) e3:SetCost(s.drcost)
e3:SetTarget(c21520183.drtg) e3:SetTarget(s.drtg)
e3:SetOperation(c21520183.drop) e3:SetOperation(s.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--atk & def --atk & def
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -35,7 +36,7 @@ function c21520183.initial_effect(c) ...@@ -35,7 +36,7 @@ function c21520183.initial_effect(c)
e4:SetCode(EFFECT_SET_ATTACK) e4:SetCode(EFFECT_SET_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetValue(c21520183.adval) e4:SetValue(s.adval)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=e4:Clone() local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE) e5:SetCode(EFFECT_SET_DEFENSE)
...@@ -46,18 +47,18 @@ function c21520183.initial_effect(c) ...@@ -46,18 +47,18 @@ function c21520183.initial_effect(c)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetCode(EFFECT_IMMUNE_EFFECT) e6:SetCode(EFFECT_IMMUNE_EFFECT)
e6:SetCondition(c21520183.econ) e6:SetCondition(s.econ)
e6:SetValue(c21520183.efilter) e6:SetValue(s.efilter)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--material --material
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(21520183,1)) e7:SetDescription(aux.Stringid(id,1))
e7:SetType(EFFECT_TYPE_IGNITION) e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetRange(LOCATION_MZONE) e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1,21520183) e7:SetCountLimit(1,id)
-- e7:SetCost(c21520183.cost) -- e7:SetCost(s.cost)
e7:SetTarget(c21520183.target) e7:SetTarget(s.target)
e7:SetOperation(c21520183.operation) e7:SetOperation(s.operation)
c:RegisterEffect(e7) c:RegisterEffect(e7)
--destroy replace --destroy replace
local e8=Effect.CreateEffect(c) local e8=Effect.CreateEffect(c)
...@@ -65,92 +66,92 @@ function c21520183.initial_effect(c) ...@@ -65,92 +66,92 @@ function c21520183.initial_effect(c)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetCode(EFFECT_DESTROY_REPLACE) e8:SetCode(EFFECT_DESTROY_REPLACE)
e8:SetRange(LOCATION_MZONE) e8:SetRange(LOCATION_MZONE)
e8:SetTarget(c21520183.reptg) e8:SetTarget(s.reptg)
c:RegisterEffect(e8) c:RegisterEffect(e8)
end end
function c21520183.mfilter(c,xyzc) function s.mfilter(c,xyzc)
return c:IsSetCard(0x490) return c:IsSetCard(0x490)
end end
function c21520183.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ or se:GetHandler()==e:GetHandler() return bit.band(st,SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ or se:GetHandler()==e:GetHandler()
end end
--[[ --[[
function c21520183.spfilter(c) function s.spfilter(c)
return (c:IsSetCard(0x490) or c:IsRace(RACE_FIEND)) and c:IsAbleToRemoveAsCost() and c:IsType(TYPE_MONSTER) return (c:IsSetCard(0x490) or c:IsRace(RACE_FIEND)) and c:IsAbleToRemoveAsCost() and c:IsType(TYPE_MONSTER)
end end
function c21520183.spcheck(c,sg) function s.spcheck(c,sg)
return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) and sg:FilterCount(c21520183.spcheck2,c)+1==sg:GetCount() return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) and sg:FilterCount(s.spcheck2,c)+1==sg:GetCount()
and sg:FilterCount(Card.IsSetCard,c,0x490)>=2 and sg:FilterCount(Card.IsSetCard,c,0x490)>=2
end end
function c21520183.spcheck2(c) function s.spcheck2(c)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER) return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER)
end end
function c21520183.spgoal(sg,tp,loc) function s.spgoal(sg,tp,loc)
if loc==LOCATION_EXTRA then if loc==LOCATION_EXTRA then
return Duel.GetLocationCountFromEx(tp,tp,sg)>0 and sg:IsExists(c21520183.spcheck,1,nil,sg) return Duel.GetLocationCountFromEx(tp,tp,sg)>0 and sg:IsExists(s.spcheck,1,nil,sg)
else else
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:IsExists(c21520183.spcheck,1,nil,sg) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:IsExists(s.spcheck,1,nil,sg)
end end
end end
function c21520183.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c21520183.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler()) local mg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
return mg:CheckSubGroup(c21520183.spgoal,1,nil,tp) return mg:CheckSubGroup(s.spgoal,1,nil,tp)
end end
function c21520183.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local mg=Duel.GetMatchingGroup(c21520183.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler()) local mg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cancel=Duel.GetCurrentChain()==0 local cancel=Duel.GetCurrentChain()==0
local sg=mg:SelectSubGroup(tp,c21520183.spgoal,cancel,1,nil,tp,c:GetLocation()) local sg=mg:SelectSubGroup(tp,s.spgoal,cancel,1,nil,tp,c:GetLocation())
if sg then if sg then
sg:KeepAlive() sg:KeepAlive()
e:SetLabelObject(sg) e:SetLabelObject(sg)
return true return true
else return false end else return false end
end end
function c21520183.spop(e,tp,eg,ep,ev,re,r,rp,c) function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local sg=e:GetLabelObject() local sg=e:GetLabelObject()
c:SetMaterial(sg) c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end--]] end--]]
function c21520183.spfilter(c) function s.spfilter(c)
return c:IsAbleToDeckOrExtraAsCost() and c:IsFaceup() return c:IsAbleToDeckOrExtraAsCost() and c:IsFaceup()
end end
function c21520183.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c21520183.spfilter,tp,LOCATION_REMOVED,0,nil) local mg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_REMOVED,0,nil)
return mg:FilterCount(Card.IsSetCard,nil,0x490)>=4 and Duel.GetLocationCountFromEx(tp)>0 return mg:FilterCount(Card.IsSetCard,nil,0x490)>=4 and Duel.GetLocationCountFromEx(tp)>0
end end
function c21520183.spop(e,tp,eg,ep,ev,re,r,rp,c) function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_REMOVED,0,nil) local mg=Duel.GetMatchingGroup(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_REMOVED,0,nil)
Duel.SendtoDeck(mg,nil,2,REASON_COST) Duel.SendtoDeck(mg,nil,2,REASON_COST)
end end
function c21520183.drcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c21520183.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c21520183.drop(e,tp,eg,ep,ev,re,r,rp,chk) function s.drop(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
function c21520183.adval(e,c) function s.adval(e,c)
return Duel.GetMatchingGroupCount(Card.IsFaceup,c:GetControler(),LOCATION_REMOVED,LOCATION_REMOVED,nil)*361 return Duel.GetMatchingGroupCount(Card.IsFaceup,c:GetControler(),LOCATION_REMOVED,LOCATION_REMOVED,nil)*361
end end
function c21520183.econ(e) function s.econ(e)
return e:GetHandler():GetOverlayCount()>0 return e:GetHandler():GetOverlayCount()>0
end end
function c21520183.efilter(e,te) function s.efilter(e,te)
return not te:IsActiveType(TYPE_COUNTER) and te:GetHandler()~=e:GetHandler() return not te:IsActiveType(TYPE_COUNTER) and te:GetHandler()~=e:GetHandler()
end end
function c21520183.filter(c) function s.filter(c)
return not c:IsType(TYPE_TOKEN) and c:IsAbleToChangeControler() and c:IsFaceup() return not c:IsType(TYPE_TOKEN) and c:IsAbleToChangeControler() and c:IsFaceup()
end end
function c21520183.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -159,16 +160,16 @@ function c21520183.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -159,16 +160,16 @@ function c21520183.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1) e:GetHandler():RegisterEffect(e1)
end end
function c21520183.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520183.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and e:GetHandler():IsType(TYPE_XYZ) end and e:GetHandler():IsType(TYPE_XYZ) end
end end
function c21520183.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFacedown() then return end if c:IsFacedown() then return end
local ct=c:GetOverlayCount() local ct=c:GetOverlayCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c21520183.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct+1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct+1,e:GetHandler())
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
if c:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then if c:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
...@@ -181,7 +182,7 @@ function c21520183.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -181,7 +182,7 @@ function c21520183.operation(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext() tc=g:GetNext()
end end
end end
function c21520183.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local ct=math.ceil(e:GetHandler():GetOverlayCount()/2) local ct=math.ceil(e:GetHandler():GetOverlayCount()/2)
return e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_EFFECT) end return e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_EFFECT) end
......
--艺形魔-寄居蟹 --艺形魔-章鱼
function c21520184.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
--fusion --fusion
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21520184,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,21520184) e1:SetCountLimit(1,id)
e1:SetCondition(c21520184.fscon) e1:SetCondition(s.fscon)
e1:SetCost(c21520184.fscost) e1:SetCost(s.fscost)
e1:SetTarget(c21520184.fstg) e1:SetTarget(s.fstg)
e1:SetOperation(c21520184.fsop) e1:SetOperation(s.fsop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--IMMUNE one --IMMUNE one
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520184,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,21520184) e2:SetCountLimit(1,id)
e2:SetTarget(c21520184.itg) e2:SetTarget(s.itg)
e2:SetOperation(c21520184.iop) e2:SetOperation(s.iop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_2=e2:Clone() local e2_2=e2:Clone()
e2_2:SetCode(EVENT_SPSUMMON_SUCCESS) e2_2:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -30,63 +32,63 @@ function c21520184.initial_effect(c) ...@@ -30,63 +32,63 @@ function c21520184.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
-- e3:SetProperty(EFFECT_FLAG_CLIENT_HINT) -- e3:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e3:SetDescription(aux.Stringid(21520184,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
-- e3:SetHintTiming(TIMING_BATTLE_START+TIMING_BATTLE_END) -- e3:SetHintTiming(TIMING_BATTLE_START+TIMING_BATTLE_END)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520184.cscon) e3:SetCondition(s.cscon)
e3:SetTarget(c21520184.cstg) e3:SetTarget(s.cstg)
e3:SetOperation(c21520184.csop) e3:SetOperation(s.csop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520184.fieldfilter(c) function s.fieldfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520184.fscon(e,tp,eg,ep,ev,re,r,rp) function s.fscon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c21520184.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then if Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp
else else
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
end end
function c21520184.fscost(e,tp,eg,ep,ev,re,r,rp,chk) function s.fscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end end
function c21520184.filter1(c,e) function s.filter1(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
function c21520184.fsfilter(c,e,tp,m,f,chkf) function s.fsfilter(c,e,tp,m,f,chkf)
return c:IsSetCard(0x490) and c:IsType(TYPE_FUSION) and (not f or f(c)) return c:IsSetCard(0x490) and c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c21520184.fstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local exg=Duel.GetMatchingGroup(c21520184.filter1,tp,LOCATION_EXTRA+LOCATION_SZONE,0,nil,e) local exg=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_EXTRA+LOCATION_SZONE,0,nil,e)
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp)
mg1:Merge(exg) mg1:Merge(exg)
local res=Duel.IsExistingMatchingCard(c21520184.fsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(s.fsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp) local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c21520184.fsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) res=Duel.IsExistingMatchingCard(s.fsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end end
end end
return res return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c21520184.fsop(e,tp,eg,ep,ev,re,r,rp) function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c21520184.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local exg=Duel.GetMatchingGroup(c21520184.filter1,tp,LOCATION_EXTRA+LOCATION_SZONE,0,nil,e) local exg=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_EXTRA+LOCATION_SZONE,0,nil,e)
mg1:Merge(exg) mg1:Merge(exg)
local sg1=Duel.GetMatchingGroup(c21520184.fsfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(s.fsfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -95,7 +97,7 @@ function c21520184.fsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -95,7 +97,7 @@ function c21520184.fsop(e,tp,eg,ep,ev,re,r,rp)
mg2=fgroup(ce,e,tp) mg2=fgroup(ce,e,tp)
mg2:Merge(exg) mg2:Merge(exg)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c21520184.fsfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) sg2=Duel.GetMatchingGroup(s.fsfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone() local sg=sg1:Clone()
...@@ -117,53 +119,53 @@ function c21520184.fsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -117,53 +119,53 @@ function c21520184.fsop(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
function c21520184.ifilter(c,e) function s.ifilter(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
function c21520184.itg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.itg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c21520184.ifilter,tp,LOCATION_ONFIELD,0,1,nil,e) end if chk==0 then return Duel.IsExistingTarget(s.ifilter,tp,LOCATION_ONFIELD,0,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
Duel.SelectTarget(tp,c21520184.ifilter,tp,LOCATION_ONFIELD,0,1,1,nil,e) Duel.SelectTarget(tp,s.ifilter,tp,LOCATION_ONFIELD,0,1,1,nil,e)
end end
function c21520184.iop(e,tp,eg,ep,ev,re,r,rp) function s.iop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsOnField() and tc:IsRelateToEffect(e) then if tc:IsOnField() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(c21520184.efilter) e1:SetValue(s.efilter)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function c21520184.efilter(e,te) function s.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer() return te:GetOwnerPlayer()~=e:GetOwnerPlayer()
end end
function c21520184.cscon(e,tp,eg,ep,ev,re,r,rp) function s.cscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS
end end
function c21520184.csfilter(c,atk) function s.csfilter(c,atk)
return c:IsAbleToHand() and c:IsAttackBelow(atk) return c:IsAbleToHand() and c:IsAttackBelow(atk)
end end
function c21520184.cstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.cstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SEARCH,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SEARCH,nil,1,tp,LOCATION_DECK)
end end
function c21520184.csop(e,tp,eg,ep,ev,re,r,rp) function s.csop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end
local atk=tc:GetAttack() local atk=tc:GetAttack()
if Duel.IsExistingMatchingCard(c21520184.csfilter,tp,LOCATION_DECK,0,1,nil,atk) then if Duel.IsExistingMatchingCard(s.csfilter,tp,LOCATION_DECK,0,1,nil,atk) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c21520184.csfilter,tp,LOCATION_DECK,0,1,1,nil,atk) local sg=Duel.SelectMatchingCard(tp,s.csfilter,tp,LOCATION_DECK,0,1,1,nil,atk)
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
if sg:GetFirst():IsSetCard(0x490) and sg:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(21520184,3)) then if sg:GetFirst():IsSetCard(0x490) and sg:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end end
end end
......
--艺形魔-熊猫 --艺形魔-熊猫
function c21520185.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
--destroy and draw --destroy and draw
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetDescription(aux.Stringid(21520185,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,21520185) e1:SetCountLimit(1,id)
e1:SetCondition(c21520185.tgcon) e1:SetCondition(s.tgcon)
e1:SetCost(c21520185.tgcost) e1:SetCost(s.tgcost)
e1:SetTarget(c21520185.tgtg) e1:SetTarget(s.tgtg)
e1:SetOperation(c21520185.tgop) e1:SetOperation(s.tgop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520185,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,21520185) e2:SetCountLimit(1,id)
e2:SetTarget(c21520185.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(c21520185.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_2=e2:Clone() local e2_2=e2:Clone()
e2_2:SetCode(EVENT_SPSUMMON_SUCCESS) e2_2:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -31,20 +33,20 @@ function c21520185.initial_effect(c) ...@@ -31,20 +33,20 @@ function c21520185.initial_effect(c)
--continuous spell --continuous spell
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY) e3:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY)
e3:SetDescription(aux.Stringid(21520185,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520185.cscon) e3:SetCondition(s.cscon)
e3:SetTarget(c21520185.cstg) e3:SetTarget(s.cstg)
e3:SetOperation(c21520185.csop) e3:SetOperation(s.csop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520185.cscon(e,tp,eg,ep,ev,re,r,rp) function s.cscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS
end end
function c21520185.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsPlayerCanDraw(tp) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsPlayerCanDraw(tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
...@@ -54,7 +56,7 @@ function c21520185.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -54,7 +56,7 @@ function c21520185.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetTargetParam(1) Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c21520185.csop(e,tp,eg,ep,ev,re,r,rp) function s.csop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
...@@ -62,61 +64,71 @@ function c21520185.csop(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,61 +64,71 @@ function c21520185.csop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(p,d,REASON_EFFECT)==0 then return end if Duel.Draw(p,d,REASON_EFFECT)==0 then return end
local dc=Duel.GetOperatedGroup():GetFirst() local dc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,dc) Duel.ConfirmCards(1-tp,dc)
if dc:IsSetCard(0x490) and dc:IsType(TYPE_MONSTER) and Duel.SelectYesNo(tp,aux.Stringid(21520185,3)) then if dc:IsSetCard(0x490) and dc:IsType(TYPE_MONSTER) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Draw(p,1,REASON_EFFECT) Duel.Draw(p,1,REASON_EFFECT)
end end
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
end end
end end
function c21520185.fieldfilter(c) function s.fieldfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520185.tgcon(e,tp,eg,ep,ev,re,r,rp) function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c21520185.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then if Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp
else else
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
end end
function c21520185.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end end
function c21520185.pfilter(c) function s.pfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and not c:IsPublic() return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and not c:IsPublic() and not c:IsForbidden()
end end
function c21520185.desfilter(c) function s.desfilter(c)
return c:IsSetCard(0x490) and c:IsFaceup() return c:IsSetCard(0x490) and c:IsFaceup()
end end
function c21520185.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tdfilter(c)
if chk==0 then return Duel.IsExistingMatchingCard(c21520185.desfilter,tp,LOCATION_ONFIELD,0,1,nil) return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(c21520185.pfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsPlayerCanDraw(tp) end end
local pgc=Duel.GetMatchingGroupCount(c21520185.pfilter,tp,LOCATION_HAND,0,e:GetHandler()) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local dgc=Duel.GetMatchingGroupCount(c21520185.desfilter,tp,LOCATION_ONFIELD,0,nil) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsPlayerCanDraw(tp) end
local pgc=Duel.GetMatchingGroupCount(s.pfilter,tp,LOCATION_HAND,0,e:GetHandler())
local dgc=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,math.min(pgc,dgc),0,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,math.min(pgc,dgc),0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,math.min(pgc,dgc),0,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,math.min(pgc,dgc),0,LOCATION_DECK)
end end
function c21520185.tgop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local pg=Duel.GetMatchingGroup(c21520185.pfilter,tp,LOCATION_HAND,0,nil) local pg=Duel.GetMatchingGroup(s.pfilter,tp,LOCATION_HAND,0,nil)
local dg=Duel.GetMatchingGroup(c21520185.desfilter,tp,LOCATION_ONFIELD,0,nil) local dg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local ct=math.min(pg:GetCount(),dg:GetCount()) local ct=math.min(pg:GetCount(),dg:GetCount())
if ct==0 then return end if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local pg2=pg:Select(tp,1,ct,nil) local pg2=pg:Select(tp,1,ct,nil)
Duel.ConfirmCards(1-tp,pg2) Duel.ConfirmCards(1-tp,pg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg2=dg:Select(tp,pg2:GetCount(),pg2:GetCount(),nil) local dg2=dg:Select(tp,1,pg2:GetCount(),nil)
if Duel.Destroy(dg2,REASON_EFFECT)~=0 then if Duel.Destroy(dg2,REASON_EFFECT)~=0 then
Duel.BreakEffect() Duel.BreakEffect()
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup()
--[[ local cg=Duel.GetDecktopGroup(tp,og:GetCount())
Duel.Draw(tp,og:GetCount(),REASON_EFFECT) Duel.Draw(tp,og:GetCount(),REASON_EFFECT)
Duel.ConfirmCards(1-tp,cg)
if not cg:IsExists(s.tdfilter,1,nil) then Duel.SendtoDeck(cg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end --]]
local ct1=og:FilterCount(Card.IsControler,nil,tp)
local ct2=og:FilterCount(Card.IsControler,nil,1-tp)
if Duel.IsPlayerCanDraw(tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Draw(tp,ct1,REASON_EFFECT) end
if Duel.IsPlayerCanDraw(1-tp) and Duel.SelectYesNo(1-tp,aux.Stringid(id,3)) then Duel.Draw(1-tp,ct2,REASON_EFFECT) end
end end
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
end end
function c21520185.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
end end
function c21520185.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end
local g=Duel.GetDecktopGroup(tp,3) local g=Duel.GetDecktopGroup(tp,3)
...@@ -129,10 +141,10 @@ function c21520185.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -129,10 +141,10 @@ function c21520185.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end end
--[[ --[[
function c21520185.reccon(e,tp,eg,ep,ev,re,r,rp) function s.reccon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(0x490) return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(0x490)
end end
function c21520185.recop(e,tp,eg,ep,ev,re,r,rp) function s.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev,REASON_EFFECT) Duel.Recover(tp,ev,REASON_EFFECT)
end--]] end--]]
--艺形魔-猛犸 --艺形魔-猛犸
function c21520186.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
--double atk all --double atk all
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21520186,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetHintTiming(TIMING_DAMAGE_STEP+TIMING_DAMAGE_CAL) e1:SetHintTiming(TIMING_DAMAGE_STEP+TIMING_DAMAGE_CAL)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,21520186) e1:SetCountLimit(1,id)
e1:SetCondition(c21520186.acon) e1:SetCondition(s.acon)
e1:SetCost(c21520186.acost) e1:SetCost(s.acost)
e1:SetTarget(c21520186.atg) e1:SetTarget(s.atg)
e1:SetOperation(c21520186.aop) e1:SetOperation(s.aop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--double atk one --double atk one
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520186,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,21520186) e2:SetCountLimit(1,id)
e2:SetTarget(c21520186.attg) e2:SetTarget(s.attg)
e2:SetOperation(c21520186.atop) e2:SetOperation(s.atop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_2=e2:Clone() local e2_2=e2:Clone()
e2_2:SetCode(EVENT_SPSUMMON_SUCCESS) e2_2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2_2) c:RegisterEffect(e2_2)
--continuous spell --continuous spell
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520186,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520186.cscon) e3:SetCondition(s.cscon)
e3:SetTarget(c21520186.cstg) e3:SetTarget(s.cstg)
e3:SetOperation(c21520186.csop) e3:SetOperation(s.csop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520186.dafilter(c) function s.dafilter(c)
return c:IsSetCard(0x490) and c:IsFaceup() and c:GetAttack()<=3000 return c:IsSetCard(0x490) and c:IsFaceup() and c:GetAttack()<=3000
end end
function c21520186.dafilter1(c) function s.dafilter1(c)
return (not c:IsSetCard(0x490) and c:IsFaceup()) or c:IsFacedown() return (not c:IsSetCard(0x490) and c:IsFaceup()) or c:IsFacedown()
end end
function c21520186.csfilter(c) function s.csfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() return c:IsType(TYPE_MONSTER) and c:IsFaceup()
end end
function c21520186.cscon(e,tp,eg,ep,ev,re,r,rp) function s.cscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS
end end
function c21520186.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c21520186.csfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.csfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c21520186.csfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.csfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c21520186.csfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,s.csfilter,tp,LOCATION_MZONE,0,1,1,nil)
end end
function c21520186.csop(e,tp,eg,ep,ev,re,r,rp) function s.csop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
...@@ -70,25 +72,25 @@ function c21520186.csop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,25 +72,25 @@ function c21520186.csop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function c21520186.fieldfilter(c) function s.fieldfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520186.acon(e,tp,eg,ep,ev,re,r,rp) function s.acon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c21520186.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then if Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp
else else
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
end end
function c21520186.acost(e,tp,eg,ep,ev,re,r,rp,chk) function s.acost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end end
function c21520186.atg(e,tp,eg,ep,ev,re,r,rp,chk) function s.atg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520186.dafilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.dafilter,tp,LOCATION_MZONE,0,1,nil) end
end end
function c21520186.aop(e,tp,eg,ep,ev,re,r,rp) function s.aop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c21520186.dafilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(s.dafilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -100,17 +102,17 @@ function c21520186.aop(e,tp,eg,ep,ev,re,r,rp) ...@@ -100,17 +102,17 @@ function c21520186.aop(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext() tc=g:GetNext()
end end
Duel.BreakEffect() Duel.BreakEffect()
local mg=Duel.GetMatchingGroup(c21520186.dafilter1,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(s.dafilter1,tp,LOCATION_MZONE,0,nil)
Duel.Destroy(mg,REASON_EFFECT) Duel.Destroy(mg,REASON_EFFECT)
end end
function c21520186.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) end if chkc then return chkc:IsFaceup() and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,0,0,0) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,0,0,0)
end end
function c21520186.atop(e,tp,eg,ep,ev,re,r,rp) function s.atop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
--艺形魔-老虎 --艺形魔-老虎
function c21520187.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
--search --search
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetDescription(aux.Stringid(21520187,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,21520187) e1:SetCountLimit(1,id)
e1:SetCondition(c21520187.thcon2) e1:SetCondition(s.thcon2)
e1:SetCost(c21520187.thcost2) e1:SetCost(s.thcost2)
e1:SetTarget(c21520187.thtg2) e1:SetTarget(s.thtg2)
e1:SetOperation(c21520187.thop2) e1:SetOperation(s.thop2)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520187,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,21520187) e2:SetCountLimit(1,id)
e2:SetTarget(c21520187.searchtg) e2:SetTarget(s.searchtg)
e2:SetOperation(c21520187.searchop) e2:SetOperation(s.searchop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_2=e2:Clone() local e2_2=e2:Clone()
e2_2:SetCode(EVENT_SPSUMMON_SUCCESS) e2_2:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -30,32 +32,32 @@ function c21520187.initial_effect(c) ...@@ -30,32 +32,32 @@ function c21520187.initial_effect(c)
--continuous spell --continuous spell
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetDescription(aux.Stringid(21520187,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520187.cscon) e3:SetCondition(s.cscon)
e3:SetTarget(c21520187.cstg) e3:SetTarget(s.cstg)
e3:SetOperation(c21520187.csop) e3:SetOperation(s.csop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520187.csfilter(c) function s.csfilter(c)
return c:IsFaceup() and c:IsSetCard(0x490) return c:IsFaceup() and c:IsSetCard(0x490)
end end
function c21520187.cscon(e,tp,eg,ep,ev,re,r,rp) function s.cscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS
end end
function c21520187.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end end
function c21520187.csop(e,tp,eg,ep,ev,re,r,rp) function s.csop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local ct=Duel.GetMatchingGroupCount(c21520187.csfilter,tp,LOCATION_ONFIELD,0,nil) local ct=Duel.GetMatchingGroupCount(s.csfilter,tp,LOCATION_ONFIELD,0,nil)
if ct~=0 then if ct~=0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -66,70 +68,70 @@ function c21520187.csop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,70 +68,70 @@ function c21520187.csop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c21520187.fieldfilter(c) function s.fieldfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520187.thfilter(c,loc) function s.thfilter(c,loc)
if loc~=nil then if loc~=nil then
return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
else else
return c:IsSetCard(0x490) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return (c:IsSetCard(0x490) or or aux.IsSetNameMonsterListed(c,0xc008)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
end end
function c21520187.rfilter(sg,tc) function s.rfilter(sg,tc)
return sg:CheckWithSumEqual(Card.GetLevel,tc:GetLevel(),1,tc:GetLevel()) and sg:GetSum(Card.GetLevel)==tc:GetLevel() return sg:CheckWithSumEqual(Card.GetLevel,tc:GetLevel(),1,tc:GetLevel()) and sg:GetSum(Card.GetLevel)==tc:GetLevel()
end end
function c21520187.thcon2(e,tp,eg,ep,ev,re,r,rp) function s.thcon2(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c21520187.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then if Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp
else else
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
end end
function c21520187.thcost2(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end end
function c21520187.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520187.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SEARCH+CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SEARCH+CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c21520187.thop2(e,tp,eg,ep,ev,re,r,rp) function s.thop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c21520187.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=g:Select(tp,1,1,nil) local thg=g:Select(tp,1,1,nil)
Duel.SendtoHand(thg,nil,REASON_EFFECT) Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg) Duel.ConfirmCards(1-tp,thg)
local dg=Duel.GetMatchingGroup(c21520187.thfilter,tp,LOCATION_DECK,0,nil,LOCATION_DECK) local dg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil,LOCATION_DECK)
-- if dg:CheckSubGroup(c21520187.rfilter,1,thg:GetFirst():GetLevel(),thg:GetFirst()) and Duel.SelectYesNo(tp,aux.Stringid(21520187,3)) then -- if dg:CheckSubGroup(s.rfilter,1,thg:GetFirst():GetLevel(),thg:GetFirst()) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
if dg:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(21520187,3)) then if dg:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
-- local rg=dg:SelectSubGroup(tp,c21520187.rfilter,false,1,thg:GetFirst():GetLevel(),thg:GetFirst()) -- local rg=dg:SelectSubGroup(tp,s.rfilter,false,1,thg:GetFirst():GetLevel(),thg:GetFirst())
local rg=dg:Select(tp,1,2,nil) local rg=dg:Select(tp,1,2,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end end
end end
function c21520187.shfilter(c) function s.shfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAbleToHand() and c:IsLevelBelow(7) return c:IsRace(RACE_FIEND) and c:IsAbleToHand() and c:IsLevelBelow(7)
end end
function c21520187.searchtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.searchtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520187.shfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.shfilter,tp,LOCATION_DECK,0,1,nil) end
end end
function c21520187.searchop(e,tp,eg,ep,ev,re,r,rp) function s.searchop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c21520187.shfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(s.shfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=g:Select(tp,1,1,nil) local thg=g:Select(tp,1,1,nil)
Duel.SendtoHand(thg,nil,REASON_EFFECT) Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg) Duel.ConfirmCards(1-tp,thg)
local dg=Duel.GetMatchingGroup(c21520187.thfilter,tp,LOCATION_DECK,0,nil,LOCATION_DECK) local dg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil,LOCATION_DECK)
-- if dg:CheckSubGroup(c21520187.rfilter,1,thg:GetFirst():GetLevel(),thg:GetFirst()) and Duel.SelectYesNo(tp,aux.Stringid(21520187,3)) then -- if dg:CheckSubGroup(s.rfilter,1,thg:GetFirst():GetLevel(),thg:GetFirst()) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
if dg:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(21520187,3)) then if dg:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
-- local rg=dg:SelectSubGroup(tp,c21520187.rfilter,false,1,thg:GetFirst():GetLevel(),thg:GetFirst()) -- local rg=dg:SelectSubGroup(tp,s.rfilter,false,1,thg:GetFirst():GetLevel(),thg:GetFirst())
local rg=dg:Select(tp,1,2,nil) local rg=dg:Select(tp,1,2,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end end
......
--艺形魔-凤凰 --艺形魔-凤凰
function c21520188.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
--spsumon from szone muti --spsumon from szone muti
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(21520188,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,21520188) e1:SetCountLimit(1,id)
e1:SetCondition(c21520188.spmcon) e1:SetCondition(s.spmcon)
e1:SetCost(c21520188.spmcost) e1:SetCost(s.spmcost)
e1:SetTarget(c21520188.spmtg) e1:SetTarget(s.spmtg)
e1:SetOperation(c21520188.spmop) e1:SetOperation(s.spmop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search field spell --search field spell
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520188,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,21520188) e2:SetCountLimit(1,id)
e2:SetTarget(c21520188.spotg) e2:SetTarget(s.spotg)
e2:SetOperation(c21520188.spoop) e2:SetOperation(s.spoop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_2=e2:Clone() local e2_2=e2:Clone()
e2_2:SetCode(EVENT_SPSUMMON_SUCCESS) e2_2:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -30,49 +32,49 @@ function c21520188.initial_effect(c) ...@@ -30,49 +32,49 @@ function c21520188.initial_effect(c)
--continuous spell --continuous spell
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e3:SetDescription(aux.Stringid(21520188,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetHintTiming(TIMING_END_PHASE) e3:SetHintTiming(TIMING_END_PHASE)
e3:SetCondition(c21520188.cscon) e3:SetCondition(s.cscon)
e3:SetTarget(c21520188.cstg) e3:SetTarget(s.cstg)
e3:SetOperation(c21520188.csop) e3:SetOperation(s.csop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520188.fieldfilter(c) function s.fieldfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520188.spmcon(e,tp,eg,ep,ev,re,r,rp) function s.spmcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c21520188.fieldfilter,tp,LOCATION_ONFIELD,0,1,nil) then if Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_ONFIELD,0,1,nil) then
return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp
else else
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
end end
function c21520188.spmcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end end
function c21520188.pfilter(c) function s.pfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and not c:IsPublic() return c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520188.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsSetCard(0x490) and c:IsFaceup() and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER return c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsSetCard(0x490) and c:IsFaceup() and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER
end end
function c21520188.spmtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.spmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520188.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c21520188.pfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_HAND,0,1,e:GetHandler())
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local spg=Duel.GetMatchingGroup(c21520188.spfilter,tp,LOCATION_SZONE,0,nil,e,tp) local spg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_SZONE,0,nil,e,tp)
local pgct=Duel.GetMatchingGroupCount(c21520188.pfilter,tp,LOCATION_HAND,0,e:GetHandler()) local pgct=Duel.GetMatchingGroupCount(s.pfilter,tp,LOCATION_HAND,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,math.min(spg:GetCount(),pgct,Duel.GetLocationCount(tp,LOCATION_MZONE)),0,LOCATION_SZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,math.min(spg:GetCount(),pgct,Duel.GetLocationCount(tp,LOCATION_MZONE)),0,LOCATION_SZONE)
end end
function c21520188.spmop(e,tp,eg,ep,ev,re,r,rp) function s.spmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c21520188.spfilter,tp,LOCATION_SZONE,0,nil,e,tp) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_SZONE,0,nil,e,tp)
local hg=Duel.GetMatchingGroup(c21520188.pfilter,tp,LOCATION_HAND,0,e:GetHandler()) local hg=Duel.GetMatchingGroup(s.pfilter,tp,LOCATION_HAND,0,e:GetHandler())
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if g:GetCount()>0 and hg:GetCount()>0 and ft>0 then if g:GetCount()>0 and hg:GetCount()>0 and ft>0 then
...@@ -86,37 +88,37 @@ function c21520188.spmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,37 +88,37 @@ function c21520188.spmop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
end end
end end
function c21520188.searchfilter(c) function s.searchfilter(c)
return c:IsType(TYPE_FIELD) and c:IsAbleToHand() return c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end end
function c21520188.spotg(e,tp,eg,ep,ev,re,r,rp,chk) function s.spotg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520188.searchfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end if chk==0 then return Duel.IsExistingMatchingCard(s.searchfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function c21520188.spoop(e,tp,eg,ep,ev,re,r,rp) function s.spoop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c21520188.searchfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.searchfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function c21520188.cscon(e,tp,eg,ep,ev,re,r,rp) function s.cscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS and ph==PHASE_END return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS and ph==PHASE_END
end end
function c21520188.csfilter(c) function s.csfilter(c)
return c:IsSetCard(0x490) and c:IsAbleToRemove() return c:IsSetCard(0x490) and c:IsAbleToRemove()
end end
function c21520188.cstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.cstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520188.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c21520188.csfilter,tp,LOCATION_GRAVE,0,1,nil) end and Duel.IsExistingMatchingCard(s.csfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_SZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_SZONE)
end end
function c21520188.csop(e,tp,eg,ep,ev,re,r,rp) function s.csop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c21520188.spfilter,tp,LOCATION_SZONE,0,nil,e,tp) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_SZONE,0,nil,e,tp)
local rg=Duel.GetMatchingGroup(c21520188.csfilter,tp,LOCATION_GRAVE,0,nil) local rg=Duel.GetMatchingGroup(s.csfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and rg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if g:GetCount()>0 and rg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg1=rg:Select(tp,1,1,nil) local rg1=rg:Select(tp,1,1,nil)
......
--艺形魔-纸死神 --艺形魔-纸死神
function c21520189.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21520181)
--spsumon 1 shapevil --spsumon 1 shapevil
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_RECOVER) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_RECOVER)
e1:SetDescription(aux.Stringid(21520189,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,21520189) e1:SetCountLimit(1,id)
e1:SetCondition(c21520189.sdrcon) e1:SetCondition(s.sdrcon)
e1:SetCost(c21520189.sdrcost) e1:SetCost(s.sdrcost)
e1:SetTarget(c21520189.sdrtg) e1:SetTarget(s.sdrtg)
e1:SetOperation(c21520189.sdrop) e1:SetOperation(s.sdrop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to grave --to grave
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21520189,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,21520189) e2:SetCountLimit(1,id)
e2:SetTarget(c21520189.tgtg) e2:SetTarget(s.tgtg)
e2:SetOperation(c21520189.tgop) e2:SetOperation(s.tgop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e2_2=e2:Clone() local e2_2=e2:Clone()
e2_2:SetCode(EVENT_SPSUMMON_SUCCESS) e2_2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2_2) c:RegisterEffect(e2_2)
--continuous spell --continuous spell
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(21520189,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(c21520189.spcon) e3:SetCondition(s.spcon)
e3:SetTarget(c21520189.sptg) e3:SetTarget(s.sptg)
e3:SetOperation(c21520189.spop) e3:SetOperation(s.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c21520189.pfilter(c) function s.pfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and not c:IsPublic() return c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and not c:IsPublic()
end end
function c21520189.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x490) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_MONSTER)
end end
function c21520189.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS return e:GetHandler():GetType()&(TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS
end end
function c21520189.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c21520189.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c21520189.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end and Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c21520189.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c21520189.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local atk=tc:GetBaseAttack() local atk=tc:GetBaseAttack()
...@@ -67,13 +69,13 @@ function c21520189.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,13 +69,13 @@ function c21520189.spop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local op=2 local op=2
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(21520189,3),aux.Stringid(21520189,4)) op=Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))
elseif not b1 and b2 then elseif not b1 and b2 then
op=1 op=1
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,4)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,4))
elseif b1 and not b2 then elseif b1 and not b2 then
op=0 op=0
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,3)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,3))
end end
if op==0 then if op==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
...@@ -83,30 +85,30 @@ function c21520189.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,30 +85,30 @@ function c21520189.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tc:GetControler(),atk,REASON_EFFECT) Duel.Damage(tc:GetControler(),atk,REASON_EFFECT)
end end
end end
function c21520189.fieldfilter(c) function s.fieldfilter(c)
return c:IsCode(21520181) and c:IsFaceup() return c:IsCode(21520181) and c:IsFaceup()
end end
function c21520189.sdrcon(e,tp,eg,ep,ev,re,r,rp) function s.sdrcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c21520189.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then if Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp
else else
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
end end
function c21520189.sdrcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.sdrcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_DISCARD+REASON_COST)
end end
function c21520189.sdrtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sdrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21520189.pfilter,tp,LOCATION_HAND,0,3,e:GetHandler()) if chk==0 then return Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_HAND,0,3,e:GetHandler())
and Duel.IsExistingMatchingCard(c21520189.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
-- --
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE)
end end
function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp) function s.sdrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local hg=Duel.GetMatchingGroup(c21520189.pfilter,tp,LOCATION_HAND,0,nil) local hg=Duel.GetMatchingGroup(s.pfilter,tp,LOCATION_HAND,0,nil)
local g=Duel.GetMatchingGroup(c21520189.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp)
if g:GetCount()>0 and hg:GetCount()>2 then if g:GetCount()>0 and hg:GetCount()>2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local pg=hg:Select(tp,3,3,nil) local pg=hg:Select(tp,3,3,nil)
...@@ -118,13 +120,13 @@ function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,13 +120,13 @@ function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp)
local tc=sg:GetFirst() local tc=sg:GetFirst()
local op=2 local op=2
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
op=Duel.SelectOption(tp,aux.Stringid(21520189,3),aux.Stringid(21520189,4)) op=Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0 then elseif Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)==0 then
op=0 op=0
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,3)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,3))
elseif Duel.GetLocationCount(tp,LOCATION_MZONE)==0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then elseif Duel.GetLocationCount(tp,LOCATION_MZONE)==0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
op=1 op=1
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(21520189,4)) Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,4))
end end
if op==1 then if op==1 then
p=1-tp p=1-tp
...@@ -137,7 +139,7 @@ function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp) ...@@ -137,7 +139,7 @@ function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(c21520189.aclimit) e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
--destroy --destroy
...@@ -146,19 +148,19 @@ function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp) ...@@ -146,19 +148,19 @@ function c21520189.sdrop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c21520189.destg) e2:SetTarget(s.destg)
e2:SetOperation(c21520189.desop) e2:SetOperation(s.desop)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end--]] end--]]
end end
end end
function c21520189.aclimit(e,re,tp) function s.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE return re:GetActivateLocation()==LOCATION_GRAVE
end end
function c21520189.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=1 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=1 end
end end
function c21520189.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsDistruable,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(Card.IsDistruable,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
...@@ -169,15 +171,15 @@ function c21520189.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -169,15 +171,15 @@ function c21520189.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(c,REASON_EFFECT) Duel.Destroy(c,REASON_EFFECT)
end end
end end
function c21520189.tgfilter(c) function s.tgfilter(c)
return c:IsSetCard(0x490) and c:IsFaceup() return c:IsSetCard(0x490) and c:IsFaceup()
end end
function c21520189.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=Duel.GetMatchingGroupCount(c21520189.tgfilter,tp,LOCATION_ONFIELD,0,nil) end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=Duel.GetMatchingGroupCount(s.tgfilter,tp,LOCATION_ONFIELD,0,nil) end
end end
function c21520189.tgop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ct=Duel.GetMatchingGroupCount(c21520189.tgfilter,tp,LOCATION_ONFIELD,0,nil) local ct=Duel.GetMatchingGroupCount(s.tgfilter,tp,LOCATION_ONFIELD,0,nil)
local g=Duel.GetDecktopGroup(tp,ct) local g=Duel.GetDecktopGroup(tp,ct)
local count=Duel.DiscardDeck(tp,ct,REASON_EFFECT) local count=Duel.DiscardDeck(tp,ct,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
This diff is collapsed.
...@@ -76,7 +76,7 @@ function s.tscon(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,7 +76,7 @@ function s.tscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) return c:IsPreviousLocation(LOCATION_ONFIELD)
end end
function s.tsfilter(c) function s.tsfilter(c,tp)
return c:IsSetCard(0x541a) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToRemove() and return c:IsSetCard(0x541a) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToRemove() and
Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,c:GetCode()) Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,c:GetCode())
end end
...@@ -84,13 +84,13 @@ function s.thfilter(c,code) ...@@ -84,13 +84,13 @@ function s.thfilter(c,code)
return c:IsSetCard(0x541a) and not c:IsCode(code) and (c:IsAbleToHand() or c:IsAbleToGrave()) return c:IsSetCard(0x541a) and not c:IsCode(code) and (c:IsAbleToHand() or c:IsAbleToGrave())
end end
function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tsfilter,tp,LOCATION_EXTRA,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(s.tsfilter,tp,LOCATION_EXTRA,0,1,e:GetHandler(),tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function s.tsop(e,tp,eg,ep,ev,re,r,rp) function s.tsop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(s.tsfilter,tp,LOCATION_EXTRA,0,1,e:GetHandler()) then return end if not Duel.IsExistingMatchingCard(s.tsfilter,tp,LOCATION_EXTRA,0,1,e:GetHandler(),tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.tsfilter,tp,LOCATION_EXTRA,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,s.tsfilter,tp,LOCATION_EXTRA,0,1,1,e:GetHandler(),tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
......
...@@ -33,9 +33,9 @@ function c71401002.filter2a(c) ...@@ -33,9 +33,9 @@ function c71401002.filter2a(c)
end end
function c71401002.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function c71401002.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 return Duel.IsExistingMatchingCard(c71401002.filter2a,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
return Duel.IsExistingMatchingCard(c71401002.filter2a,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(c71401002.filter2,tp,LOCATION_DECK,0,1,nil,tp,check)
end end
return true
end end
function c71401002.op2(e,tp,eg,ep,ev,re,r,rp) function c71401002.op2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
......
...@@ -32,6 +32,7 @@ function c71401019.filterc2(c,tp,ec) ...@@ -32,6 +32,7 @@ function c71401019.filterc2(c,tp,ec)
if not c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and c:IsFaceup() and c:IsAbleToHandAsCost() then if not c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and c:IsFaceup() and c:IsAbleToHandAsCost() then
return false return false
end end
--[[
local e1=Effect.CreateEffect(ec) local e1=Effect.CreateEffect(ec)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -43,6 +44,8 @@ function c71401019.filterc2(c,tp,ec) ...@@ -43,6 +44,8 @@ function c71401019.filterc2(c,tp,ec)
local res=Duel.IsExistingMatchingCard(c71401019.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,c:GetCode()) local res=Duel.IsExistingMatchingCard(c71401019.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,c:GetCode())
e1:Reset() e1:Reset()
return res return res
]]
return true
end end
function c71401019.filter2(c,code) function c71401019.filter2(c,code)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and not c:IsCode(code) and c:IsSummonable(true,nil) return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and not c:IsCode(code) and c:IsSummonable(true,nil)
...@@ -51,14 +54,12 @@ function c71401019.filter2a(c,code) ...@@ -51,14 +54,12 @@ function c71401019.filter2a(c,code)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and not c:IsCode(code) return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and not c:IsCode(code)
end end
function c71401019.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c71401019.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true return true
end end
function c71401019.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c71401019.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then if chk==0 then
if e:GetLabel()~=100 then return false end return e:IsCostChecked() and Duel.IsPlayerCanAdditionalSummon(tp)
e:SetLabel(0) and Duel.GetFlagEffect(tp,71401019)==0
return Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,71401019)==0
and Duel.IsExistingMatchingCard(c71401019.filterc2,tp,LOCATION_MZONE,0,1,nil,tp,e:GetHandler()) and Duel.IsExistingMatchingCard(c71401019.filterc2,tp,LOCATION_MZONE,0,1,nil,tp,e:GetHandler())
and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 and Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0
end end
...@@ -71,8 +72,16 @@ end ...@@ -71,8 +72,16 @@ end
function c71401019.op2(e,tp,eg,ep,ev,re,r,rp) function c71401019.op2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,71401019)~=0 then return end if Duel.GetFlagEffect(tp,71401019)~=0 then return end
local code=e:GetLabel() local code=e:GetLabel()
local g=Duel.GetMatchingGroup(c71401019.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,code)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71401019,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(71401019,1)) e1:SetDescription(aux.Stringid(71401019,2))
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0) e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
...@@ -80,11 +89,4 @@ function c71401019.op2(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,11 +89,4 @@ function c71401019.op2(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,71401019,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,71401019,RESET_PHASE+PHASE_END,0,1)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c71401019.filter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,code)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end end
\ No newline at end of file
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