Commit e3421242 authored by POLYMER's avatar POLYMER

fix

parent 3ca9035a
......@@ -6,7 +6,7 @@ function cm.initial_effect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(cm.hand)
e3:SetDescription(aux.Stringid(m,3))
e0:SetDescription(aux.Stringid(m,3))
c:RegisterEffect(e0)
--activate
local e1=Effect.CreateEffect(c)
......
......@@ -242,6 +242,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #g>0 then
Duel.BreakEffect()
local sg=g:Clone()
for tc in aux.Next(g) do
if tc:IsCanBeDisabledByEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -252,10 +253,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.AdjustInstantly()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
else
g:RemoveCard(tc)
sg:RemoveCard(tc)
end
end
Duel.Destroy(g,REASON_EFFECT)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function cm.spcfilter(c,e,tp)
......
......@@ -116,14 +116,14 @@ function cm.spfilter(c,e,tp)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
if chk==0 then return not pnfl_desreplace and eg:IsExists(cm.repfilter,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
return true
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
pnfl_adjusting=true
pnfl_desreplace=true
local c=e:GetHandler()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......@@ -136,7 +136,7 @@ function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local op=turne:GetOperation()
op(turne,turne:GetOwnerPlayer(),nil,0,0,0,0,0)
end
pnfl_adjusting=false
pnfl_desreplace=false
end
function cm.confilter(c)
return c:IsFaceup() and c:IsSetCard(0xc976)
......
......@@ -3,8 +3,8 @@ function c33400107.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,33400107+EFFECT_COUNT_CODE_OATH)
e1:SetLabel(2)
e1:SetCost(c33400107.cost)
......@@ -19,18 +19,18 @@ function c33400107.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RemoveCounter(tp,1,0,0x34f,ct,REASON_COST)
end
function c33400107.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c33400107.activate(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e)):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
if Duel.IsExistingMatchingCard(c33400107.filter1,tp,LOCATION_GRAVE,0,3,nil) and Duel.SelectYesNo(tp,aux.Stringid(33400107,0)) then
Duel.BreakEffect()
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -40,6 +40,7 @@ function c65810095.spcon(e,c)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c65810095.spop(e,c)
local tp=e:GetHandlerPlayer()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......
......@@ -191,6 +191,10 @@ function c98941050.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c98941050.fcfilter,tp,LOCATION_MZONE,0,1,ct,nil)
if Duel.Remove(rg,0,REASON_COST+REASON_TEMPORARY)~=0 then
rg:KeepAlive()
for tc in aux.Next(rg) do
tc:RegisterFlagEffect(98941050,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
......@@ -204,17 +208,29 @@ function c98941050.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(rc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,rc,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c98941050.retfilter(c,tp)
return c:GetFlagEffect(98941050)~=0 and (not tp or c:IsControler(tp))
end
function c98941050.returngroup(g,tp)
if #g==0 then return end
local c
while #g>1 and Duel.GetMZoneCount(tp)>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
c=g:Select(tp,1,1,nil):GetFirst()
Duel.ReturnToField(c)
g=g-c
end
for oc in aux.Next(g) do
Duel.ReturnToField(oc)
end
end
function c98941050.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local fid=e:GetLabel()
local g=e:GetLabelObject()
if g then
local tc=g:GetFirst()
while tc do
Duel.ReturnToField(tc)
tc=g:GetNext()
end
end
local turnp=Duel.GetTurnPlayer()
local g1=e:GetLabelObject():Filter(c98941050.retfilter,nil,turnp)
local g2=e:GetLabelObject():Filter(c98941050.retfilter,nil,1-turnp)
if #g1+#g2==0 then return end
c98941050.returngroup(g1,turnp)
c98941050.returngroup(g2,1-turnp)
end
function c98941050.gcheck(g)
return g:FilterCount(Card.IsSetCard,nil,0x2b)<2 and g:FilterCount(Card.IsSetCard,nil,0x61)<2
......
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