Commit e0646941 authored by Nemo Ma's avatar Nemo Ma

the divide

parent ce0dd538
This diff is collapsed.
...@@ -60,13 +60,27 @@ end ...@@ -60,13 +60,27 @@ end
function c113652145.spfilter(c) function c113652145.spfilter(c)
return c:IsSetCard(0x99) and not c:IsCode(113652145) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0x99) and not c:IsCode(113652145) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end end
function c113652145.spfilter2(c,tp)
return c:IsHasEffect(48829461,tp) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c113652145.spcon(e,c) function c113652145.spcon(e,c)
if c==nil then return true end if c==nil then return true end
return (not c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(e:GetHandlerPlayer())>0) and Duel.IsExistingMatchingCard(c113652145.spfilter,c:GetControler(),LOCATION_DECK+LOCATION_EXTRA,0,1,e:GetHandler()) local tp=c:GetControler()
local b1=Duel.IsExistingMatchingCard(c113652145.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c113652145.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
return c:IsLocation(LOCATION_HAND) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and b1 or b2) or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp)>0 and b1
end end
function c113652145.spop(e,tp,eg,ep,ev,re,r,rp,c) function c113652145.spop(e,tp,eg,ep,ev,re,r,rp,c)
local tg=Duel.SelectMatchingCard(tp,c113652145.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,e:GetHandler()) local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c113652145.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil)
if tg:GetCount()>0 then local b2=Duel.IsExistingMatchingCard(c113652145.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
if c:IsLocation(LOCATION_HAND) and b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(48829461,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c113652145.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
local te=tg:GetFirst():IsHasEffect(48829461,tp)
te:UseCountLimit(tp)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
else
local tg=Duel.SelectMatchingCard(tp,c113652145.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
Duel.Remove(tg:GetFirst(),POS_FACEUP,REASON_COST) Duel.Remove(tg:GetFirst(),POS_FACEUP,REASON_COST)
end end
end end
......
...@@ -7,7 +7,6 @@ function cm.initial_effect(c) ...@@ -7,7 +7,6 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost) e1:SetCost(cm.spcost)
...@@ -17,7 +16,7 @@ function cm.initial_effect(c) ...@@ -17,7 +16,7 @@ function cm.initial_effect(c)
--revive --revive
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
......
...@@ -77,8 +77,8 @@ function c116511113.xyzcon1(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,8 +77,8 @@ function c116511113.xyzcon1(e,tp,eg,ep,ev,re,r,rp)
end end
function c116511113.xyzop1(e,tp,eg,ep,ev,re,r,rp) function c116511113.xyzop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) then return end if Duel.GetFlagEffect(tp,116511113)==0 and Duel.SelectYesNo(tp,aux.Stringid(116511113,0)) then
if Duel.SelectYesNo(tp,aux.Stringid(116511113,0)) then Duel.RegisterFlagEffect(tp,116511113,RESET_CHAIN,0,1)
local mg=Group.CreateGroup() local mg=Group.CreateGroup()
local rc=re:GetHandler() local rc=re:GetHandler()
if rc:IsDisabled() then return end if rc:IsDisabled() then return end
...@@ -148,20 +148,20 @@ function c116511113.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -148,20 +148,20 @@ function c116511113.cost(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 c116511113.sumfilter(c) function c116511113.sumfilter(c,e)
return c:IsSetCard(0x108a) and c:IsSummonable(true,nil) return c:IsSetCard(0x108a) and c:IsSummonable(true,e)
end end
function c116511113.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function c116511113.sumtg(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(c116511113.sumfilter,tp,LOCATION_DECK,0,1,nil) end and Duel.IsExistingMatchingCard(c116511113.sumfilter,tp,LOCATION_DECK,0,1,nil,e) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end end
function c116511113.sumop(e,tp,eg,ep,ev,re,r,rp) function c116511113.sumop(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_SUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c116511113.sumfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c116511113.sumfilter,tp,LOCATION_DECK,0,1,1,nil,e)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Summon(tp,g:GetFirst(),true,nil) Duel.Summon(tp,g:GetFirst(),true,e)
end end
end end
function c116511113.spfilter(c,e,tp) function c116511113.spfilter(c,e,tp)
......
...@@ -137,9 +137,9 @@ function c117837139.condition(e) ...@@ -137,9 +137,9 @@ function c117837139.condition(e)
return Duel.GetTurnPlayer()~=e:GetHandler():GetControler() return Duel.GetTurnPlayer()~=e:GetHandler():GetControler()
end end
function c117837139.operation(e,tp,eg,ep,ev,re,r,rp) function c117837139.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c117837139.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) then return false end if Duel.IsExistingMatchingCard(c117837139.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e) then return false end
local g1=Duel.GetMatchingGroup(c117837139.filter2,tp,LOCATION_MZONE,0,nil,e) local g1=Duel.GetMatchingGroup(c117837139.filter2,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(c117837139.filter2,tp,0,LOCATION_MZONE,nil,e) local g2=Duel.GetMatchingGroup(c117837139.filter2,tp,0,LOCATION_MZONE,nil)
Duel.Hint(HINT_CARD,0,117837139) Duel.Hint(HINT_CARD,0,117837139)
Duel.ChangePosition(g1,POS_FACEUP_ATTACK) Duel.ChangePosition(g1,POS_FACEUP_ATTACK)
Duel.ChangePosition(g2,POS_FACEUP_ATTACK) Duel.ChangePosition(g2,POS_FACEUP_ATTACK)
......
...@@ -190,14 +190,13 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -190,14 +190,13 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler(),e,tp) local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_GRAVE)
end end
function cm.sxfilter(c,mg) function cm.sxfilter(c,tp,mg)
return c:IsSynchroSummonable(nil,mg) or c:IsXyzSummonable(mg,2,2) return (c:IsSynchroSummonable(nil,mg) or c:IsXyzSummonable(mg)) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.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 Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or g:GetCount()<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or g:GetCount()<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local tc=g:GetFirst() for tc in aux.Next(g) do
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -209,11 +208,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -209,11 +208,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true) tc:RegisterEffect(e2,true)
tc=g:GetNext()
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
local sxg=Duel.GetMatchingGroup(cm.sxfilter,tp,LOCATION_EXTRA,0,nil,g) local sxg=Duel.GetMatchingGroup(cm.sxfilter,tp,LOCATION_EXTRA,0,nil,tp,g)
if Duel.GetLocationCountFromEx(tp,tp,g,e:GetHandler())>0 and sxg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if sxg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sxc=sxg:Select(tp,1,1,nil):GetFirst() local sxc=sxg:Select(tp,1,1,nil):GetFirst()
......
...@@ -69,11 +69,21 @@ end ...@@ -69,11 +69,21 @@ end
function c118817732.xyzcondition(e,c,og,min,max) function c118817732.xyzcondition(e,c,og,min,max)
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(c118817732.xyzfilter,tp,LOCATION_HAND,0,nil) local mg
return mg:IsExists(aux.TRUE,2,nil) if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
end
return mg:IsExists(c118817732.xyzfilter,2,nil)
end end
function c118817732.xyztarget(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) function c118817732.xyztarget(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
local mg=Duel.GetMatchingGroup(c118817732.xyzfilter,tp,LOCATION_HAND,0,nil) local mg=nil
if og then
mg=og
else
mg=Duel.GetMatchingGroup(c118817732.xyzfilter,tp,LOCATION_HAND,0,nil)
end
local g=mg:Select(tp,2,2,nil) local g=mg:Select(tp,2,2,nil)
if g then if g then
g:KeepAlive() g:KeepAlive()
......
...@@ -36,10 +36,10 @@ function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se) ...@@ -36,10 +36,10 @@ function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not se:GetHandler():IsSetCard(0x5349)and not c:IsCode(33403500) return not se:GetHandler():IsSetCard(0x5349)and not c:IsCode(33403500)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetFieldGroupCount(tp,0,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_ONFIELD) local b1=Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,33403500) local b2=Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,33403500)
if chkc then return true end if chkc then return true end
if chk==0 then return b1>0 or b2>0 end if chk==0 then return b1 or b2 end
if e:GetLabel()==1 then if e:GetLabel()==1 then
local c=e:GetHandler() local c=e:GetHandler()
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -83,7 +83,7 @@ function cm.regop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +83,7 @@ function cm.regop2(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local b1=Duel.GetFieldGroupCount(tp,0,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_ONFIELD) local b1=Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,33403500) local b2=Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,33403500)
if not (b1 or b2) then return end if not (b1 or b2) then return end
local op local op
...@@ -95,7 +95,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -95,7 +95,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if op==0 then if op==0 then
local ct=Duel.GetFlagEffect(tp,33403501) local ct=Duel.GetFlagEffect(tp,33403501)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local tg=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,1,ct,nil) local tg=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,1,ct,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
while tc do while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
...@@ -103,21 +103,21 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,21 +103,21 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
tc=tg:GetNext() tc=tg:GetNext()
......
...@@ -123,7 +123,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -123,7 +123,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e6:SetValue(n) e6:SetValue(n)
token:RegisterEffect(e6,true) token:RegisterEffect(e6,true)
local e7=e1:Clone() local e7=e1:Clone()
e7:SetCode(EFFECT_ADD_CODE) e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetCode(EFFECT_CHANGE_CODE)
e7:SetValue(tc:GetCode()) e7:SetValue(tc:GetCode())
token:RegisterEffect(e7,true) token:RegisterEffect(e7,true)
token:CopyEffect(tc:GetCode(),RESET_EVENT+0xfe0000,1) token:CopyEffect(tc:GetCode(),RESET_EVENT+0xfe0000,1)
......
...@@ -84,6 +84,7 @@ function cm.regop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -84,6 +84,7 @@ function cm.regop2(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil) local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
local tc1=g1:GetFirst() local tc1=g1:GetFirst()
......
--高等儀式術 --高等儀式術
function c460524290.initial_effect(c) function c460524290.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,460524290) e1:SetCountLimit(1,460524290)
e1:SetTarget(c460524290.target) e1:SetTarget(c460524290.target)
e1:SetOperation(c460524290.activate) e1:SetOperation(c460524290.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c460524290.thcon) e2:SetCondition(c460524290.thcon)
e2:SetCost(c460524290.thcost) e2:SetCost(c460524290.thcost)
e2:SetTarget(c460524290.thtg) e2:SetTarget(c460524290.thtg)
e2:SetOperation(c460524290.thop) e2:SetOperation(c460524290.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c460524290.filter(c,e,tp,m) function c460524290.filter(c,e,tp,m)
if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81 then return false end if not c:IsSetCard(0xb4) or bit.band(c:GetType(),0x81)~=0x81 then return false end
if c.mat_filter then if c.mat_filter then
m=m:Filter(c.mat_filter,nil) m=m:Filter(c.mat_filter,nil)
end end
return m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end end
function c460524290.matfilter(c) function c460524290.matfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect() return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end end
function c460524290.target(e,tp,eg,ep,ev,re,r,rp,chk) function c460524290.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetMatchingGroup(c460524290.matfilter,tp,LOCATION_DECK,0,nil) local mg=Duel.GetMatchingGroup(c460524290.matfilter,tp,LOCATION_DECK,0,nil)
return Duel.IsExistingMatchingCard(c460524290.filter,tp,LOCATION_DECK,0,1,nil,e,tp,mg) return Duel.IsExistingMatchingCard(c460524290.filter,tp,LOCATION_DECK,0,1,nil,e,tp,mg)
end end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end end
function c460524290.activate(e,tp,eg,ep,ev,re,r,rp) function c460524290.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local mg=Duel.GetMatchingGroup(c460524290.matfilter,tp,LOCATION_DECK,0,nil) local mg=Duel.GetMatchingGroup(c460524290.matfilter,tp,LOCATION_DECK,0,nil)
local g=Duel.SelectMatchingCard(tp,c460524290.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mg) local g=Duel.SelectMatchingCard(tp,c460524290.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mg)
local tg=g:GetFirst() local tg=g:GetFirst()
if tg==nil then return end if tg==nil then return end
if tg.mat_filter then if tg.mat_filter then
mg=mg:Filter(tg.mat_filter,nil) mg=mg:Filter(tg.mat_filter,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tg:GetLevel(),1,99,tg) local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tg:GetLevel(),1,99,tg)
tg:SetMaterial(mat) tg:SetMaterial(mat)
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_RELEASE) Duel.SendtoGrave(mat,REASON_EFFECT+REASON_RELEASE+REASON_RITUAL)
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_REMOVED) e1:SetRange(LOCATION_REMOVED)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
e1:SetCondition(c460524290.spcon) e1:SetCondition(c460524290.spcon)
e1:SetOperation(c460524290.spop) e1:SetOperation(c460524290.spop)
tg:RegisterEffect(e1) tg:RegisterEffect(e1)
end end
function c460524290.spcon(e,tp,eg,ep,ev,re,r,rp) function c460524290.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c460524290.spop(e,tp,eg,ep,ev,re,r,rp) function c460524290.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
local mg=Duel.GetMatchingGroup(c460524290.matfilter,tp,LOCATION_DECK,0,nil) local mg=Duel.GetMatchingGroup(c460524290.matfilter,tp,LOCATION_DECK,0,nil)
local tc=e:GetHandler() local tc=e:GetHandler()
if not tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return end if not tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return end
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
function c460524290.thcon(e,tp,eg,ep,ev,re,r,rp) function c460524290.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end end
function c460524290.cfilter(c) function c460524290.cfilter(c)
return c:IsSetCard(0xb4) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0xb4) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end end
function c460524290.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c460524290.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c460524290.cfilter,tp,LOCATION_GRAVE,0,1,nil) end and Duel.IsExistingMatchingCard(c460524290.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c460524290.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c460524290.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler()) g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c460524290.thfilter(c) function c460524290.thfilter(c)
return c:IsSetCard(0xb4) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() return c:IsSetCard(0xb4) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end end
function c460524290.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c460524290.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c460524290.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c460524290.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 c460524290.thop(e,tp,eg,ep,ev,re,r,rp) function c460524290.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,c460524290.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c460524290.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
\ No newline at end of file
...@@ -71,32 +71,27 @@ function c84610009.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -71,32 +71,27 @@ function c84610009.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,c84610009.cfilter,1,1,REASON_DISCARD+REASON_COST,nil) Duel.DiscardHand(tp,c84610009.cfilter,1,1,REASON_DISCARD+REASON_COST,nil)
end end
function c84610009.scfilter(c,e,tp) function c84610009.scfilter(c,e,tp)
return c:IsSetCard(0x8) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,true,false) return c:IsSetCard(0x8) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,true,false) and Duel.GetMatchingGroup(c84610009.filter1,tp,LOCATION_MZONE,0,nil,tp,c):GetClassCount(Card.GetCode)>2
end end
function c84610009.filter1(c) function c84610009.filter1(c,tp,tc)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and Duel.GetLocationCountFromEx(tp,tp,c,tc)>0
end end
function c84610009.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c84610009.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then return Duel.IsExistingMatchingCard(c84610009.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(c84610009.filter1,tp,LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>2
and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c84610009.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,3,tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,3,tp,LOCATION_MZONE)
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 c84610009.activate1(e,tp,eg,ep,ev,re,r,rp) function c84610009.activate1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c84610009.filter1,tp,LOCATION_MZONE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if g:GetClassCount(Card.GetCode)<3 then return end local g=Duel.SelectMatchingCard(tp,c84610009.scfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tc=g:GetFirst()
local tg=g:Select(tp,3,3,nil) if tc then
g:Remove(Card.IsCode,nil,tg:GetFirst():GetCode()) local g=Duel.GetMatchingGroup(c84610009.filter1,tp,LOCATION_MZONE,0,nil,tp,tc)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 and tg:IsExists(Card.IsLocation,3,nil,LOCATION_GRAVE) then if g:GetClassCount(Card.GetCode)<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c84610009.scfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local tg=g:Select(tp,3,3,nil)
local tc=g:GetFirst() g:Remove(Card.IsCode,nil,tg:GetFirst():GetCode())
if tc then if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 and tg:IsExists(Card.IsLocation,3,nil,LOCATION_GRAVE) then
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment