Commit 30b034a5 authored by Nemo Ma's avatar Nemo Ma

fix

parent c7893946
--卡通风暴密码人 --卡通风暴密码人
function c250000000.initial_effect(c) function c250000000.initial_effect(c)
aux.AddCodeList(c,15259703) aux.AddCodeList(c,15259703)
c:EnableReviveLimit()
--special summon --special summon
--destroy --destroy
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -95,12 +94,6 @@ end ...@@ -95,12 +94,6 @@ end
function c250000000.atlimit(e,c) function c250000000.atlimit(e,c)
return not c:IsType(TYPE_TOON) or c:IsFacedown() return not c:IsType(TYPE_TOON) or c:IsFacedown()
end end
function c250000000.atklimit(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
--方舟骑士-伊内丝 --方舟骑士-伊内丝
function c29005360.initial_effect(c) local m=29005360
local cm=_G["c"..m]
cm.named_with_Arknight=1
function cm.initial_effect(c)
c:EnableCounterPermit(0x10ae)
if not Auxiliary.PendulumChecklist then
Auxiliary.PendulumChecklist=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1163)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(cm.PendConditionArcKnight())
e1:SetOperation(cm.PendOperationArcKnight())
e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1)
--register by default
if reg==nil or reg then
local e2=Effect.CreateEffect(c)
e2:SetDescription(1160)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e2)
end
--summon success
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.addct)
e2:SetOperation(cm.addc)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetTarget(cm.tktg)
e3:SetOperation(cm.tkop)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e5:SetCondition(function(e,tp) return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM|SUMMON_TYPE_NORMAL) end)
e5:SetValue(LOCATION_HAND)
c:RegisterEffect(e5)
end
function cm.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x10ae)
end
function cm.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local ct = Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) + 1
e:GetHandler():AddCounter(0x10ae,ct)
end
end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,28674153,0,TYPES_TOKEN_MONSTER,1500,1500,6,RACE_WARRIOR,ATTRIBUTE_DARK) and e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
if Duel.GetFlagEffect(tp,m)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(aux.TargetBoolFunction(cm.ArcKnightPCardFilter))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,m+1,0,TYPES_TOKEN_MONSTER,2800,0,7,RACE_FIEND,ATTRIBUTE_DARK) then return end
local token=Duel.CreateToken(tp,m+1)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
token:RegisterEffect(e1,true)
end
end
function cm.SetForceExtra(tp,res)
if forced_to_extra then
forced_to_extra[tp]=res
end
end
function cm.PConditionFilterArcKnight(c,e,tp,lscale,rscale,f,tc,eset)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
local bool=aux.PendulumSummonableBool(c)
return lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and (Auxiliary.PendulumChecklist &(0x1<<tp)==0 or aux.PConditionExtraFilter(c,e,tp,lscale,rscale,eset))
and not c:IsForbidden() and (not f or f(c,tc))
end
function cm.GetPendulumCard(tp,seq)
return Duel.GetFieldCard(tp,LOCATION_PZONE,seq)
end
function cm.PendConditionArcKnight()
return function(e,c,og,exfilter,flag)
if c==nil then return true end
local tp=c:GetControler()
if not exfilter then exfilter = aux.TRUE end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 and not flag then return false end
local rpz=cm.GetPendulumCard(tp,1)
if rpz==nil or c==rpz then return false end
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetUsableMZoneCount(tp)
if ft<=0 then return false end
local mft=Duel.GetMZoneCount(tp)
cm.SetForceExtra(tp,true)
local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
cm.SetForceExtra(tp,false)
local g=nil
if og then
g=og:Filter(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
else
g=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale,eset)
end
local ext1={c:IsHasEffect(29036036)}
local ext2={rpz:IsHasEffect(29036036)}
for i,te in pairs(ext1) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
g:Merge(exg)
end
end
for i,te in pairs(ext2) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
g:Merge(exg)
end
end
if mft<=0 then g=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA) end
if eft<=0 then g:Remove(Card.IsLocation,nil,LOCATION_EXTRA) end
if exfilter then
g = g:Filter(exfilter,nil)
end
return #g>0
end
end
function cm.PendCheckAdditionalArcKnight(mft,maxlist)
return function(g)
if mft>0 and g:IsExists(Card.IsLocation,mft+1,nil,0xbf) then return false end
for loc,lct in pairs(maxlist) do
if lct>0 and g:IsExists(Card.IsLocation,lct+1,nil,loc) then return false end
end
return true
end
end
function cm.PendOperationArcKnight()
return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og,exfilter,flag)
local rpz=cm.GetPendulumCard(tp,1)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if not exfilter then exfilter = ArkEffect_Pend_filter or aux.TRUE end
if lscale>rscale then lscale,rscale=rscale,lscale end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local ft=Duel.GetUsableMZoneCount(tp)
local mft=Duel.GetMZoneCount(tp)
cm.SetForceExtra(tp,true)
local eft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
cm.SetForceExtra(tp,false)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
mft=math.min(1,mft)
mft=math.min(1,eft)
ft=1
end
local tg=nil
local maxlist={}
if og then
tg=og:Filter(aux.PConditionFilter,1,nil,e,tp,lscale,rscale)
else
tg=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale,eset)
end
local ext1={c:IsHasEffect(29036036)}
local ext2={rpz:IsHasEffect(29036036)}
for i,te in pairs(ext1) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
tg:Merge(exg)
local mct=maxcount
if mct and mct>0 and mct<ft then
maxlist[location]=mct
end
end
end
for i,te in pairs(ext2) do
local location,filter,maxcount=te:GetValue()()
if (location==LOCATION_EXTRA and eft>0) or (location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterArcKnight,tp,location,0,nil,e,tp,lscale,rscale,filter,te:GetHandler(),eset)
tg:Merge(exg)
local mct=maxcount
if mct and mct>0 and mct<ft then
maxlist[location]=mct
end
end
end
if mft<=0 then tg=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA) end
if eft<=0 then tg:Remove(Card.IsLocation,nil,LOCATION_EXTRA) end
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and math.min(c29724053[tp],eft) or eft
local left=maxlist[LOCATION_EXTRA]
if left then
maxlist[LOCATION_EXTRA]=math.min(left,ect)
else
maxlist[LOCATION_EXTRA]=ect
end
local ce=nil
local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0
if b1 and b2 then
local options={1163}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
if op>0 then
ce=eset[op]
end
elseif b2 and not b1 then
local options={}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
ce=eset[op+1]
end
if ce then
tg=tg:Filter(aux.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce)
end
if exfilter then
tg = tg:Filter(exfilter,nil)
end
Auxiliary.GCheckAdditional=cm.PendCheckAdditionalArcKnight(mft,maxlist)
Duel.Hint(tp,HINT_SELECTMSG,desc)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,ft)
Auxiliary.GCheckAdditional=nil
if not g then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset()
elseif ArkEffect_Pend then
ArkEffect_Pend = false
else
Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
end
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
cm.SetForceExtra(tp,true)
end
end
function cm.ArcKnightPCardFilter(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_PENDULUM)
end
function cm.ArcKnightPCardCheck(e)
return Duel.IsExistingMatchingCard(cm.ArcKnightPCardFilter,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler())
end end
...@@ -37,6 +37,7 @@ function cm.initial_effect(c) ...@@ -37,6 +37,7 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_PZONE) e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.ArcKnightPCardCheck) e3:SetCondition(cm.ArcKnightPCardCheck)
e3:SetCode(29036036) e3:SetCode(29036036)
e3:SetValue(function() return LOCATION_DECK,cm.ArcKnightPCardFilter,1 end ) e3:SetValue(function() return LOCATION_DECK,cm.ArcKnightPCardFilter,1 end )
...@@ -85,8 +86,7 @@ function cm.ctlop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,8 +86,7 @@ function cm.ctlop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetControl(c,1-tp,PHASE_END,2) then if Duel.GetControl(c,1-tp,PHASE_END,2) then
local g = Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp,c:GetSequence()) local g = Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp,c:GetSequence())
if g:GetCount()>0 then if g:GetCount()>0 then
local og = Duel.GetOperatedGroup() for tc in aux.Next(g) do
for tc in aux.Next(og) do
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_TRIGGER) e3:SetCode(EFFECT_CANNOT_TRIGGER)
......
...@@ -113,12 +113,12 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -113,12 +113,12 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_MZONE)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
......
...@@ -38,6 +38,7 @@ function c98920088.initial_effect(c) ...@@ -38,6 +38,7 @@ function c98920088.initial_effect(c)
e1:SetOperation(c98920088.disop) e1:SetOperation(c98920088.disop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
aux.xyz_number[98920088]=55
function c98920088.indtg(e,c) function c98920088.indtg(e,c)
return c:IsDefensePos() return c:IsDefensePos()
end end
......
...@@ -29,6 +29,7 @@ function c98920550.initial_effect(c) ...@@ -29,6 +29,7 @@ function c98920550.initial_effect(c)
e3:SetOperation(c98920550.disop) e3:SetOperation(c98920550.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
aux.xyz_number[98920550]=39
function c98920550.ovfilter(c) function c98920550.ovfilter(c)
local rk=c:GetRank() local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCode(52653092,56832966,86532744,56840427) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCode(52653092,56832966,86532744,56840427)
......
...@@ -93,7 +93,7 @@ function c98940010.operation2(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,7 +93,7 @@ function c98940010.operation2(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c98940010.sumlimit(e,c,se,sump,sumtype,sumpos,targetp) function c98940010.sumlimit(e,c,se,sump,sumtype,sumpos,targetp)
return se and se:GetHandler():IsCode(98940010) and c:IsCode(e:GetLabel()) return c:IsCode(e:GetLabel())
end end
function c98940010.sumlimit1(e,c) function c98940010.sumlimit1(e,c)
return c:IsCode(e:GetLabel()) return c:IsCode(e:GetLabel())
......
...@@ -65,7 +65,7 @@ function c9910811.racop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +65,7 @@ function c9910811.racop(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_CHANGE_RACE) e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetTargetRange(OCATION_MZONE,LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(e:GetLabel()) e1:SetValue(e:GetLabel())
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
......
...@@ -35,7 +35,7 @@ function c9910894.initial_effect(c) ...@@ -35,7 +35,7 @@ function c9910894.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--destroy --destroy
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_COUNTER) e5:SetCategory(CATEGORY_TOHAND+CATEGORY_COUNTER)
e5:SetType(EFFECT_TYPE_IGNITION) e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
...@@ -57,16 +57,37 @@ end ...@@ -57,16 +57,37 @@ end
function c9910894.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c9910894.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c9910894.tdfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil) local g=Duel.GetMatchingGroup(c9910894.tdfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if chkc then return false end if chkc then return false end
if chk==0 then return g:CheckSubGroup(aux.drccheck,2,2) end if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,aux.drccheck,false,2,4) local sg=g:SelectSubGroup(tp,aux.drccheck,false,1,4)
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
end end
function c9910894.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c9910894.tdop(e,tp,eg,ep,ev,re,r,rp) function c9910894.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<=0 then return end if tg:GetCount()>0 then
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) local ct=Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local b1=ct==2 and Duel.IsExistingMatchingCard(c9910894.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
local b2=ct==3 and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_MONSTER)
local b3=ct==4 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>1
if (b1 or b2 or b3) and Duel.SelectYesNo(tp,aux.Stringid(14001209,1)) then
if b1 then
local pg=Duel.GetMatchingGroup(c9910894.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.ChangePosition(pg,POS_FACEDOWN_DEFENSE)
elseif b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_DECK,0,1,1,nil,TYPE_MONSTER)
Duel.Destroy(dg,REASON_EFFECT)
else
Duel.DiscardHand(1-tp,nil,2,2,REASON_EFFECT+REASON_DISCARD)
end
end
end
end end
function c9910894.cfilter(c) function c9910894.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
...@@ -90,18 +111,19 @@ function c9910894.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -90,18 +111,19 @@ function c9910894.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RemoveCounter(tp,1,0,0x1,3,REASON_COST) Duel.RemoveCounter(tp,1,0,0x1,3,REASON_COST)
end end
function c9910894.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c9910894.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsCanAddCounter(tp,0x1,1,e:GetHandler()) end and Duel.IsCanAddCounter(tp,0x1,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x1)
end end
function c9910894.operation(e,tp,eg,ep,ev,re,r,rp) function c9910894.operation(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 tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT,LOCATION_REMOVED)~=0 and c:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND)
and c:IsRelateToEffect(e) then
Duel.BreakEffect() Duel.BreakEffect()
c:AddCounter(0x1,1) c:AddCounter(0x1,1)
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