Commit d7a73426 authored by mercury233's avatar mercury233

fix

parent 8a814502
......@@ -63,11 +63,8 @@ end
function c100257051.rselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c100257051.fselect(g,tp)
if Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,g) then
Duel.SetSelectedCard(g)
return Duel.CheckReleaseGroup(tp,nil,0,nil)
else return false end
function c100257051.costfilter(c,tp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c100257051.spfilter(c,e,tp)
return c:IsSetCard(0x101b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -76,12 +73,11 @@ function c100257051.thfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c100257051.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp):Filter(Card.IsType,nil,TYPE_MONSTER)
local ct=g:GetCount()
local b1=ct>0 and g:CheckSubGroup(c100257051.fselect,1,1,tp)
local b2=ct>1 and g:CheckSubGroup(c100257051.rselect,2,2,tp)
local g=Duel.GetReleaseGroup(tp)
local b1=Duel.CheckReleaseGroup(tp,c100257051.costfilter,1,nil,tp)
local b2=g:GetCount()>1 and g:CheckSubGroup(c100257051.rselect,2,2,tp)
and Duel.IsExistingMatchingCard(c100257051.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b3=ct>2 and Duel.IsExistingMatchingCard(c100257051.thfilter,tp,LOCATION_GRAVE,0,1,nil)
local b3=Duel.CheckReleaseGroup(tp,nil,3,nil) and Duel.IsExistingMatchingCard(c100257051.thfilter,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 or b3 end
local off=0
local ops={}
......@@ -106,14 +102,12 @@ function c100257051.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(opval[op])
local rg=nil
if opval[op]==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
rg=g:SelectSubGroup(tp,c100257051.fselect,false,1,1,tp)
rg=Duel.SelectReleaseGroup(tp,c100257051.costfilter,1,1,nil,tp)
elseif opval[op]==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
rg=g:SelectSubGroup(tp,c100257051.rselect,false,2,2,tp)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
rg=g:Select(tp,3,3,nil)
rg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
end
Duel.Release(rg,REASON_COST)
end
......
......@@ -54,7 +54,7 @@ function c100257091.atkcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100257091.spfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c100257091.atkfilter(c)
return c:IsFaceup() and c:GetAttack()>0
return c:IsFaceup() and not (c:IsAttack(0) and c:IsDisabled())
end
function c100257091.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -66,7 +66,7 @@ end
function c100257091.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -59,19 +59,13 @@ function c101012046.atkop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
end
function c101012046.cfilter(c,tp)
local att=0
for i,attr in ipairs({ATTRIBUTE_EARTH,ATTRIBUTE_WATER,ATTRIBUTE_FIRE,ATTRIBUTE_WIND,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK,ATTRIBUTE_DIVINE}) do
if Duel.GetFlagEffect(tp,101012046+(i-1)*100)==0 then
att=bit.bor(att,attr)
end
end
return c:IsType(TYPE_LINK) and c:IsAttribute(att) and c:IsAbleToRemoveAsCost() and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
function c101012046.cfilter(c)
return c:IsType(TYPE_LINK) and c:IsAbleToRemoveAsCost() and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c101012046.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101012046.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c101012046.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101012046.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,c101012046.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
e:SetLabel(g:GetFirst():GetAttribute())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
......@@ -88,10 +82,16 @@ function c101012046.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
local att=e:GetLabel()
for i,attr in ipairs({ATTRIBUTE_EARTH,ATTRIBUTE_WATER,ATTRIBUTE_FIRE,ATTRIBUTE_WIND,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK,ATTRIBUTE_DIVINE}) do
if bit.band(att,attr)~=0 then
Duel.RegisterFlagEffect(tp,101012046+(i-1)*100,RESET_PHASE+PHASE_END,0,1)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetTargetRange(1,0)
e1:SetTarget(c101012046.rmlimit)
e1:SetLabel(e:GetLabel())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101012046.rmlimit(e,c,tp,r,re)
return c:IsAttribute(e:GetLabel()) and re and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsCode(101012046) and r==REASON_COST
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