Commit 3f408196 authored by nekrozar's avatar nekrozar

Diamond Dude

parent cf007382
...@@ -10,21 +10,25 @@ function c22431243.initial_effect(c) ...@@ -10,21 +10,25 @@ function c22431243.initial_effect(c)
e1:SetOperation(c22431243.activate) e1:SetOperation(c22431243.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c22431243.cfilter(c,ft,tp) function c22431243.cfilter(c,tp)
return c:IsRace(RACE_REPTILE) return c:IsRace(RACE_REPTILE)
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup()) and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end end
function c22431243.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c22431243.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) e:SetLabel(1)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c22431243.cfilter,1,nil,ft,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,c22431243.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c22431243.cfilter,1,1,nil,ft,tp) local g=Duel.SelectReleaseGroup(tp,c22431243.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c22431243.filter(c,e,tp) function c22431243.filter(c,e,tp)
return c:IsRace(RACE_DINOSAUR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_DINOSAUR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c22431243.target(e,tp,eg,ep,ev,re,r,rp,chk) function c22431243.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22431243.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c22431243.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c22431243.activate(e,tp,eg,ep,ev,re,r,rp) function c22431243.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -10,15 +10,23 @@ function c22493811.initial_effect(c) ...@@ -10,15 +10,23 @@ function c22493811.initial_effect(c)
e1:SetOperation(c22493811.activate) e1:SetOperation(c22493811.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c22493811.costfilter(c,tp)
return c:IsRace(RACE_INSECT)
and Duel.GetMZoneCount(tp,c)>1 and (c:IsControler(tp) or c:IsFaceup())
end
function c22493811.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c22493811.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_INSECT) end e:SetLabel(1)
local g=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_INSECT) if chk==0 then return Duel.CheckReleaseGroup(tp,c22493811.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c22493811.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c22493811.target(e,tp,eg,ep,ev,re,r,rp,chk) function c22493811.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then
and Duel.IsPlayerCanSpecialSummonMonster(tp,22493812,0,0x4011,500,1200,4,RACE_INSECT,ATTRIBUTE_EARTH) end e:SetLabel(0)
return res and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonMonster(tp,22493812,0,0x4011,500,1200,4,RACE_INSECT,ATTRIBUTE_EARTH)
end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end end
......
...@@ -10,17 +10,25 @@ function c25090294.initial_effect(c) ...@@ -10,17 +10,25 @@ function c25090294.initial_effect(c)
e1:SetOperation(c25090294.activate) e1:SetOperation(c25090294.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c25090294.costfilter(c,tp)
return c:IsCode(62107981)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c25090294.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c25090294.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,62107981) end e:SetLabel(1)
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,62107981) if chk==0 then return Duel.CheckReleaseGroup(tp,c25090294.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c25090294.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c25090294.filter(c,e,tp) function c25090294.filter(c,e,tp)
return c:IsCode(51085303) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(51085303) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c25090294.target(e,tp,eg,ep,ev,re,r,rp,chk) function c25090294.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c25090294.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c25090294.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c25090294.activate(e,tp,eg,ep,ev,re,r,rp) function c25090294.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -10,20 +10,24 @@ function c2903036.initial_effect(c) ...@@ -10,20 +10,24 @@ function c2903036.initial_effect(c)
e1:SetOperation(c2903036.activate) e1:SetOperation(c2903036.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c2903036.cfilter(c,ft,tp) function c2903036.cfilter(c,tp)
return ft>0 or (c:IsControler(tp) and c:GetSequence()<5) return Duel.GetMZoneCount(tp,c)>0
end end
function c2903036.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c2903036.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) e:SetLabel(1)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c2903036.cfilter,1,nil,ft,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,c2903036.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c2903036.cfilter,1,1,nil,ft,tp) local g=Duel.SelectReleaseGroup(tp,c2903036.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c2903036.filter(c,e,tp) function c2903036.filter(c,e,tp)
return c:IsLevel(7) and c:IsSummonableCard() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevel(7) and c:IsSummonableCard() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c2903036.target(e,tp,eg,ep,ev,re,r,rp,chk) function c2903036.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c2903036.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c2903036.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c2903036.activate(e,tp,eg,ep,ev,re,r,rp) function c2903036.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -9,18 +9,22 @@ function c43040603.initial_effect(c) ...@@ -9,18 +9,22 @@ function c43040603.initial_effect(c)
e1:SetOperation(c43040603.operation) e1:SetOperation(c43040603.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c43040603.cfilter(c,ft,tp) function c43040603.cfilter(c,tp)
return ft>0 or (c:IsControler(tp) and c:GetSequence()<5) return Duel.GetMZoneCount(tp,c)>0
end end
function c43040603.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c43040603.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) e:SetLabel(1)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c43040603.cfilter,1,nil,ft,tp) end if chk==0 then return Duel.CheckReleaseGroup(tp,c43040603.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c43040603.cfilter,1,1,nil,ft,tp) local g=Duel.SelectReleaseGroup(tp,c43040603.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c43040603.target(e,tp,eg,ep,ev,re,r,rp,chk) function c43040603.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummon(tp) and not Duel.IsPlayerAffectedByEffect(tp,63060238) local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsSummonableCard,tp,LOCATION_DECK,0,1,nil) and Duel.IsPlayerCanDiscardDeck(tp,1) end if chk==0 then
e:SetLabel(0)
return res and Duel.IsPlayerCanSpecialSummon(tp) and not Duel.IsPlayerAffectedByEffect(tp,63060238)
and Duel.IsExistingMatchingCard(Card.IsSummonableCard,tp,LOCATION_DECK,0,1,nil) and Duel.IsPlayerCanDiscardDeck(tp,1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end end
function c43040603.operation(e,tp,eg,ep,ev,re,r,rp) function c43040603.operation(e,tp,eg,ep,ev,re,r,rp)
...@@ -31,7 +35,7 @@ function c43040603.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,7 +35,7 @@ function c43040603.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
local spcard=nil local spcard=nil
while tc do while tc do
if tc:GetSequence()>seq then if tc:GetSequence()>seq then
seq=tc:GetSequence() seq=tc:GetSequence()
spcard=tc spcard=tc
end end
......
...@@ -10,20 +10,42 @@ function c45898858.initial_effect(c) ...@@ -10,20 +10,42 @@ function c45898858.initial_effect(c)
e1:SetOperation(c45898858.activate) e1:SetOperation(c45898858.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c45898858.costfilter(c,tp)
return c:IsCode(22587018,58071123) and (c:IsControler(tp) or c:IsFaceup())
end
function c45898858.fcheck(c,mg,sg,code,...)
if not c:IsCode(code) then return false end
if ... then
sg:AddCard(c)
local res=mg:IsExists(c45898858.fcheck,1,sg,mg,sg,...)
sg:RemoveCard(c)
return res
else return true end
end
function c45898858.fselect(g,tp,sg)
if g:IsExists(c45898858.fcheck,1,nil,g,sg,22587018,22587018,58071123) and Duel.GetMZoneCount(tp,g)>0 then
Duel.SetSelectedCard(g)
return Duel.CheckReleaseGroup(tp,nil,0,nil)
else return false end
end
function c45898858.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c45898858.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,2,nil,22587018) e:SetLabel(1)
and Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,58071123) end local sg=Group.CreateGroup()
local g1=Duel.SelectReleaseGroup(tp,Card.IsCode,2,2,nil,22587018) local g=Duel.GetReleaseGroup(tp):Filter(c45898858.costfilter,nil,tp)
local g2=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,58071123) if chk==0 then return g:CheckSubGroup(c45898858.fselect,3,3,tp,sg) end
g1:Merge(g2) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Duel.Release(g1,REASON_COST) local rg=g:SelectSubGroup(tp,c45898858.fselect,false,3,3,tp,sg)
Duel.Release(rg,REASON_COST)
end end
function c45898858.filter(c,e,tp) function c45898858.filter(c,e,tp)
return c:IsCode(85066822) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(85066822) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c45898858.target(e,tp,eg,ep,ev,re,r,rp,chk) function c45898858.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3 local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c45898858.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c45898858.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end end
function c45898858.activate(e,tp,eg,ep,ev,re,r,rp) function c45898858.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -10,17 +10,25 @@ function c75417459.initial_effect(c) ...@@ -10,17 +10,25 @@ function c75417459.initial_effect(c)
e1:SetOperation(c75417459.activate) e1:SetOperation(c75417459.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c75417459.costfilter(c,tp)
return c:IsCode(423705)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c75417459.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c75417459.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,423705) end e:SetLabel(1)
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,423705) if chk==0 then return Duel.CheckReleaseGroup(tp,c75417459.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c75417459.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c75417459.filter(c,e,tp) function c75417459.filter(c,e,tp)
return c:IsCode(57046845) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(57046845) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function c75417459.target(e,tp,eg,ep,ev,re,r,rp,chk) function c75417459.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c75417459.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c75417459.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end end
function c75417459.activate(e,tp,eg,ep,ev,re,r,rp) function c75417459.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -22,20 +22,42 @@ function c79402185.initial_effect(c) ...@@ -22,20 +22,42 @@ function c79402185.initial_effect(c)
e2:SetOperation(c79402185.thop) e2:SetOperation(c79402185.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c79402185.costfilter(c,tp)
return c:IsCode(43017476,58071123) and (c:IsControler(tp) or c:IsFaceup())
end
function c79402185.fcheck(c,mg,sg,code,...)
if not c:IsCode(code) then return false end
if ... then
sg:AddCard(c)
local res=mg:IsExists(c79402185.fcheck,1,sg,mg,sg,...)
sg:RemoveCard(c)
return res
else return true end
end
function c79402185.fselect(g,tp,sg)
if g:IsExists(c79402185.fcheck,1,nil,g,sg,43017476,43017476,58071123) and Duel.GetMZoneCount(tp,g)>0 then
Duel.SetSelectedCard(g)
return Duel.CheckReleaseGroupEx(tp,nil,0,nil)
else return false end
end
function c79402185.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c79402185.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,Card.IsCode,2,nil,43017476) e:SetLabel(1)
and Duel.CheckReleaseGroupEx(tp,Card.IsCode,1,nil,58071123) end local sg=Group.CreateGroup()
local g1=Duel.SelectReleaseGroupEx(tp,Card.IsCode,2,2,nil,43017476) local g=Duel.GetReleaseGroup(tp,true):Filter(c79402185.costfilter,nil,tp)
local g2=Duel.SelectReleaseGroupEx(tp,Card.IsCode,1,1,nil,58071123) if chk==0 then return g:CheckSubGroup(c79402185.fselect,3,3,tp,sg) end
g1:Merge(g2) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Duel.Release(g1,REASON_COST) local rg=g:SelectSubGroup(tp,c79402185.fselect,false,3,3,tp,sg)
Duel.Release(rg,REASON_COST)
end end
function c79402185.filter(c,e,tp) function c79402185.filter(c,e,tp)
return (c:IsCode(85066822) or c:IsCode(6022371)) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(85066822,6022371) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c79402185.target(e,tp,eg,ep,ev,re,r,rp,chk) function c79402185.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3 local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c79402185.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c79402185.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end end
function c79402185.activate(e,tp,eg,ep,ev,re,r,rp) function c79402185.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -11,20 +11,24 @@ function c87210505.initial_effect(c) ...@@ -11,20 +11,24 @@ function c87210505.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c87210505.card_code_list={46986414} c87210505.card_code_list={46986414}
function c87210505.costfilter(c) function c87210505.costfilter(c,tp)
return c:IsFaceup() and c:IsCode(46986414) return c:IsFaceup() and c:IsCode(46986414) and Duel.GetMZoneCount(tp,c)>0
end end
function c87210505.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c87210505.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c87210505.costfilter,1,nil) end e:SetLabel(1)
local g=Duel.SelectReleaseGroup(tp,c87210505.costfilter,1,1,nil) if chk==0 then return Duel.CheckReleaseGroup(tp,c87210505.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c87210505.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c87210505.spfilter(c,e,tp) function c87210505.spfilter(c,e,tp)
return c:IsCode(50725996) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsCode(50725996) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c87210505.target(e,tp,eg,ep,ev,re,r,rp,chk) function c87210505.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c87210505.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c87210505.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end end
function c87210505.activate(e,tp,eg,ep,ev,re,r,rp) function c87210505.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -11,10 +11,15 @@ function c89397517.initial_effect(c) ...@@ -11,10 +11,15 @@ function c89397517.initial_effect(c)
e1:SetOperation(c89397517.activate) e1:SetOperation(c89397517.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c89397517.costfilter(c,tp)
return c:IsRace(RACE_WARRIOR)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c89397517.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c89397517.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) and Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_WARRIOR) end e:SetLabel(1)
if chk==0 then return Duel.CheckLPCost(tp,2000) and Duel.CheckReleaseGroup(tp,c89397517.costfilter,1,nil,tp) end
Duel.PayLPCost(tp,2000) Duel.PayLPCost(tp,2000)
local sg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_WARRIOR) local sg=Duel.SelectReleaseGroup(tp,c89397517.costfilter,1,1,nil,tp)
Duel.Release(sg,REASON_COST) Duel.Release(sg,REASON_COST)
end end
function c89397517.rmfilter(c) function c89397517.rmfilter(c)
...@@ -24,9 +29,12 @@ function c89397517.spfilter(c,e,tp) ...@@ -24,9 +29,12 @@ function c89397517.spfilter(c,e,tp)
return c:IsSetCard(0xa0) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) return c:IsSetCard(0xa0) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end end
function c89397517.target(e,tp,eg,ep,ev,re,r,rp,chk) function c89397517.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local res=e:GetLabel()==1 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c89397517.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) if chk==0 then
and Duel.IsExistingMatchingCard(c89397517.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp) end e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c89397517.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(c89397517.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK)
end 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