Commit 0d848b37 authored by nanahira's avatar nanahira

update chkc

parent 8c1cdf22
......@@ -20,7 +20,7 @@ function c21143940.filter(c,e,tp)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c21143940.chkfilter(c,att)
return c:IsFaceup() and c:IsSetCard(0x8) and c:GetAttribute()==att
return c:IsFaceup() and c:IsSetCard(0x8) and (c:GetAttribute()&att)==att
end
function c21143940.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c21143940.chkfilter(chkc,e:GetLabel()) end
......
......@@ -53,6 +53,9 @@ end
function c61665245.spfilter2(c,e,tp,lg)
return c:IsFaceup() and lg:IsContains(c) and Duel.IsExistingMatchingCard(c61665245.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetRace())
end
function c61665245.spfilter_chkc(c,e,tp,lg,rc)
return c:IsFaceup() and lg:IsContains(c) and (c:GetRace()&rc)==rc
end
function c61665245.spfilter3(c,e,tp,rac)
if not c:IsRace(rac) then return false end
local ok=false
......@@ -68,11 +71,12 @@ function c61665245.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
zone[0]=c:GetLinkedZone(0)
zone[1]=c:GetLinkedZone(1)
local lg=c:GetLinkedGroup()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c61665245.spfilter2(chkc,e,tp,lg) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c61665245.spfilter_chkc(chkc,e,tp,lg,e:GetLabel()) end
if chk==0 then return Duel.IsExistingTarget(c61665245.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c61665245.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lg)
local g=Duel.SelectTarget(tp,c61665245.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:SetLabel(g:GetFirst():GetRace())
end
function c61665245.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -29,7 +29,7 @@ end
function c93600443.chkfilter(c,tc)
local lv=tc:GetLevel()
local att=tc:GetAttribute()
return c:IsFaceup() and c:IsLevelBelow(lv) and c:GetAttribute()==att
return c:IsFaceup() and c:IsLevelBelow(lv) and (c:GetAttribute()&att)==att
end
function c93600443.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c93600443.chkfilter(chkc,e:GetLabelObject()) 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