Commit 74053fef authored by mercury233's avatar mercury233

fix

parent 7bffb487
...@@ -28,16 +28,24 @@ function c101004020.costfilter(c,tp) ...@@ -28,16 +28,24 @@ function c101004020.costfilter(c,tp)
and Duel.IsExistingMatchingCard(c101004020.thfilter,tp,LOCATION_DECK,0,1,c) and Duel.IsExistingMatchingCard(c101004020.thfilter,tp,LOCATION_DECK,0,1,c)
end end
function c101004020.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c101004020.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fc=Duel.IsPlayerAffectedByEffect(tp,101004060) local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fc then loc=LOCATION_HAND+LOCATION_DECK end if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004020.costfilter,tp,loc,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c101004020.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004020.costfilter,tp,loc,0,1,1,nil,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,c101004020.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
Duel.Hint(HINT_CARD,0,101004060) local fc=nil
local field=Duel.GetFirstMatchingCard(Card.IsHasEffect,tp,LOCATION_ONFIELD,0,nil,101004060) if fg:GetCount()==1 then
if field then field:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0) end fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -27,16 +27,24 @@ function c101004022.costfilter(c,tp) ...@@ -27,16 +27,24 @@ function c101004022.costfilter(c,tp)
and Duel.IsExistingMatchingCard(c101004022.filter,tp,LOCATION_DECK,0,1,c) and Duel.IsExistingMatchingCard(c101004022.filter,tp,LOCATION_DECK,0,1,c)
end end
function c101004022.sgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c101004022.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fc=Duel.IsPlayerAffectedByEffect(tp,101004060) local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fc then loc=LOCATION_HAND+LOCATION_DECK end if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004022.costfilter,tp,loc,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c101004022.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004022.costfilter,tp,loc,0,1,1,nil,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,c101004022.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
Duel.Hint(HINT_CARD,0,101004060) local fc=nil
local field=Duel.GetFirstMatchingCard(Card.IsHasEffect,tp,LOCATION_ONFIELD,0,nil,101004060) if fg:GetCount()==1 then
if field then field:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0) end fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -33,16 +33,24 @@ function c101004023.costfilter(c) ...@@ -33,16 +33,24 @@ function c101004023.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function c101004023.negcost(e,tp,eg,ep,ev,re,r,rp,chk) function c101004023.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fc=Duel.IsPlayerAffectedByEffect(tp,101004060) local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fc then loc=LOCATION_HAND+LOCATION_DECK end if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004023.costfilter,tp,loc,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c101004023.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004023.costfilter,tp,loc,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,c101004023.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
Duel.Hint(HINT_CARD,0,101004060) local fc=nil
local field=Duel.GetFirstMatchingCard(Card.IsHasEffect,tp,LOCATION_ONFIELD,0,nil,101004060) if fg:GetCount()==1 then
if field then field:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0) end fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -30,16 +30,24 @@ function c101004025.regfilter(c,attr) ...@@ -30,16 +30,24 @@ function c101004025.regfilter(c,attr)
return c:IsSetCard(0x400d) and bit.band(c:GetOriginalAttribute(),attr)~=0 return c:IsSetCard(0x400d) and bit.band(c:GetOriginalAttribute(),attr)~=0
end end
function c101004025.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c101004025.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fc=Duel.IsPlayerAffectedByEffect(tp,101004060) local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fc then loc=LOCATION_HAND+LOCATION_DECK end if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004025.costfilter,tp,loc,0,2,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(c101004025.costfilter,tp,loc,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101004025.costfilter,tp,loc,0,2,2,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c101004025.costfilter,tp,loc,0,2,2,e:GetHandler())
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.Hint(HINT_CARD,0,101004060) local fc=nil
local field=Duel.GetFirstMatchingCard(Card.IsHasEffect,tp,LOCATION_ONFIELD,0,nil,101004060) if fg:GetCount()==1 then
if field then field:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0) end fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end end
local flag=0 local flag=0
if g:IsExists(c101004025.regfilter,1,nil,ATTRIBUTE_EARTH+ATTRIBUTE_WIND) then flag=bit.bor(flag,0x1) end if g:IsExists(c101004025.regfilter,1,nil,ATTRIBUTE_EARTH+ATTRIBUTE_WIND) then flag=bit.bor(flag,0x1) end
......
...@@ -32,7 +32,7 @@ function c101004042.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,7 +32,7 @@ function c101004042.spcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(0x103) and tc~=e:GetHandler() return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(0x103) and tc~=e:GetHandler()
end end
function c101004042.spfilter(c,e,tp) function c101004042.spfilter(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end end
function c101004042.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c101004042.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
...@@ -51,14 +51,13 @@ function c101004042.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,14 +51,13 @@ function c101004042.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c101004042.atkcon) e1:SetCondition(c101004042.atkcon)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function c101004042.atkcon(e,tp,eg,ep,ev,re,r,rp) function c101004042.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() return e:GetOwner():GetAttackAnnouncedCount()==0
end end
function c101004042.thfilter(c) function c101004042.thfilter(c)
return c:IsSetCard(0x103) and c:IsAbleToHand() return c:IsSetCard(0x103) and c:IsAbleToHand()
......
...@@ -27,6 +27,7 @@ function c101004074.initial_effect(c) ...@@ -27,6 +27,7 @@ function c101004074.initial_effect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetHintTiming(0,TIMING_END_PHASE) e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetCost(c101004074.spcost) e4:SetCost(c101004074.spcost)
...@@ -50,8 +51,8 @@ function c101004074.intg(e,c) ...@@ -50,8 +51,8 @@ function c101004074.intg(e,c)
return c:IsFaceup() and c:IsCode(101004060) return c:IsFaceup() and c:IsCode(101004060)
end end
function c101004074.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c101004074.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(100) e:SetLabel(100)
if chk==0 then return true end
end end
function c101004074.filter1(c,e,tp) function c101004074.filter1(c,e,tp)
return Duel.IsExistingMatchingCard(c101004074.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalAttribute()) return Duel.IsExistingMatchingCard(c101004074.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalAttribute())
......
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