Commit ac1cdd3a authored by VanillaSalt's avatar VanillaSalt

fix

parent c0ba3783
......@@ -27,7 +27,8 @@ function c10560119.sdcon(e)
return Duel.IsExistingMatchingCard(c10560119.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c10560119.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c10560119.cfilter,tp,LOCATION_MZONE,0,1,nil)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return g:GetCount()>0 and not g:IsExists(c10560119.cfilter,1,nil)
end
function c10560119.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10560119)==0 end
......
......@@ -27,14 +27,17 @@ end
function c18605135.filter(c)
return c:IsFaceup() and c:IsCode(22702055)
end
function c18605135.actcon(e,tp,eg,ep,ev,re,r,rp)
function c18605135.check()
return Duel.IsExistingMatchingCard(c18605135.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
or Duel.GetEnvironment()==22702055
end
function c18605135.actcon(e,tp,eg,ep,ev,re,r,rp)
return c18605135.check()
end
function c18605135.abdcon(e)
return Duel.GetAttackTarget()==nil or Duel.GetAttackTarget():IsAttackPos() or Duel.GetAttacker():GetAttack()>Duel.GetAttackTarget():GetDefence()
local at=Duel.GetAttackTarget()
return c18605135.check() and (at==nil or at:IsAttackPos() or Duel.GetAttacker():GetAttack()>at:GetDefence())
end
function c18605135.sdcon(e)
return not Duel.IsExistingMatchingCard(c18605135.filter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.GetEnvironment()~=22702055
return not c18605135.check()
end
......@@ -21,7 +21,7 @@ function c22796548.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,500)
end
function c22796548.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,0)
local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac)
......
......@@ -9,6 +9,7 @@ function c23649496.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c23649496.cost)
e1:SetTarget(c23649496.target)
......
......@@ -11,34 +11,69 @@ function c25573054.initial_effect(c)
e1:SetOperation(c25573054.activate)
c:RegisterEffect(e1)
end
function c25573054.cfilter1(c)
function c25573054.tgfilter(c)
return c:IsCode(57116033) and c:IsAbleToGraveAsCost()
end
function c25573054.cfilter2(c)
return not c:IsCode(98585345) and c:IsAbleToGraveAsCost()
function c25573054.spfilter(c,e,tp)
return c:IsCode(98585345) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c25573054.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25573054.cfilter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c25573054.cfilter2,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c25573054.cfilter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c25573054.cfilter2,tp,LOCATION_HAND,0,2,2,nil)
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST)
end
function c25573054.filter(c,e,tp)
return c:IsCode(98585345) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
local sg=Duel.GetMatchingGroup(c25573054.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
local hg=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,e:GetHandler())
if chk==0 then
if sg:GetCount()==0 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
if ft==0 then
if not Duel.IsExistingMatchingCard(c25573054.tgfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
else
if not Duel.IsExistingMatchingCard(c25573054.tgfilter,tp,LOCATION_ONFIELD,0,1,nil) then return false end
end
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
return hg:GetCount()>1
else
return hg:GetCount()>2
end
end
local cg=nil
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
cg=Duel.SelectMatchingCard(tp,c25573054.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
cg=Duel.SelectMatchingCard(tp,c25573054.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
end
local ct=sg:GetCount()
if ct>2 or sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=hg:Select(tp,2,2,nil)
cg:Merge(g)
elseif ct==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=hg:Select(tp,2,2,sg:GetFirst())
cg:Merge(g)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=hg:Select(tp,1,1,nil)
if sg:IsContains(g1:GetFirst()) then
hg:Sub(sg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=hg:Select(tp,1,1,g1:GetFirst())
cg:Merge(g1)
cg:Merge(g2)
end
Duel.SendtoGrave(cg,REASON_COST)
end
function c25573054.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c25573054.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_HAND)
end
function c25573054.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c25573054.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c25573054.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
......
......@@ -39,7 +39,7 @@ end
function c32559361.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if chk==0 then return c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() end
if chk==0 then return tc and c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() end
end
function c32559361.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -52,7 +52,7 @@ function c54149433.spfilter(c,e,tp)
end
function c54149433.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c54149433.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c54149433.spop2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -12,7 +12,7 @@ function c72403299.initial_effect(c)
c:RegisterEffect(e1)
end
function c72403299.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,0)
local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac)
......
......@@ -69,7 +69,7 @@ function c94933468.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c94933468.deckcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and e:GetHandler():GetCardTarget()~=nil
return tp~=Duel.GetTurnPlayer() and e:GetHandler():GetFirstCardTarget()~=nil
end
function c94933468.decktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -50,7 +50,7 @@ function c96594609.tgfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGrave()
end
function c96594609.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(tgfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c96594609.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c96594609.tgop(e,tp,eg,ep,ev,re,r,rp)
......
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