Commit ebc9244f authored by Nemo Ma's avatar Nemo Ma

fix

parent 9bbf5eca
......@@ -38,7 +38,7 @@ function cm.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function cm.filter(c,act)
return c:IsSetCard(0x97d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode()) and not (act and c:IsCode(m))
return c:IsSetCard(0x97d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode()) and not (act and c:IsCode(m)) and not c:IsForbidden() and c:IsHasEffect(EFFECT_REMAIN_FIELD)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
......
......@@ -37,7 +37,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.filter(c)
return c:GetOriginalType()&0x100004==0x100004 and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and not c:IsCode(m) and c:CheckActivateEffect(false,true,false)~=nil
return c:GetType()&0x100004==0x100004 and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and not c:IsCode(m) and c:CheckActivateEffect(false,true,false)~=nil
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
......
......@@ -57,11 +57,9 @@ function cm.initial_effect(c)
end
end
function cm.etg(e,c)
e:SetLabelObject(c)
return c:GetOriginalCode()==m and c:IsFaceup()
end
function cm.efilter(e,te)
local c=e:GetLabelObject()
function cm.efilter(e,te,c)
return not te:IsActiveType(c:GetType()&0x7)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......@@ -72,23 +70,25 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.filter(c)
return c:IsSetCard(0x97d) and not c:IsForbidden()
return c:IsSetCard(0x97d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsForbidden() and c:IsHasEffect(EFFECT_REMAIN_FIELD)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ft=0
if not e:GetHandler():IsLocation(LOCATION_SZONE) then ft=1 end
if not c:IsLocation(LOCATION_SZONE) then ft=1 end
local rg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
if chk==0 then return #rg>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) and (Duel.GetLocationCount(tp,LOCATION_SZONE)>ft or e:IsHasType(EFFECT_TYPE_QUICK_O)) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,rg,1,PLAYER_ALL,LOCATION_ONFIELD)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) and (Duel.GetLocationCount(tp,LOCATION_SZONE)>ft or e:IsHasType(EFFECT_TYPE_QUICK_O)) end
if #rg>0 then Duel.SetOperationInfo(0,CATEGORY_TOHAND,rg,1,PLAYER_ALL,LOCATION_ONFIELD) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local rg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
if ft>0 then
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=g:Select(tp,1,math.min(#g,ft,#rg),nil)
local sg=g:Select(tp,1,math.min(#g,ft),nil)
local dr=0
for tc in aux.Next(sg) do
if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then dr=dr+1 end
......@@ -97,13 +97,12 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
if #rg>=dr then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local dg=rg:Select(tp,1,dr,nil)
local dg=rg:Select(tp,dr,dr,nil)
Duel.SendtoHand(dg,nil,REASON_EFFECT)
end
end
end
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
......
......@@ -3,7 +3,7 @@ local cm=_G["c"..m]
cm.name="纯粹容器 空洞骑士"
function cm.initial_effect(c)
aux.AddCodeList(c,15000351)
aux.AddSynchroProcedure(c,aux.Tuner(nil),aux.FilterBoolFunction(Card.IsCode,15000351),1,1)
aux.AddSynchroProcedure(c,nil,aux.FilterBoolFunction(Card.IsCode,15000351),1,1)
c:EnableReviveLimit()
--code
local e0=Effect.CreateEffect(c)
......
......@@ -64,7 +64,7 @@ function cm.eqlimit(e,c)
return c==e:GetLabelObject()
end
function cm.tgfilter(c)
return c:IsSetCard(0x412) and not c:IsCode(64800180) and c:IsAbleToGrave()
return c:IsSetCard(0x412) and c:IsType(TYPE_MONSTER) and not c:IsCode(64800180) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -64,7 +64,7 @@ function cm.eqlimit(e,c)
return c==e:GetLabelObject()
end
function cm.tgfilter(c)
return c:IsSetCard(0x412) and not c:IsCode(64800181) and c:IsAbleToHand()
return c:IsSetCard(0x412) and c:IsType(TYPE_MONSTER) and not c:IsCode(64800181) and c:IsAbleToHand()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -8,14 +8,14 @@ function cm.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
......@@ -35,18 +35,17 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
end
function cm.spfilter(c,e,tp)
return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_EFFECT)
local ct=Duel.GetOperatedGroup():GetFirst()
if ct:IsSetCard(0x412) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
local tc=Duel.GetOperatedGroup():GetFirst()
if tc and tc:IsSetCard(0x412) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......@@ -85,7 +84,10 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()==0 then return end
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
......@@ -95,6 +97,3 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -42,7 +42,7 @@ function c75030008.initial_effect(c)
c:RegisterEffect(e2)
end
function c75030008.thfilter(c)
return c:IsSetCard(0x753,0x75f) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return c:IsSetCard(0x753,0x751) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c75030008.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75030008.thfilter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():GetFlagEffect(75030008)==0 end
......
......@@ -49,9 +49,9 @@ function c98930003.descon(e,tp,eg,ep,ev,re,r,rp)
end
function c98930003.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.GetFlagEffect(tp,98930000)==0 end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.GetFlagEffect(tp,98930000)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.RegisterFlagEffect(tp,98930000,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
......
......@@ -64,9 +64,20 @@ function c9910645.retop(e,tp,eg,ep,ev,re,r,rp)
local loc=tc:GetPreviousLocation()
if loc==LOCATION_MZONE then
Duel.ReturnToField(tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(c9910645.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
if loc==LOCATION_GRAVE then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
end
e:Reset()
end
function c9910645.aclimit(e,re,tp)
return re:GetHandler():IsOnField() and re:IsHasType(EFFECT_TYPE_SINGLE) and re:GetCode() and re:GetCode()==EVENT_REMOVE
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