Commit a2c20316 authored by POLYMER's avatar POLYMER

fix

parent b9ae2ca1
--余火 --余火
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end function c10171001.initial_effect(c)
local m,cm=rscf.DefineCard(10171001) --release self
if rsds then return end local e1=Effect.CreateEffect(c)
rsds=cm e1:SetType(EFFECT_TYPE_QUICK_O)
function rsds.cost1(e,...) e1:SetCode(EVENT_FREE_CHAIN)
e:SetLabel(100) e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
return rscost.cost(Card.IsReleasable,"res")(e,...) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
end e1:SetCost(c10171001.rscost)
function cm.costfun(e,tp) e1:SetTarget(c10171001.rstg)
e:SetValue(100) e1:SetOperation(c10171001.rsop)
end c:RegisterEffect(e1)
function rsds.cost2(ct) --to hand
return function(e,...) local e2=Effect.CreateEffect(c)
e:SetLabel(100) e2:SetDescription(aux.Stringid(10171001,0))
return rscost.cost(cm.rmcfilter,"rm",LOCATION_GRAVE,LOCATION_GRAVE,ct,ct)(e,...) e2:SetCategory(CATEGORY_TOHAND)
end e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
end e2:SetCode(EVENT_LEAVE_FIELD)
function cm.rmcfilter(c,e,tp) e2:SetRange(LOCATION_REMOVED)
if not c:IsAbleToRemoveAsCost() or not c:IsType(TYPE_MONSTER) then return false end e2:SetProperty(EFFECT_FLAG_DELAY)
return (c:IsCode(m) and c:IsControler(tp)) or (Duel.IsPlayerAffectedByEffect(tp,m+19) and not c:IsCode(e:GetHandler():GetCode())) e2:SetCondition(c10171001.thcon)
end e2:SetTarget(c10171001.thtg)
function rsds.SearchFun(c,scode,op) e2:SetOperation(c10171001.thop)
local e1=rsef.STO(c,EVENT_SUMMON_SUCCESS,{m,0},nil,"se,th","de,dsp",nil,rsds.cost2(1),rsop.target(cm.thfilter(scode),"th",LOCATION_DECK),cm.thop(scode,op)) c:RegisterEffect(e2)
local e2=rsef.RegisterClone(c,e1,"code",EVENT_SPSUMMON_SUCCESS) end
return e1,e2 function c10171001.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
end if chk==0 then return e:GetHandler():IsReleasable() end
function cm.thfilter(scode) Duel.Release(e:GetHandler(),REASON_COST)
return function(c) end
return c:IsCode(scode) and c:IsAbleToHand() function c10171001.spfilter(c,e,tp)
end return c:IsSetCard(0xa335) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.thop(scode,op) function c10171001.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
return function(e,tp,...)
local ct,og,tc=rsop.SelectToHand(tp,cm.thfilter(scode),tp,LOCATION_DECK,0,1,1,nil,{})
if ct>0 and op then
op(tc,e,tp,...)
end
end
end
function rsds.ChainingFun(c,code,cate,flag,tg,op)
local e1=rsef.QO(c,EVENT_CHAINING,{code,0},1,cate,flag,LOCATION_MZONE,cm.cfcon,nil,tg,op)
return e1
end
function cm.cfcon(e,tp,eg,ep,ev,re,r,rp)
for i=1,ev do
local te,tep,tecode1,tecode2,teloc=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2,CHAININFO_TRIGGERING_LOCATION )
if tep==tp and (tecode1==m or (tecode2 and tecode2==m)) and teloc&LOCATION_HAND+LOCATION_ONFIELD ~=0 then
return true
end
end
return false
end
function rsds.ExtraSummonFun(c,code)
local e1=rscf.SetSummonCondition(c,false,cm.exsumval(code))
return e1
end
function cm.exsumval(code,excode)
return function(e,se,sp,st)
--if not e:GetHandler():IsLocation(LOCATION_EXTRA) then return true end
return se and se:GetHandler():IsCode(code,excode or 0)
end
end
function rsds.TributeFun(c,code,cate,flag,tg,op,isign)
local e1=rsef.QO(c,nil,{code,0},{1,code},cate,flag,LOCATION_HAND,nil,rsds.cost1,tg,op)
if isign then e1:SetType(EFFECT_TYPE_IGNITION) end
return e1
end
function rsds.SpExtraFun(c,code,rmcode,spcode,con,ct)
ct=ct or 1
local e1=rsef.QO(c,nil,{code,1},{1,code+100},"sp",nil,LOCATION_GRAVE,con,rscost.reglabel(100),cm.spetg(rmcode,spcode,ct),cm.speop(spcode))
return e1
end
function cm.spefilter(c,e,tp,spcode)
return c:IsCode(spcode) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sprmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and c:IsSetCard(0xa335)
end
function cm.specfilter(c,rmcode)
return c:IsCode(rmcode) and c:IsAbleToRemoveAsCost()
end
function cm.spgfilter(g,rmcode)
return g:IsExists(Card.IsCode,1,nil,rmcode)
end
function cm.spetg(rmcode,spcode,ct)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.spefilter,tp,LOCATION_EXTRA,0,nil,e,tp,spcode) local b1=Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c10171001.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
local rg=Duel.GetMatchingGroup(cm.sprmfilter,tp,LOCATION_GRAVE,0,c) local b2=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_FUSION) if chk==0 then return b1 or b2 end
if chk==0 then local off=1
if e:GetLabel()==100 then local ops,opval={},{}
return c:IsAbleToRemoveAsCost() and rg:IsExists(Card.IsCode,1,nil,rmcode) and #g>0 if b1 then
ops[off]=aux.Stringid(10171001,2)
opval[off]=0
off=off+1
end
if b2 then
ops[off]=aux.Stringid(10171001,4)
opval[off]=1
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
e:SetLabel(sel)
if sel==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
else else
return #g>0 and ct==1 e:SetCategory(CATEGORY_ATKCHANGE)
end
end
local sct=math.min(ct,#g)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then sct=1 end
if c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp] then sct=math.min(c29724053[tp],sct) end
sct=math.min(sct,ft)
local sct2=0
if e:GetLabel()==100 then
e:SetLabel(0)
rshint.Select(tp,"rm")
local rg2=rg:SelectSubGroup(tp,cm.spgfilter,false,1,sct,rmcode)
rg2:AddCard(c)
sct2=Duel.Remove(rg2,POS_FACEUP,REASON_COST)-1
end
e:SetValue(ct==1 and sct or sct2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,sct,tp,LOCATION_EXTRA)
end end
end end
function cm.speop(spcode) function c10171001.rsop(e,tp,eg,ep,ev,re,r,rp)
return function(e,tp,...) local sel=e:GetLabel()
local sg=Duel.GetMatchingGroup(cm.spefilter,tp,LOCATION_EXTRA,0,nil,e,tp,spcode) if sel==0 then
local sct=e:GetValue() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if sct<=0 or #sg<sct then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if sct>=2 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end local g=Duel.SelectMatchingCard(tp,c10171001.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]<sct then return end if g:GetCount()>0 then
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_FUSION) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if ft<sct then return end
local ct,og=rsgf.SelectSpecialSummon(sg,tp,aux.TRUE,sct,sct,nil,{})
if #og>0 then
for tc in aux.Next(og) do
tc:CompleteProcedure()
end
end
end end
end else
------------------------- local c=e:GetHandler()
function cm.initial_effect(c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local e2=rsef.QO(c,nil,{m,2},nil,"sp",nil,LOCATION_HAND+LOCATION_MZONE,nil,rsds.cost1,rsop.target2(cm.resetfun,cm.spfilter,"sp",LOCATION_HAND),cm.spop) local tc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
local e3=rsef.QO(c,nil,{m,4},nil,"atk,def","dsp",LOCATION_HAND+LOCATION_MZONE,nil,rsds.cost1,rsop.target(cm.atkfilter,"dum",LOCATION_MZONE,LOCATION_MZONE),cm.atkop) if tc and not tc:IsImmuneToEffect(e) then
local e4=rsef.FTF(c,EVENT_LEAVE_FIELD,{m,0},nil,"th",nil,LOCATION_REMOVED,cm.embthcon,cm.embthcost,rsop.target(Card.IsAbleToHand,"th"),cm.embthop) local e1=Effect.CreateEffect(c)
end e1:SetType(EFFECT_TYPE_SINGLE)
function cm.recop(e,tp) e1:SetCode(EFFECT_UPDATE_ATTACK)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
Duel.Recover(p,d,REASON_EFFECT) e1:SetValue(500)
end e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
function cm.resetfun(g,e,tp) tc:RegisterEffect(e1)
e:SetLabel(0) local e2=e1:Clone()
end e2:SetCode(EFFECT_UPDATE_DEFENSE)
function cm.spfilter(c,e,tp) tc:RegisterEffect(e2)
return c:IsSetCard(0xa335) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((e:GetLabel()==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or (e:GetLabel()==100 and Duel.GetMZoneCount(tp,e:GetHandler(),tp)>0 and c~=e:GetHandler())) local e3=Effect.CreateEffect(c)
end e3:SetType(EFFECT_TYPE_FIELD)
function cm.spop(e,tp) e3:SetCode(EFFECT_CANNOT_INACTIVATE)
rsop.SelectSpecialSummon(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,{},e,tp) e3:SetLabel(1)
end e3:SetValue(c10171001.effectfilter)
function cm.rmfilter(c,e,tp) e3:SetReset(RESET_PHASE+PHASE_END)
return c:IsAbleToRemove() and c:IsFaceup() and (e:GetLabel()~=100 or c~=e:GetHandler()) Duel.RegisterEffect(e3,tp)
end local e4=e3:Clone()
function cm.rmop(e,tp) e4:SetCode(EFFECT_CANNOT_DISEFFECT)
local ct,og,tc=rsop.SelectRemove(tp,cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,{ POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY },e,tp) e4:SetLabel(2)
if tc and tc:IsLocation(LOCATION_REMOVED) and Duel.ReturnToField(tc) then Duel.RegisterEffect(e4,tp)
local e1=rsef.SV_UPDATE({e:GetHandler(),tc},"atk",300,nil,rsreset.est,"cd") e3:SetLabelObject(e4)
e4:SetLabelObject(tc)
--chk
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_LEAVE_FIELD_P)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END)
e0:SetLabelObject(e3)
e0:SetOperation(c10171001.chk)
tc:RegisterEffect(e0)
tc:RegisterFlagEffect(10171001,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(10171001,5))
end
end
end
function c10171001.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local label=e:GetLabel()
local tc
if label==1 then
tc=e:GetLabelObject():GetLabelObject()
else
tc=e:GetLabelObject()
end end
return tc and tc==te:GetHandler()
end end
function cm.atkfilter(c,e,tp) function c10171001.chk(e,tp,eg,ep,ev,re,r,rp)
return c:IsFaceup() and ( not e:IsCostChecked() or c~=e:GetHandler())
end
function cm.atkop(e,tp)
local ct=rsop.SelectSolve(HINTMSG_FACEUP,tp,cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,aux.ExceptThisCard(e),cm.solvefun,e,tp)
end
function cm.solvefun(g,e,tp)
local tc=g:GetFirst()
local c=e:GetHandler() local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(tc)) local e3=e:GetLabelObject()
local e1,e2=rscf.QuickBuff({c,tc},"atk+,def+",500,"rst",rsreset.est_pend) local e4=e3:GetLabelObject()
tc:RegisterFlagEffect(m,rsreset.est_pend-RESET_LEAVE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,5)) local te=c:GetReasonEffect()
local e3,e4=rsef.FV_CANNOT_DISABLE({c,tp},"neg,dise",cm.imval(tc),nil,nil,nil,rsreset.pend) if c:GetFlagEffect(10171001)==0 or not te or not te:IsActivated() or te:GetHandler()~=c then
--local phase=Duel.GetCurrentPhase() e3:Reset()
--if phase>PHASE_MAIN1 and phase<PHASE_MAIN2 then phase=PHASE_BATTLE end e4:Reset()
--local e3=rsef.SV_IMMUNE_EFFECT({c,tc},rsval.imoe,cm.imcon(phase),rsreset.pend) else
end --reset
function cm.imval(tc) local e0=Effect.CreateEffect(c)
return function(e,ev) e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
local te,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_LOCATION) e0:SetCode(EVENT_CHAIN_END)
return tc:GetFlagEffect(m)>0 and loc&LOCATION_MZONE ~=0 and te:GetHandler()==tc e0:SetLabelObject(e3)
e0:SetOperation(c10171001.resetop)
Duel.RegisterEffect(e0,tp)
end end
end end
function cm.imcon(phase) function c10171001.resetop(e,tp,eg,ep,ev,re,r,rp)
return function(e) local e3=e:GetLabelObject()
local cp=Duel.GetCurrentPhase() local e4=e3:GetLabelObject()
if cp>PHASE_MAIN1 and cp<PHASE_MAIN2 then cp=PHASE_BATTLE end e3:Reset()
return cp==phase e4:Reset()
end e:Reset()
end end
function cm.embthfilter(c) function c10171001.cfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(0xa335,0xc335) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsSetCard(0xa335,0xc335)
end end
function cm.embthcon(e,tp,eg,ep,ev,re,r,rp) function c10171001.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.embthfilter,1,nil) return eg:IsExists(c10171001.cfilter,1,nil)
end end
function cm.embthcost(e,tp,eg,ep,ev,re,r,rp,chk) function c10171001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentChain()==0 end if chk==0 then return Duel.GetCurrentChain()==0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end end
function cm.embthop(e,tp) function c10171001.thop(e,tp,eg,ep,ev,re,r,rp)
local c=aux.ExceptThisCard(e) if e:GetHandler():IsRelateToEffect(e) then
if c then Duel.SendtoHand(c,nil,REASON_EFFECT) end Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end end
...@@ -36,29 +36,29 @@ end ...@@ -36,29 +36,29 @@ end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local ac=g:GetFirst() local ac=g:GetFirst()
local num=#g local ag=Group.CreateGroup()
for i=1,num do for i=1,#g do
if talon[ac:GetCode()]==nil then if talon[ac:GetCode()]~=nil then
g:RemoveCard(ac) ag:AddCard(ac)
end end
ac=g:GetNext() ac=g:GetNext()
end end
if chk==0 then return g:GetCount()>0 end if chk==0 then return ag:GetCount()>0 end
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message("a") --Debug.Message("a")
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local ac=g:GetFirst() local ac=g:GetFirst()
local ag=Group.CreateGroup()
for i=1,#g do for i=1,#g do
if talon[ac:GetCode()]==nil then if talon[ac:GetCode()]~=nil then
g:RemoveCard(ac) ag:AddCard(ac)
end end
ac=g:GetNext() ac=g:GetNext()
end end
--Debug.Message("b") if ag:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
--Debug.Message("c") local sg=ag:Select(tp,1,1,nil)
local sg=g:Select(tp,1,1,nil)
if sg:GetCount()>0 then if sg:GetCount()>0 then
local ace=talon[sg:GetFirst():GetCode()] local ace=talon[sg:GetFirst():GetCode()]
cm.ActivateEffect(ace,tp,e) cm.ActivateEffect(ace,tp,e)
......
...@@ -84,6 +84,16 @@ function c9910953.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -84,6 +84,16 @@ function c9910953.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
e2:SetLabelObject(e3) e2:SetLabelObject(e3)
e3:SetLabelObject(tc) e3:SetLabelObject(tc)
--chk
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_LEAVE_FIELD_P)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e0:SetLabelObject(e2)
e0:SetOperation(c9910953.chk)
tc:RegisterEffect(e0)
tc:RegisterFlagEffect(9910953,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(9910953,1))
end end
end end
end end
...@@ -98,3 +108,28 @@ function c9910953.effectfilter(e,ct) ...@@ -98,3 +108,28 @@ function c9910953.effectfilter(e,ct)
end end
return tc and tc==te:GetHandler() return tc and tc==te:GetHandler()
end end
function c9910953.chk(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=e:GetLabelObject()
local e3=e2:GetLabelObject()
local te=c:GetReasonEffect()
if c:GetFlagEffect(9910953)==0 or not te or not te:IsActivated() or te:GetHandler()~=c then
e2:Reset()
e3:Reset()
else
--reset
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_CHAIN_END)
e0:SetLabelObject(e3)
e0:SetOperation(c9910953.resetop)
Duel.RegisterEffect(e0,tp)
end
end
function c9910953.resetop(e,tp,eg,ep,ev,re,r,rp)
local e3=e:GetLabelObject()
local e4=e3:GetLabelObject()
e3:Reset()
e4:Reset()
e:Reset()
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