Commit 325c3952 authored by POLYMER's avatar POLYMER

fix

parent 1716394b
......@@ -7,11 +7,11 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,3))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_MOVE)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.spcon)
--e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sumtg)
e1:SetOperation(cm.sumop)
c:RegisterEffect(e1)
......@@ -28,6 +28,15 @@ function cm.initial_effect(c)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_MOVE)
ge2:SetCondition(cm.regcon)
ge2:SetOperation(cm.regop)
Duel.RegisterEffect(ge2,0)
end
end
function cm.cfilter(c)
local p,loc,seq=c:GetPreviousControler(),c:GetPreviousLocation(),c:GetPreviousSequence()
......@@ -37,9 +46,12 @@ end
function cm.actfilter(c,p,seq)
return aux.GetColumn(c,p)==seq
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,ev)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.smfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
......@@ -156,7 +168,7 @@ function cm.valcheck(e,c)
e3:SetLabelObject(g)
e3:SetTarget(cm.reptg)
e3:SetValue(function(e,c) return c:GetFlagEffect(m)>0 end)
Duel.RegisterEffect(e3,tp)
Duel.RegisterEffect(e3,c:GetControler())
end
e:Reset()
end
......
......@@ -57,7 +57,7 @@ function cm.initial_effect(c)
end
end
function cm.etg(e,c)
return c:GetOriginalCode()==m and c:IsFaceup()
return c:GetFlagEffect(m-4)>0 --c:GetOriginalCode()==m and c:IsFaceup() and c:IsStatus(STATUS_CHAINING)
end
function cm.efilter(e,te,c)
return not te:IsActiveType(c:GetType()&0x7)
......@@ -79,6 +79,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local rg=Duel.GetMatchingGroup(cm.tfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return #rg>0 and Duel.IsPlayerCanDiscardDeck(tp,#rg) end
e:GetHandler():RegisterFlagEffect(m-4,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,EFFECT_FLAG_OATH,1)
--[[local ft=0
if not c:IsLocation(LOCATION_SZONE) then ft=1 end
local rg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
......@@ -181,6 +182,7 @@ function cm.filter2(c)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
e:GetHandler():RegisterFlagEffect(m-4,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,EFFECT_FLAG_OATH,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
......
......@@ -43,9 +43,11 @@ function cm.confilter(c,e,tp)
return c:IsControlerCanBeChanged() and c:IsFaceup() and not c:IsStatus(STATUS_SUMMONING) and Duel.IsExistingMatchingCard(cm.eqfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.eqop(e,tp)
local g,tc = rsop.SelectSolve(HINTMSG_OPPO,tp,cm.confilter,tp,0,LOCATION_MZONE,1,1,nil,{})
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local tc=Duel.SelectMatchingCard(tp,cm.confilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp):GetFirst()
if not tc then return end
local g2,tc2 = rsop.SelectSolve("eq",tp,cm,eqfilter,tp,LOCATION_DECK,1,1,nil,{})
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc2=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if rsop.Equip(e,tc2,tc) then
Duel.GetControl(tc,tp,0)
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