Commit b72f5c95 authored by Huangnan's avatar Huangnan

fix

parent 603ace2d
No preview for this file type
......@@ -6,6 +6,7 @@ function s.initial_effect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_STANDBY_PHASE)
e1:SetOperation(s.activate)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
......@@ -15,6 +16,9 @@ function s.initial_effect(c)
e2:SetCondition(s.handcon)
c:RegisterEffect(e2)
end
function s.handcon(e)
return Duel.GetCurrentPhase()==PHASE_STANDBY
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetDescription(aux.Stringid(id,2))
......@@ -28,9 +32,6 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function s.handcon(e)
return Duel.GetCurrentPhase()==PHASE_STANDBY
end
function s.costtg(e,te,tp)
e:SetLabelObject(te:GetHandler())
return true
......
......@@ -141,7 +141,7 @@ function s.e1operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(acon)
e2:SetCondition(s.acon)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
......
......@@ -53,7 +53,6 @@ end
--效果①处理--
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
Debug.Message(111)
local chk0=Duel.IsExistingMatchingCard(s.chkfilter0,tp,0,LOCATION_HAND,1,nil)
local chk1=Duel.IsExistingMatchingCard(s.chkfilter1,tp,0,LOCATION_HAND,1,nil,tp)
if chk==0 then return (chk0 or chk1) end
......
......@@ -46,7 +46,7 @@ function cm.filter1(c)
return c:IsFaceup() and c:IsRace(RACE_AQUA) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function cm.filter2(c,e)
return not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
return not c:IsImmuneToEffect(e) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER)
end
function cm.filter3(c,e)
return cm.filter1(c) and not c:IsImmuneToEffect(e)
......@@ -56,10 +56,10 @@ function cm.spfilter(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.filter4(c,e)
return c:IsAbleToDeck() and c:GetFlagEffect(18700544)>0
return c:IsAbleToDeck() and c:GetFlagEffect(18700544)>0 and c:IsRace(RACE_AQUA)
end
function cm.filter5(c,e)
return not c:IsImmuneToEffect(e) and c:IsAbleToDeck() and c:GetFlagEffect(18700544)>0
return not c:IsImmuneToEffect(e) and c:IsAbleToDeck() and c:GetFlagEffect(18700544)>0 and c:IsRace(RACE_AQUA)
end
function cm.chkfilter(c,tp)
return c:IsCode(18700548,18700552)
......
......@@ -26,8 +26,11 @@ end
function cm.filter1(c)
return c:IsFaceup() and c:IsRace(RACE_AQUA) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function cm.filter2(c,e)
return not c:IsImmuneToEffect(e)
function cm.ffilter(c)
return c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function cm.ffilter2(c,e)
return cm.ffilter(c) and not c:IsImmuneToEffect(e)
end
function cm.filter3(c,e)
return cm.filter1(c) and not c:IsImmuneToEffect(e)
......@@ -54,7 +57,7 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local mg1=Duel.GetMatchingGroup(cm.ffilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local mg2=Duel.GetMatchingGroup(cm.filter1,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil)
if Duel.IsExistingMatchingCard(cm.chkfilter,tp,LOCATION_MZONE+LOCATION_REMOVED,0,1,nil,tp) and mg2:GetCount()>0 then
mg1:Merge(mg2)
......@@ -79,7 +82,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local mg1=Duel.GetMatchingGroup(cm.ffilter2,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local mg2=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,e)
local exmat=false
if mg1:IsExists(cm.chkfilter,1,nil,tp) and mg2:GetCount()>0 then
......
......@@ -20,17 +20,21 @@ function cm.initial_effect(c)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,m+2)
e4:SetCondition(cm.tkcon)
e4:SetTarget(cm.thtg2)
e4:SetOperation(cm.thop2)
c:RegisterEffect(e4)
if not cm.check then
cm.check=true
local e1=Effect.CreateEffect(c)
......@@ -38,52 +42,42 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.chainop)
Duel.RegisterEffect(e1,0)
local f1=Card.CheckFusionMaterial
local _CheckFusionMaterial=Card.CheckFusionMaterial
local _SelectFusionMaterial=Duel.SelectFusionMaterial
function Card.CheckFusionMaterial(card,Group_fus,Card_g,int_chkf,not_mat)
local exg=Group.CreateGroup()
exg=Duel.GetMatchingGroup(cm.filter0,int_chkf,0,LOCATION_MZONE+LOCATION_GRAVE,nil,card)
exg=Group.__bxor(exg,Group_fus):Filter(Card.IsLocation,nil,LOCATION_MZONE+LOCATION_GRAVE)
if exg:GetCount()>0 then
if Duel.GetFlagEffect(0,m)~=0 and Duel.GetFlagEffect(0,m+50)==0 then
Duel.RegisterFlagEffect(0,m+50,RESET_CHAIN,0,1)
local e1=Effect.CreateEffect(card)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(cm.resetop)
e1:SetReset(RESET_EVENT+RESET_CHAIN)
Duel.RegisterEffect(e1,0)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,0)
end
local hg=Group.__add(exg,Group_fus)
return f1(card,hg,Card_g,int_chkf,not_mat)
local tp=card:GetControler()
local exg=Duel.GetMatchingGroup(cm.filter0,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,card)
exg:Sub(Group_fus)
if #exg>0 and Duel.GetFlagEffect(tp,18700544)>0 then
local hg=Group.__add(Group_fus,exg)
return _CheckFusionMaterial(card,hg,Card_g,int_chkf,not_mat)
end
return f1(card,Group_fus,Card_g,int_chkf,not_mat)
return _CheckFusionMaterial(card,Group_fus,Card_g,int_chkf,not_mat)
end
local f2=Duel.SelectFusionMaterial
function Duel.SelectFusionMaterial(tp,card,mg,gc_nil,chkf)
if Duel.GetFlagEffect(0,m+50)~=0 then
exg=Duel.GetMatchingGroup(cm.filter0,int_chkf,LOCATION_MZONE+LOCATION_GRAVE,0,nil,card)
if exg:GetCount()>0 then
mg:Merge(exg)
end
if Duel.GetFlagEffect(tp,18700544)>0 then
local exg=Duel.GetMatchingGroup(cm.filter0,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,card)
mg:Merge(exg)
end
Duel.ResetFlagEffect(0,m+50)
return f2(tp,card,mg,gc_nil,chkf)
return _SelectFusionMaterial(tp,card,mg,gc_nil,chkf)
end
end
end
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1)
end
function cm.resetop(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(0,m+50)
e:Reset()
if re:GetHandlerPlayer()==tp then
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end
end
function cm.filter0(c,fc)
return c:GetFlagEffect(m)>0 and c:IsCanBeFusionMaterial(fc)
return c:IsCanBeFusionMaterial(fc)
and c:GetFlagEffect(18700544)>0
and c:IsLocation(LOCATION_MZONE+LOCATION_GRAVE)
end
function cm.thfilter2(c)
return c:IsType(TYPE_MONSTER)
......@@ -108,10 +102,10 @@ function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.effilter,1,nil,tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.thfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter2,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectTarget(tp,cm.thfilter2,tp,0,LOCATION_MZONE,1,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -127,8 +121,9 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.tkcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsSetCard(0x820) and Duel.GetFlagEffect(tp,m)==0
return re:GetHandler():IsSetCard(0x820) and re:IsActiveType(TYPE_MONSTER) and rp==tp
end
function cm.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.effilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
......@@ -139,7 +134,6 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,cm.effilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil):GetFirst()
Duel.HintSelection(Group.FromCards(tc))
tc:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
\ No newline at end of file
......@@ -63,9 +63,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ec=re:GetHandler()
if Duel.NegateActivation(ev) and ec:IsRelateToEffect(re) then
ec:CancelToGrave()
if Duel.Remove(ec,POS_FACEUP,REASON_EFFECT)~=0 and ec:IsLocation(LOCATION_REMOVED) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) and Duel.IsExistingMatchingCard(cm.cfilter,tp,0,LOCATION_DECK+LOCATION_REMOVED,1,nil) then
if Duel.Remove(ec,POS_FACEUP,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil):GetFirst()
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil):GetFirst()
if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
......
......@@ -63,7 +63,8 @@ end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.SelectTarget(tp,cm.filter2,tp,LOCATION_GRAVE,0,1,3,nil)
local max=math.min(3,Duel.GetLocationCount(tp,LOCATION_SZONE))
local g=Duel.SelectTarget(tp,cm.filter2,tp,LOCATION_GRAVE,0,1,max,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -38,7 +38,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.rmfilter(c)
return c:IsPublic() and not c:IsLocation(LOCATION_GRAVE) and c:IsAbleToGrave()
return c:IsPublic() and not c:IsLocation(LOCATION_GRAVE) and c:IsAbleToGrave() and c:IsFaceup()
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -96,7 +96,7 @@ function cm.rlop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.rlfilter2(c)
return c:IsPublic() and c:IsAbleToGrave() and not c:IsLocation(LOCATION_GRAVE)
return c:IsPublic() and c:IsAbleToGrave() and not c:IsLocation(LOCATION_GRAVE) and c:IsFaceup()
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.rlfilter2,tp,0xff,0xff,nil)
......
......@@ -36,6 +36,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
......@@ -57,16 +58,16 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_LEAVE-RESET_TOFIELD+RESET_PHASE+PHASE_END,0,1)
end
function cm.filter(c,tp)
function cm.tfilter(c,tp)
local r=LOCATION_REASON_TOFIELD
if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end
return c:IsFaceup() and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,cm.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
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