Commit 692f79fb authored by Nemo Ma's avatar Nemo Ma

remove

parent ac5f40ec
No preview for this file type
--星煌之龙战士
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m,cm=rscf.DefineCard(130002001)
function cm.initial_effect(c)
--summon with 1 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(cm.otcon)
e1:SetOperation(cm.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=rsef.RegisterClone(c,e1,"code",EFFECT_SET_PROC)
local e3=rsef.I(c,{m,1},nil,"th,se,sum",nil,LOCATION_MZONE,cm.sumcon2,nil,rsop.target(cm.thfilter,"th",LOCATION_DECK),cm.sumop2)
--summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_HAND)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,m)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e4:SetTarget(cm.sumtg)
e4:SetOperation(cm.sumop)
c:RegisterEffect(e4)
end
function cm.tgfilter(c)
return c:IsAbleToGraveAsCost() and c:IsAttack(2400,2800) and c:IsDefense(1000)
end
function cm.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_DECK,0,nil)
return c:IsLevelAbove(5) and minc<=1 and #mg>0 and cm.switch
end
function cm.otop(e,tp,eg,ep,ev,re,r,rp,c)
cm.switch=false
c:SetMaterial(Group.CreateGroup())
local ct,og,tc=rsop.SelectToGrave(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil,{REASON_SUMMON+REASON_COST })
if not tc then return end
local code=tc:GetCode()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetValue(code)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
c:RegisterEffect(e2)
c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,1)
if not tc:IsLocation(LOCATION_GRAVE) then return end
local fid=tc:GetFieldID()
tc:RegisterFlagEffect(m,rsreset.est,0,1,fid)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
e7:SetCondition(cm.descon)
c:RegisterEffect(e7)
e7:SetLabel(fid)
end
function cm.descon(e)
return not Duel.IsExistingMatchingCard(cm.descfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e:GetLabel())
end
function cm.descfilter(c,fid)
return c:GetFlagEffectLabel(m)==fid
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
cm.switch=true
local res=c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1) cm.switch=false
return res
end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
cm.switch=true
local pos=0
if c:IsSummonable(true,nil,1) then pos=pos+POS_FACEUP_ATTACK end
if c:IsMSetable(true,nil,1) then pos=pos+POS_FACEDOWN_DEFENSE end
if pos==0 then return end
Duel.BreakEffect()
if Duel.SelectPosition(tp,c,pos)==POS_FACEUP_ATTACK then
Duel.Summon(tp,c,true,nil,1)
else
Duel.MSet(tp,c,true,nil,1)
end
end
function cm.sumcon2(e,tp)
return not Duel.IsExistingMatchingCard(cm.sumcfilter,tp,0,LOCATION_MZONE,1,nil)
end
function cm.sumcfilter(c)
return c:IsFaceup() and c:IsSummonableCard()
end
function cm.thfilter(c)
return c:IsSummonableCard() and c:IsLevelAbove(5) and c:IsAbleToHand()
end
function cm.sumop2(e,tp)
local ct,og,tc=rsop.SelectToHand(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,{})
if not tc then return end
local pos=0
if tc:IsSummonable(true,nil,1) then pos=pos+POS_FACEUP_ATTACK end
if tc:IsMSetable(true,nil,1) then pos=pos+POS_FACEDOWN_DEFENSE end
if pos==0 or not rsop.SelectYesNo(tp,{m,3}) then return end
if Duel.SelectPosition(tp,tc,pos)==POS_FACEUP_ATTACK then
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
\ No newline at end of file
--大天之龙战士
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m,cm=rscf.DefineCard(130002002)
function cm.initial_effect(c)
local e1=rsef.QO(c,nil,{m,0},{1,m},"se,th,sum",nil,LOCATION_HAND,nil,nil,rsop.target(cm.thfilter,"th",LOCATION_DECK),cm.thop)
local e2=rsef.QO(c,nil,{m,1},{1,m+100},nil,"tg",LOCATION_GRAVE,nil,rscost.cost(Card.IsAbleToHandAsCost,"th"),rstg.target(cm.tgfilter,nil,LOCATION_MZONE),cm.tgop)
end
function cm.tgfilter(c)
return c:IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.tgop(e,tp)
local c,tc=e:GetHandler(),rscf.GetTargetCard()
if not tc then return end
tc:RegisterFlagEffect(m,rsreset.est,0,1)
local e1=rsef.FV_LIMIT_PLAYER({c,tp},"sp",nil,cm.lstg,{0,1},cm.lcon)
local e2=rsef.FV_LIMIT_PLAYER({c,tp},"act",cm.lval,nil,{0,1},cm.lcon)
end
function cm.lstg(e,c)
return c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
end
function cm.lval(e,re)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsLocation(LOCATION_HAND+LOCATION_GRAVE)
end
function cm.lcfilter(c)
return c:GetFlagEffect(m)>0
end
function cm.lcon(e)
if Duel.IsExistingMatchingCard(cm.lcfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
return true
else
e:Reset()
return false
end
end
function cm.thfilter(c)
return c:IsSummonableCard() and c:IsLevelAbove(5) and c:IsAbleToHand()
end
function cm.thop(e,tp)
local c=e:GetHandler()
local ct,og,tc=rsop.SelectToHand(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,{})
if not tc then return end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.otcon)
e1:SetOperation(cm.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
tc:RegisterEffect(e1,true)
local e2=rsef.RegisterClone({c,tc},e1,"code",EFFECT_SET_PROC)
local pos=0
if tc:IsSummonable(true,nil,1) then pos=pos+POS_FACEUP_ATTACK end
if tc:IsMSetable(true,nil,1) then pos=pos+POS_FACEDOWN_DEFENSE end
if pos==0 or not rsop.SelectYesNo(tp,{m,3}) then return end
Duel.BreakEffect()
if Duel.SelectPosition(tp,tc,pos)==POS_FACEUP_ATTACK then
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
function cm.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
return c:IsLevelAbove(5) and minc<=1 and Duel.IsPlayerCanDiscardDeckAsCost(1-tp,c:GetLevel())
end
function cm.otop(e,tp,eg,ep,ev,re,r,rp,c)
c:SetMaterial(Group.CreateGroup())
Duel.DiscardDeck(1-tp,c:GetLevel(),REASON_COST+REASON_SUMMON)
e:Reset()
end
--青玉之龙战士
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m,cm=rscf.DefineCard(130002003)
function cm.initial_effect(c)
local e1=rscf.SetSummonCondition(c,true,aux.FALSE)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetValue(SUMMON_TYPE_ADVANCE)
e2:SetCondition(cm.ntcon)
e2:SetOperation(cm.ntop)
c:RegisterEffect(e2)
local e3=rsef.FC(c,EVENT_CHAINING)
rsef.RegisterSolve(e3,cm.tdcon,nil,nil,cm.tdop)
end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) and re:GetHandler():IsRelateToEffect(re) and Duel.IsPlayerCanSendtoDeck(1-tp,re:GetHandler())
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
rshint.Card(m)
Duel.SendtoDeck(re:GetHandler(),nil,2,REASON_RULE)
end
function cm.ntcon(e,c,minc)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
local g1=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
local g2=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,1-tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
return c:IsLevelAbove(5) and #g1>0 and #g2>0
end
function cm.ntop(e,tp,eg,ep,ev,re,r,rp,c)
c:SetMaterial(Group.CreateGroup())
local sg=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,LOCATION_HAND+LOCATION_ONFIELD,c)
rshint.Select(tp,"tg")
local tg=sg:SelectSubGroup(tp,cm.gcheck,false,2,#sg)
Duel.SendtoGrave(tg,REASON_COST+REASON_SUMMON)
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if #og<=0 then return end
local fid=c:GetFieldID()
for tc in aux.Next(og) do
tc:RegisterFlagEffect(m,rsreset.est,0,1,fid)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_MAX_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetCondition(cm.limitcon)
e1:SetValue(cm.mvalue)
e1:SetLabel(fid)
Duel.RegisterEffect(e1,tp)
local e2=rsef.RegisterClone({c,tp},e1,"code",EFFECT_MAX_SZONE,"value",cm.svalue)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,1)
e5:SetValue(cm.aclimit)
e5:SetCondition(cm.limitcon2)
e5:SetLabel(fid)
Duel.RegisterEffect(e5,tp)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_SSET)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,1)
e6:SetTarget(cm.setlimit)
e6:SetLabel(fid)
e6:SetCondition(cm.limitcon2)
Duel.RegisterEffect(e6,tp)
end
function cm.limitcon2(e)
local ct=Duel.GetMatchingGroupCount(cm.limitcfilter,0,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,nil,e:GetLabel())
if ct>0 then
return true
else
e:Reset()
return false
end
end
function cm.aclimit(e,re,tp)
local ct=Duel.GetMatchingGroupCount(cm.limitcfilter,0,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,nil,e:GetLabel())
if not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
if re:IsActiveType(TYPE_FIELD) then
return not Duel.GetFieldCard(tp,LOCATION_FZONE,0) and not Duel.GetFieldCard(1-tp,LOCATION_FZONE,0) and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>(ct-1)
elseif re:IsActiveType(TYPE_PENDULUM) then
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>(ct-1)
end
return false
end
function cm.setlimit(e,c,tp)
local ct=Duel.GetMatchingGroupCount(cm.limitcfilter,0,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,nil,e:GetLabel())
return c:IsType(TYPE_FIELD) and not Duel.GetFieldCard(tp,LOCATION_FZONE,0) and not Duel.GetFieldCard(1-tp,LOCATION_FZONE,0) and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)>(ct-1)
end
function cm.limitcon(e)
local ct=Duel.GetMatchingGroupCount(cm.limitcfilter,0,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,nil,e:GetLabel())
if ct>0 then
return Duel.GetFieldGroupCount(0,LOCATION_ONFIELD,LOCATION_ONFIELD)<=ct
else
e:Reset()
return false
end
end
function cm.limitcfilter(c,fid)
return c:GetFlagEffectLabel(m)==fid
end
function cm.mvalue(e,fp,rp,r)
local bct=Duel.GetMatchingGroupCount(cm.limitcfilter,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,e:GetLabel())
local oct=Duel.GetFieldGroupCount(fp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if oct>=bct then return 0
else
return bct-oct
end
end
function cm.svalue(e,fp,rp,r)
local bct=Duel.GetMatchingGroupCount(cm.limitcfilter,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,e:GetLabel())
for i=5,7 do
if Duel.GetFieldCard(fp,LOCATION_SZONE,i) then bct=bct-1 end
if Duel.GetFieldCard(1-fp,LOCATION_SZONE,i) then bct=bct-1 end
end
local oct=Duel.GetFieldGroupCount(fp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if oct>=bct then return 0
else
return bct-oct
end
end
function cm.gcheck(g)
return g:FilterCount(Card.IsControler,nil,0)==g:FilterCount(Card.IsControler,nil,1)
end
\ No newline at end of file
--伴月之龙战士
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m,cm=rscf.DefineCard(130002004)
function cm.initial_effect(c)
local e1=rscf.SetSummonCondition(c,true,aux.FALSE)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(cm.ttcon)
e2:SetOperation(cm.ttop)
e2:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SUMMON_PROC)
e3:SetCondition(cm.ttcon2)
e3:SetOperation(cm.ttop2)
e3:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e3)
--local e11=rsef.RegisterClone(c,e2,"code",EFFECT_SET_PROC)
local e12=rsef.RegisterClone(c,e3,"code",EFFECT_SET_PROC)
local e4=rsef.FTO(c,EVENT_SUMMON)
e4:SetRange(LOCATION_HAND)
rsef.RegisterSolve(e4,cm.negcon,nil,nil,cm.negop)
local e5=rsef.FC(c,EVENT_ADJUST)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(cm.thop)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
local phase=Duel.GetCurrentPhase()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if #g<=0 then return end
local ct=Duel.SendtoHand(g,nil,REASON_EFFECT)
local bct=c:GetFlagEffectLabel(m)
if not bct then return end
e:SetLabel(ct)
if e:GetLabel()==bct then
local hg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil)
if #hg>0 then
Duel.SendtoDeck(hg,nil,2,REASON_EFFECT)
end
end
Duel.Readjust()
end
function cm.ttcon(e,c,minc)
if c==nil then return true end
return c:IsLevelAbove(5) and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,c:GetControler(),0,LOCATION_MZONE,1,nil)
end
function cm.ttop(e,tp,eg,ep,ev,re,r,rp,c)
rshint.Select(tp,"tg")
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,0,LOCATION_MZONE,1,99,nil)
c:SetMaterial(tg)
Duel.SendtoGrave(tg,REASON_SUMMON+REASON_COST+REASON_MATERIAL)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
c:RegisterFlagEffect(m,rsreset.est-RESET_TOFIELD,0,1,ct)
end
function cm.ttcon2(e,c,minc)
if c==nil then return true end
return c:IsLevelAbove(5) and cm.switch --and cm.switch:FilterCount(Card.IsHasEffect,nil,EFFECT_CANNOT_DISABLE_SUMMON)~=#cm.switch
end
function cm.ttop2(e,tp,eg,ep,ev,re,r,rp,c)
c:SetMaterial(Group.CreateGroup())
Duel.NegateSummon(cm.switch)
Duel.SendtoGrave(cm.switch,REASON_COST+REASON_SUMMON)
cm.switch=false
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
c:RegisterFlagEffect(m,rsreset.est-RESET_TOFIELD,0,1,ct)
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
cm.switch=eg
local res=tp~=ep and Duel.GetCurrentChain()==0 and (e:GetHandler():IsSummonable(true,nil,1) or e:GetHandler():IsMSetable(true,nil,1))
cm.switch=false
return res
end
function cm.negop(e,tp,eg)
eg:KeepAlive()
cm.switch=eg
local c=e:GetHandler()
local s1=c:IsSummonable(true,nil,1)
local s2=c:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,c,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,c,true,nil,1)
else
Duel.MSet(tp,c,true,nil,1)
end
end
--龙战士的托宣
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m,cm=rscf.DefineCard(130002005)
function cm.initial_effect(c)
rsef.CreatEvent_Set()
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(cm.handcon)
c:RegisterEffect(e0)
local e1=rsef.ACT(c,nil,nil,nil,"se,th,sum",nil,nil,nil,nil,cm.act)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SUMMON_PROC)
e3:SetTargetRange(LOCATION_HAND,0)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.ttcon2)
e3:SetTarget(aux.TargetBoolFunction(Card.IsLevelAbove,5))
e3:SetOperation(cm.ttop2)
e3:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e3)
local e5=rsef.RegisterClone(c,e3,"code",EFFECT_SET_PROC)
local e4=rsef.FTO(c,rscode.Set,{m,2},nil,"sum")
e4:SetRange(LOCATION_SZONE)
rsef.RegisterSolve(e4,cm.sumcon,nil,nil,cm.sumop)
end
function cm.sumfilter(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
cm.switch=eg
local res=tp~=ep and eg:IsExists(Card.IsAbleToDeckOrExtraAsCost,1,nil) and Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND,0,1,nil)
cm.switch=false
return res
end
function cm.sumop(e,tp,eg)
if not e:GetHandler():IsRelateToEffect(e) then return end
eg:KeepAlive()
cm.switch=eg
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil)
else
Duel.MSet(tp,tc,true,nil)
end
end
end
function cm.ttcon2(e,c,minc)
if c==nil then return true end
return c:IsLevelAbove(5) and cm.switch
end
function cm.ttop2(e,tp,eg,ep,ev,re,r,rp,c)
c:SetMaterial(Group.CreateGroup())
Duel.SendtoDeck(cm.switch,nil,2,REASON_COST+REASON_SUMMON)
cm.switch=false
end
function cm.cfilter(c)
return c:IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.handcon(e)
return not Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cm.act(e,tp)
local c=aux.ExceptThisCard(e)
if not c then return end
rsop.SelectOC({m,0})
local ct,og,tc=rsop.SelectToHand(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,{})
if ct<=0 then return end
local pos=0
if tc:IsSummonable(true,nil,1) then pos=pos+POS_FACEUP_ATTACK end
if tc:IsMSetable(true,nil,1) then pos=pos+POS_FACEDOWN_DEFENSE end
if pos==0 or not rsop.SelectYesNo(tp,{m,1}) then return end
Duel.BreakEffect()
if Duel.SelectPosition(tp,tc,pos)==POS_FACEUP_ATTACK then
local e1,e2=rsef.FV_LIMIT_PLAYER({c,tc,true},"sum,sp",nil,cm.limittg,{0,1},nil,rsreset.est-RESET_TOFIELD)
e1:SetRange(LOCATION_MZONE)
e2:SetRange(LOCATION_MZONE)
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
function cm.limittg(e,c)
return c:IsLevelBelow(e:GetHandler():GetLevel())
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSummonableCard() and c:IsLevelAbove(5)
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