Commit b7928ee0 authored by POLYMER's avatar POLYMER

update 230915

parent 99248f29
No preview for this file type
expansions/pics/11561006.jpg

19.6 KB | W: | H:

expansions/pics/11561006.jpg

179 KB | W: | H:

expansions/pics/11561006.jpg
expansions/pics/11561006.jpg
expansions/pics/11561006.jpg
expansions/pics/11561006.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11561011.jpg

254 KB | W: | H:

expansions/pics/11561011.jpg

248 KB | W: | H:

expansions/pics/11561011.jpg
expansions/pics/11561011.jpg
expansions/pics/11561011.jpg
expansions/pics/11561011.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11561013.jpg

20 KB | W: | H:

expansions/pics/11561013.jpg

433 KB | W: | H:

expansions/pics/11561013.jpg
expansions/pics/11561013.jpg
expansions/pics/11561013.jpg
expansions/pics/11561013.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11561014.jpg

18.6 KB | W: | H:

expansions/pics/11561014.jpg

1 MB | W: | H:

expansions/pics/11561014.jpg
expansions/pics/11561014.jpg
expansions/pics/11561014.jpg
expansions/pics/11561014.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11561015.jpg

15.5 KB | W: | H:

expansions/pics/11561015.jpg

173 KB | W: | H:

expansions/pics/11561015.jpg
expansions/pics/11561015.jpg
expansions/pics/11561015.jpg
expansions/pics/11561015.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11561022.jpg

20.6 KB | W: | H:

expansions/pics/11561022.jpg

267 KB | W: | H:

expansions/pics/11561022.jpg
expansions/pics/11561022.jpg
expansions/pics/11561022.jpg
expansions/pics/11561022.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/67220004.jpg

43.5 KB | W: | H:

expansions/pics/67220004.jpg

45.7 KB | W: | H:

expansions/pics/67220004.jpg
expansions/pics/67220004.jpg
expansions/pics/67220004.jpg
expansions/pics/67220004.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/9910624.jpg

13.5 KB | W: | H:

expansions/pics/9910624.jpg

55.6 KB | W: | H:

expansions/pics/9910624.jpg
expansions/pics/9910624.jpg
expansions/pics/9910624.jpg
expansions/pics/9910624.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -28,8 +28,8 @@ function c11560712.initial_effect(c)
end
c11560712.SetCard_SR_Saier=true
function c11560712.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c11560712.disop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -74,34 +74,58 @@ end
function c11561006.xdestg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local x=c:GetLinkedGroupCount()
if chk==0 then return c:GetFlagEffect(11561006)<x end
local b1=c:GetFlagEffect(21561006)==0
local b2=c:GetFlagEffect(31561006)==0 and Duel.IsExistingMatchingCard(function(c,atk) return c:GetAttack()<atk and c:IsFaceup() end,tp,0,LOCATION_MZONE,1,nil,c:GetAttack())
local b3=c:GetFlagEffect(41561006)==0
if chk==0 then return c:GetFlagEffect(11561006)<x and (b1 or b2 or b3) end
c:RegisterFlagEffect(11561006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c11561006.xdesop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e4)
if Duel.IsExistingMatchingCard(function(c,atk) return c:GetAttack()<atk and c:IsFaceup() end,tp,0,LOCATION_MZONE,1,nil,c:GetAttack()) and Duel.SelectYesNo(tp,aux.Stringid(11561006,0)) then
local dg=Duel.SelectMatchingCard(tp,function(c,atk) return c:GetAttack()<atk and c:IsFaceup() end,tp,0,LOCATION_MZONE,1,1,nil,c:GetAttack())
Duel.Destroy(dg,REASON_EFFECT)
end
end
local c=e:GetHandler()
local b1=c:GetFlagEffect(21561006)==0
local b2=c:GetFlagEffect(31561006)==0 and Duel.IsExistingMatchingCard(function(c,atk) return c:GetAttack()<atk and c:IsFaceup() end,tp,0,LOCATION_MZONE,1,nil,c:GetAttack())
local b3=c:GetFlagEffect(41561006)==0
if (b1 or b2 or b3) then
local op=0
if b1 and b2 and b3 then
op=Duel.SelectOption(tp,aux.Stringid(11561006,1),aux.Stringid(11561006,2),aux.Stringid(11561006,3))
elseif b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(11561006,1),aux.Stringid(11561006,2))
elseif b2 and b3 then
op=Duel.SelectOption(tp,aux.Stringid(11561006,2),aux.Stringid(11561006,3))+1
elseif b1 and b3 then
op=Duel.SelectOption(tp,aux.Stringid(11561006,1),aux.Stringid(11561006,3))
if op==1 then op=op+1 end
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(11561006,1))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(11561006,2))+1
elseif b3 then
op=Duel.SelectOption(tp,aux.Stringid(11561006,3))+2
end
if op==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
c:RegisterFlagEffect(21561006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
elseif op==1 then
local dg=Duel.SelectMatchingCard(tp,function(c,atk) return c:GetAttack()<atk and c:IsFaceup() end,tp,0,LOCATION_MZONE,1,1,nil,c:GetAttack())
Duel.Destroy(dg,REASON_EFFECT)
c:RegisterFlagEffect(31561006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
elseif op==2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(function(e,te)
return e:GetOwner()~=te:GetOwner() end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e1)
c:RegisterFlagEffect(41561006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
end
......@@ -17,7 +17,8 @@ function c11561008.initial_effect(c)
e2:SetCategory(CATEGORY_ANNOUNCE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,21561008)
e2:SetCountLimit(1,21561008)
e2:SetCost(c11561008.cancost)
e2:SetTarget(c11561008.cgtg)
e2:SetOperation(c11561008.cgop)
c:RegisterEffect(e2)
......@@ -42,61 +43,89 @@ function c11561008.pbfil(c)
return c:IsRace(RACE_SPELLCASTER) and not c:IsPublic()
end
function c11561008.pbgck(g)
return g:GetClassCount(Card.GetLevel)==1 and g:GetClassCount(Card.GetAttribute)==g:GetCount()
return true
end
function c11561008.cantg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c11561008.pbfil,tp,LOCATION_HAND,0,nil)
if chk==0 then return g:CheckSubGroup(c11561008.pbgck,2,7) end
if chk==0 then return g:CheckSubGroup(c11561008.pbgck,3,3) end
end
function c11561008.spfil(c,e,tp,sg)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRace(RACE_SPELLCASTER) and sg:IsExists(Card.IsAttribute,1,nil,c:GetAttribute())
--local tc=sg:GetFirst()
--while tc do
--if not c:IsAttribute(tc:GetAttribute()) then return false end
--tc=sg:GetNext()
--end
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRace(RACE_SPELLCASTER) and sg:IsExists(Card.IsAttribute,1,nil,c:GetAttribute())
end
function c11561008.thfil(c,e,tp,sg)
return c:IsAbleToHand() and c:IsRace(RACE_SPELLCASTER) and sg:IsExists(Card.IsLevel,1,nil,c:GetLevel())
local tc=sg:GetFirst()
while tc do
if not c:IsLevel(tc:GetLevel()) then return false end
tc=sg:GetNext()
end
return c:IsAbleToHand() and c:IsRace(RACE_SPELLCASTER)
end
function c11561008.canop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11561008.pbfil,tp,LOCATION_HAND,0,nil)
local pg=g:SelectSubGroup(tp,c11561008.pbgck,false,2,7)
if not g:CheckSubGroup(c11561008.pbgck,2,7) then return end
local pg=g:SelectSubGroup(tp,c11561008.pbgck,false,3,3)
if not g:CheckSubGroup(c11561008.pbgck,3,3) then return end
Duel.ConfirmCards(1-tp,pg)
Duel.ShuffleHand(tp)
local x=pg:GetCount()
local b1=pg and pg:GetClassCount(Card.GetAttribute)==pg:GetCount()
local b2=pg and pg:GetClassCount(Card.GetLevel)==1
if pg and x>0 then
if x>=2 and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
if x>=3 and Duel.IsExistingMatchingCard(c11561008.spfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,pg) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if b1 and Duel.IsExistingMatchingCard(c11561008.spfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,pg) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local sg=Duel.SelectMatchingCard(tp,c11561008.spfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,pg)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
if x>=4 and Duel.IsExistingMatchingCard(c11561008.thfil,tp,LOCATION_DECK,0,1,nil,e,tp,pg) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local sg=Duel.SelectMatchingCard(tp,c11561008.thfil,tp,LOCATION_DECK,0,1,1,nil,e,tp,pg)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
if b2 and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
if b1 and b2 and Duel.IsExistingMatchingCard(c11561008.thfil,tp,LOCATION_DECK,0,1,nil,e,tp,pg) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
local tc=Duel.SelectMatchingCard(tp,c11561008.thfil,tp,LOCATION_DECK,0,1,1,nil,e,tp,pg):GetFirst()
local type=0
local op=Duel.SelectOption(tp,aux.Stringid(11561008,3),aux.Stringid(11561008,4))
if op==0 then type=TYPE_SPELL end
if op==1 then type=TYPE_TRAP end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(type+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
tc:RegisterEffect(e1)
end
end
end
function c11561008.cgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand()
end
function c11561008.cgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL))
end
function c11561008.cgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11561008.pbfil,tp,LOCATION_HAND,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,c11561008.pbfil,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
e:SetLabelObject(tc)
Duel.ShuffleHand(tp)
e:SetLabel(Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL),Duel.AnnounceLevel(tp))
end
function c11561008.cgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK+LOCATION_GRAVE,0)
e1:SetTarget(function(e,c)
return c:IsCode(11561008) end)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local tc=e:GetLabelObject()
local att,lv=e:GetLabel()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(att)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,tp)
end
end
......
......@@ -27,8 +27,8 @@ function c11561009.initial_effect(c)
c:RegisterEffect(e2)
end
function c11561009.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function c11561009.filter0(c)
return c:IsOnField() and c:IsAbleToRemove()
......@@ -45,7 +45,7 @@ function c11561009.filter3(c)
end
function c11561009.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0 then
if Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.DiscardDeck(tp,3,REASON_EFFECT)~=0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c11561009.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c11561009.filter3,tp,LOCATION_GRAVE,0,nil)
......@@ -85,19 +85,19 @@ function c11561009.thfil(c)
return c:IsAbleToHand() and c:IsLevel(4) and c:IsRace(RACE_SPELLCASTER)
end
function c11561009.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.IsExistingMatchingCard(c11561009.thfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.IsExistingMatchingCard(c11561009.thfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11561009.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(c11561009.thfil,tp,LOCATION_DECK,0,1,nil) then
if Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.DiscardDeck(tp,3,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(c11561009.thfil,tp,LOCATION_DECK,0,1,nil) then
local g=Duel.SelectMatchingCard(tp,c11561009.thfil,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ConfirmCards(1-tp,g)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=20 then
Duel.Damage(1-tp,3200,REASON_EFFECT)
Duel.Recover(tp,3200,REASON_EFFECT)
Duel.Damage(1-tp,2400,REASON_EFFECT)
Duel.Recover(tp,2400,REASON_EFFECT)
end
end
end
......
......@@ -40,7 +40,7 @@ function c11561010.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetOperation(c11561010.xdesop)
c:RegisterEffect(e3)
end
......@@ -61,7 +61,7 @@ function c11561010.desop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c11561010.desfil,tp,0,LOCATION_MZONE,1,nil,e:GetHandler():GetAttack()) then
Duel.Hint(HINT_CARD,0,11561010)
local dg=Duel.SelectMatchingCard(tp,c11561010.desfil,tp,0,LOCATION_MZONE,1,1,nil,e:GetHandler():GetAttack())
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
......@@ -74,6 +74,6 @@ end
function c11561010.xdesop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,11561010)
Duel.Destroy(c,REASON_EFFECT)
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
......@@ -28,16 +28,37 @@ function c11561011.initial_effect(c)
e2:SetOperation(c11561011.xxop)
c:RegisterEffect(e2)
--atk
--local e3=Effect.CreateEffect(c)
--e3:SetDescription(aux.Stringid(11561011,3))
--e3:SetType(EFFECT_TYPE_QUICK_O)
--e3:SetCode(EVENT_CHAINING)
--e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
--e3:SetRange(LOCATION_MZONE)
--e3:SetCondition(c11561011.atkcon)
--e3:SetTarget(c11561011.atktg)
--e3:SetOperation(c11561011.atkop)
--c:RegisterEffect(e3)
--pendulum
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11561011,3))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c11561011.atkcon)
e3:SetTarget(c11561011.atktg)
e3:SetOperation(c11561011.atkop)
c:RegisterEffect(e3)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCondition(c11561011.pencon)
e3:SetTarget(c11561011.pentg)
e3:SetOperation(c11561011.penop)
c:RegisterEffect(e3)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(c11561011.patktg)
e1:SetOperation(c11561011.patkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c11561011.mfilter(c,xyzc)
return c:IsXyzLevel(xyzc,8)
......@@ -46,12 +67,12 @@ function c11561011.xyzcheck(g)
return g:GetClassCount(Card.GetRace)==g:GetCount()
end
function c11561011.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function c11561011.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=20 and c:IsRelateToEffect(e) then
if Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.DiscardDeck(tp,3,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=20 and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......@@ -74,7 +95,7 @@ function c11561011.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c11561011.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=20 then
if Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.DiscardDeck(tp,3,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=20 then
for i=1,9 do
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
......@@ -131,4 +152,55 @@ function c11561011.atkop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
end
end
function c11561011.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE)
end
function c11561011.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c11561011.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c11561011.cfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER+RACE_DRAGON) and c:IsSummonPlayer(tp)
end
function c11561011.patktg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c11561011.cfilter,nil,tp)
if chk==0 then return g:GetCount()>0 end
Duel.SetTargetCard(g)
end
function c11561011.patkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
if tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
tc=g:GetNext()
end
end
end
......@@ -101,14 +101,14 @@ function c11561025.drmop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(0,1)
e0:SetValue(1)
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
--local e0=Effect.CreateEffect(e:GetHandler())
--e0:SetType(EFFECT_TYPE_FIELD)
--e0:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
--e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
--e0:SetTargetRange(0,1)
--e0:SetValue(1)
--e0:SetReset(RESET_PHASE+PHASE_END)
--Duel.RegisterEffect(e0,tp)
end
......
......@@ -16,64 +16,19 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
if not cm.DreamCheck then
cm.DreamCheck=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetCondition(cm.chcon)
ge1:SetOperation(cm.chop)
Duel.RegisterEffect(ge1,0)
_DreamIsRelateToEffect=Card.IsRelateToEffect
function Card.IsRelateToEffect(c,e)
local b1=Duel.IsExistingMatchingCard(cm.cfilter,0,LOCATION_SZONE,LOCATION_SZONE,1,nil)
local b1=Duel.IsExistingMatchingCard(cm.cfilter,0,LOCATION_SZONE,LOCATION_SZONE,1,nil,e)
local b2=(e:GetHandler()==c and e:IsActivated())
if b1 and b2 then return false end
return _DreamIsRelateToEffect(c,e)
end
end
end
function cm.cfilter(c)
return c:GetEffectCount(15000189)~=0 and c:IsFaceup() and c:IsStatus(STATUS_EFFECT_ENABLED) and not c:IsDisabled()
end
function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return (rc:IsType(TYPE_CONTINUOUS) or rc:IsType(TYPE_FIELD) or rc:IsType(TYPE_PENDULUM) or rc:IsType(TYPE_EQUIP)) and re:GetOperation() and re:IsActivated()
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetOwner()
local rc=re:GetHandler()
local op=re:GetOperation()
if not (rc:IsLocation(LOCATION_FZONE) or rc:IsLocation(LOCATION_SZONE) or rc:IsLocation(LOCATION_PZONE)) then return end
if op then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(15000189)
e1:SetTargetRange(1,0)
e1:SetOperation(op)
e1:SetLabelObject(re)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,0)
re:SetOperation(cm.chaop)
end
end
function cm.chaop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local se=Duel.IsPlayerAffectedByEffect(0,15000189)
if not se then se=Duel.IsPlayerAffectedByEffect(1,15000189) end
local op=nil
if se then
local x=1
for _,i in ipairs{Duel.IsPlayerAffectedByEffect(0,15000189)} do
if i:GetLabelObject()==e and x~=0 then
op=i:GetOperation()
i:Reset()
x=0
end
end
end
local ag=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
if ag:GetCount()==0 then op(e,tp,eg,ep,ev,re,r,rp) return end
if ag:GetCount()~=0 and c:IsRelateToEffect(e) then
op(e,tp,eg,ep,ev,re,r,rp)
function cm.cfilter(c,se)
local ce=nil
if c:GetEffectCount(15000189)~=0 then
ce=c:IsHasEffect(15000189)
end
return c:GetEffectCount(15000189)~=0 and c:IsFaceup() and c:IsStatus(STATUS_EFFECT_ENABLED) and not c:IsDisabled() and not se:GetHandler():IsImmuneToEffect(ce)
end
\ No newline at end of file
local m=189132
local cm=_G["c"..m]
cm.name="漆黑噤默-罗兰"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--sp summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--SearchCard
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if e:GetHandler():IsRelateToEffect(e) and Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)>0 and g:GetCount()>0 then
Duel.BreakEffect()
Duel.ConfirmCards(tp,g)
Duel.ShuffleHand(1-tp)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActivated() and aux.IsCodeListed(re:GetHandler(),189131)
end
function cm.thfilter(c)
return aux.IsCodeListed(c,189131) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
local m=189133
local cm=_G["c"..m]
cm.name="墨工坊"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetCost(aux.bfgcost)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_TO_HAND)
e3:SetCondition(cm.th2con)
e3:SetOperation(cm.th2op)
Duel.RegisterEffect(e3,0)
end
end
function cm.hfilter(c)
return not c:IsPublic()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.hfilter,tp,0,LOCATION_HAND,nil)>0
end
function cm.qpfilter(e,c)
return aux.IsCodeListed(c,189131)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.hfilter,tp,0,LOCATION_HAND,nil)
if g:GetCount()~=0 then
local ct=1
if Duel.IsPlayerAffectedByEffect(tp,189137) and Duel.GetFlagEffect(tp,189137)==0 and g:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(189137,2)) then
ct=2
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+189138,e,REASON_EFFECT,tp,1-tp,ev)
Duel.RegisterFlagEffect(tp,189137,RESET_PHASE+PHASE_END,0,1)
end
local ag=g:RandomSelect(tp,ct)
local ac=ag:GetFirst()
while ac do
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
Duel.BreakEffect()
--act qp in hand
Duel.RegisterFlagEffect(tp,189133,RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(cm.qpfilter)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function cm.phfilter(c)
return c:IsPublic() and c:IsType(TYPE_SPELL)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActivated() and aux.IsCodeListed(re:GetHandler(),189131) and Duel.GetMatchingGroupCount(cm.phfilter,tp,0,LOCATION_HAND,nil)>0
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local ac=re:GetHandler()
if ac:IsRelateToEffect(re) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(LOCATION_HAND)
ac:RegisterEffect(e1)
ac:RegisterFlagEffect(189134,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function cm.th2filter(c)
return c:GetFlagEffect(189134)~=0
end
function cm.th2con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.th2filter,1,nil)
end
function cm.th2op(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.th2filter,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
\ No newline at end of file
local m=189134
local cm=_G["c"..m]
cm.name="轮盘重工"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(189133,4))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(cm.handcon)
c:RegisterEffect(e0)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1150)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
--stats up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(cm.deffilter))
e2:SetValue(500)
c:RegisterEffect(e2)
--banish
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.dbtg)
e3:SetOperation(cm.dbop)
c:RegisterEffect(e3)
end
function cm.handcon(e)
return Duel.GetFlagEffect(e:GetHandler():GetControler(),189133)~=0
end
function cm.hfilter(c)
return not c:IsPublic()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(cm.hfilter,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local ct=1
if Duel.IsPlayerAffectedByEffect(tp,189137) and Duel.GetFlagEffect(tp,189137)==0 and g:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(189137,2)) then
ct=2
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+189138,e,REASON_EFFECT,tp,1-tp,ev)
Duel.RegisterFlagEffect(tp,189137,RESET_PHASE+PHASE_END,0,1)
end
local ag=g:RandomSelect(tp,ct)
local ac=ag:GetFirst()
while ac do
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
end
end
function cm.deffilter(c)
return aux.IsCodeListed(c,189131)
end
function cm.dhfilter(c,rtype)
return c:IsPublic() and c:IsType(rtype)
end
function cm.dbfilter(c,tp)
local rtype=bit.band(c:GetType(),0x7)
return Duel.IsExistingMatchingCard(cm.dhfilter,tp,0,LOCATION_HAND,1,nil,rtype) and c:IsFaceup()
end
function cm.dbtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(1-tp) and cm.dbfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.dbfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.dbfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.dbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
local m=189135
local cm=_G["c"..m]
cm.name="阿拉斯工作室"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.hfilter(c)
return not c:IsPublic()
end
function cm.tgfilter(c)
return aux.IsCodeListed(c,189131) and c:IsAbleToGrave()
end
function cm.spfilter(c,e,tp)
return ((c:IsLocation(LOCATION_HAND) and (c:IsPublic() or c:GetFlagEffect(189133)~=0)) or (c:IsLocation(LOCATION_GRAVE))) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(cm.hfilter,tp,0,LOCATION_HAND,nil)>0 and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.AnnounceType(tp))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.hfilter,tp,0,LOCATION_HAND,nil)
local rtype=0
if g:GetCount()~=0 then
local ct=1
if Duel.IsPlayerAffectedByEffect(tp,189137) and Duel.GetFlagEffect(tp,189137)==0 and g:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(189137,2)) then
ct=2
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+189138,e,REASON_EFFECT,tp,1-tp,ev)
Duel.RegisterFlagEffect(tp,189137,RESET_PHASE+PHASE_END,0,1)
end
local ag=g:RandomSelect(tp,ct)
local ac=ag:GetFirst()
while ac do
if bit.band(rtype,bit.band(ac:GetType(),0x7))==0 then
rtype=rtype+bit.band(ac:GetType(),0x7)
end
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
local opt=e:GetLabel()
if (opt==0 and bit.band(rtype,TYPE_MONSTER)~=0) or (opt==1 and bit.band(rtype,TYPE_SPELL)~=0) or (opt==2 and bit.band(rtype,TYPE_TRAP)~=0) then
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,0,LOCATION_HAND+LOCATION_GRAVE,1,nil,e,tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,0,LOCATION_HAND+LOCATION_GRAVE,1,1,nil,e,tp)
local tc=g1:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE)
tc:RegisterEffect(e4)
Duel.SpecialSummonComplete()
end
end
elseif Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) then
local fg=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=fg:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
\ No newline at end of file
local m=189136
local cm=_G["c"..m]
cm.name="卡莉斯塔工作室"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(189133,4))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(cm.handcon)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1150)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--look
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1)
e2:SetCondition(cm.hcon)
e2:SetOperation(cm.hop)
c:RegisterEffect(e2)
end
function cm.handcon(e)
return Duel.GetFlagEffect(e:GetHandler():GetControler(),189133)~=0
end
--tp:自 己
--p:破 坏 的 怪 兽 存 在 过 的 玩 家
--seq:破 坏 的 怪 兽 存 在 过 的 序 号
--arrow:准 备 检 查 的 方 向
function cm.seqfilter(c,seq,tp,p,arrow,loc)
--local loc=LOCATION_MZONE
if seq>=8 then
loc=LOCATION_SZONE
seq=seq-8
end
if seq>=5 and loc==LOCATION_SZONE then return false end
if seq==7 and loc==LOCATION_MZONE then return false end
local cseq=c:GetSequence()
local cloc=c:GetLocation()
local cp=c:GetControler()
if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc==LOCATION_MZONE and cseq>=5 and seq<5 and loc==LOCATION_MZONE then
if arrow=="up" and cp==p and cp==tp and ((seq==1 and cseq==5) or (seq==3 and cseq==6)) then return true end
if arrow=="up" and cp~=p and cp~=tp and ((seq==1 and cseq==6) or (seq==3 and cseq==5)) then return true end
if arrow=="down" and cp==p and cp~=tp and ((seq==1 and cseq==5) or (seq==3 and cseq==6) or seq==cseq) then return true end
if arrow=="down" and cp~=p and cp==tp and ((seq==1 and cseq==6) or (seq==3 and cseq==5) or seq==cseq) then return true end
if arrow=="left" or arrow=="right" then return false end
end
if cloc==LOCATION_MZONE and seq>=5 and cseq<5 and loc==LOCATION_MZONE then
if arrow=="up" and cp==p and cp~=tp and ((seq==5 and cseq==1) or (seq==6 and cseq==3)) then return true end
if arrow=="up" and cp~=p and cp~=tp and ((seq==5 and cseq==3) or (seq==6 and cseq==1)) then return true end
if arrow=="down" and cp==p and cp==tp and ((seq==5 and cseq==1) or (seq==6 and cseq==3)) then return true end
if arrow=="down" and cp~=p and cp==tp and ((seq==5 and cseq==3) or (seq==6 and cseq==1)) then return true end
if arrow=="left" or arrow=="right" then return false end
end
if arrow=="left" and cp==p and cp==tp then return loc==cloc and cseq==seq-1 end
if arrow=="right" and cp==p and cp==tp then return loc==cloc and cseq==seq+1 end
if arrow=="left" and cp==p and cp~=tp then return loc==cloc and cseq==seq+1 end
if arrow=="right" and cp==p and cp~=tp then return loc==cloc and cseq==seq-1 end
if cloc==LOCATION_MZONE and seq<5 and cseq<5 and loc==LOCATION_SZONE then
if arrow=="up" and cp==p and cp==tp and cseq==seq then return true end
if arrow=="down" and cp==p and cp~=tp and cseq==seq then return true end
if arrow=="left" or arrow=="right" then return false end
end
if cloc==LOCATION_SZONE and seq<5 and cseq<5 and loc==LOCATION_MZONE then
if arrow=="up" and cp==p and cp~=tp and cseq==seq then return true end
if arrow=="down" and cp==p and cp==tp and cseq==seq then return true end
if arrow=="left" or arrow=="right" then return false end
end
return false
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local list={}
table.insert(list,aux.Stringid(m,1))
table.insert(list,aux.Stringid(m,2))
table.insert(list,aux.Stringid(m,3))
table.insert(list,aux.Stringid(m,4))
local ct=4
while #list~=0 and list~={0,0,0,0} and tc and ct>0 do
local loc=tc:GetLocation()
local slist={}
table.insert(slist,aux.Stringid(m,1)) --up
table.insert(slist,aux.Stringid(m,2)) --down
table.insert(slist,aux.Stringid(m,3)) --left
table.insert(slist,aux.Stringid(m,4)) --right
local p=tc:GetControler()
local seq=tc:GetSequence()
if table.concat(list,nil,4,4)+1==1 or not Duel.IsExistingMatchingCard(cm.seqfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,seq,tp,p,"right",loc) then
table.remove(slist,4)
end
if table.concat(list,nil,3,3)+1==1 or not Duel.IsExistingMatchingCard(cm.seqfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,seq,tp,p,"left",loc) then
table.remove(slist,3)
end
if table.concat(list,nil,2,2)+1==1 or not Duel.IsExistingMatchingCard(cm.seqfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,seq,tp,p,"down",loc) then
table.remove(slist,2)
end
if table.concat(list,nil,1,1)+1==1 or not Duel.IsExistingMatchingCard(cm.seqfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,seq,tp,p,"up",loc) then
table.remove(slist,1)
end
--if #slist==0 then Duel.Destroy(tc,REASON_EFFECT) break end
if Duel.Destroy(tc,REASON_EFFECT)~=0 and #slist~=0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local opt=Duel.SelectOption(tp,table.unpack(slist))
local arrow="0"
if table.concat(slist,nil,opt+1,opt+1)+1==aux.Stringid(m,4)+1 then
arrow="right"
table.insert(list,4,0)
table.remove(list,5)
end
if table.concat(slist,nil,opt+1,opt+1)+1==aux.Stringid(m,3)+1 then
arrow="left"
table.insert(list,3,0)
table.remove(list,4)
end
if table.concat(slist,nil,opt+1,opt+1)+1==aux.Stringid(m,2)+1 then
arrow="down"
table.insert(list,2,0)
table.remove(list,3)
end
if table.concat(slist,nil,opt+1,opt+1)+1==aux.Stringid(m,1)+1 then
arrow="up"
table.insert(list,1,0)
table.remove(list,2)
end
ct=ct-1
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,seq,tp,p,arrow,loc)
Duel.HintSelection(tg)
tc=tg:GetFirst()
else break
end
end
end
end
function cm.hfilter(c)
return not c:IsPublic()
end
function cm.bfilter(c)
return aux.IsCodeListed(c,189131) and c:IsFaceup()
end
function cm.hcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.hfilter,tp,0,LOCATION_HAND,1,nil) and Duel.IsExistingMatchingCard(cm.bfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function cm.hop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.hfilter,tp,0,LOCATION_HAND,nil)
if g:GetCount()~=0 then
local ct=1
if Duel.IsPlayerAffectedByEffect(tp,189137) and Duel.GetFlagEffect(tp,189137)==0 and g:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(189137,2)) then
ct=2
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+189138,e,REASON_EFFECT,tp,1-tp,ev)
Duel.RegisterFlagEffect(tp,189137,RESET_PHASE+PHASE_END,0,1)
end
local ag=g:RandomSelect(tp,ct)
local ac=ag:GetFirst()
while ac do
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
end
end
\ No newline at end of file
local m=189137
local cm=_G["c"..m]
cm.name="Furioso"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(189133,4))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(cm.handcon)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1150)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--add public count
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(189137)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CUSTOM+189138)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
--Activate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,4))
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_HAND)
e4:SetCondition(cm.hancon)
e4:SetTarget(cm.hantg)
e4:SetOperation(cm.activate)
c:RegisterEffect(e4)
if not cm.FuriosoCheck then
cm.FuriosoCheck=true
_FuriosoIsHasType=Effect.IsHasType
function Effect.IsHasType(e,typ)
if typ==EFFECT_TYPE_ACTIVATE and e:GetDescription() and e:GetDescription()+1==aux.Stringid(m,4)+1 then return true end
return _FuriosoIsHasType(e,typ)
end
end
end
function cm.hancon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActivated() and aux.IsCodeListed(re:GetHandler(),189131)
end
function cm.handcon(e)
return Duel.GetFlagEffect(e:GetHandler():GetControler(),189133)~=0
end
function cm.hantg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local b1=c:GetActivateEffect():IsActivatable(tp,true)
e:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_ACTIVATE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetLabelObject(e)
e1:SetCondition(cm.regcon)
e1:SetOperation(cm.regop)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(tp)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAINING)
Duel.RegisterEffect(e2,tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and b1
end
Duel.RegisterFlagEffect(tp,189132,RESET_CHAIN,0,1,e:GetFieldID())
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local se=e:GetLabelObject()
local tp=e:GetLabel()
local x=0
if Duel.GetFlagEffect(tp,189132)~=0 then
for _,i in ipairs{Duel.GetFlagEffectLabel(tp,189132)} do
if i==se:GetFieldID() then x=1 end
end
end
return se and ((not re) or (re~=se and (e:GetCode()==EVENT_CHAINING and (Duel.GetFlagEffect(tp,189132)==0 or x==0))))
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local se=e:GetLabelObject()
if se and se:IsHasType(EFFECT_TYPE_ACTIVATE) then
se:SetType(EFFECT_TYPE_QUICK_O)
end
end
function cm.tgfilter(c)
return aux.IsCodeListed(c,189131) and c:IsAbleToGrave()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
if e:GetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_ACTIVATE) then
e:SetType(EFFECT_TYPE_QUICK_O)
end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,189137)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetCondition(cm.setcon2)
e1:SetOperation(cm.setop2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.setfilter(c)
return aux.IsCodeListed(c,189131) and ((c:IsType(TYPE_SPELL+TYPE_TRAP) and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable()) or (c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)))
end
function cm.setcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.setop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
elseif (tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
end
\ No newline at end of file
local m=189138
local cm=_G["c"..m]
cm.name="杜兰达尔"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(189133,4))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(cm.handcon)
c:RegisterEffect(e0)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1150)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
c:RegisterEffect(e1)
--to hand 1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.th1tg)
e2:SetOperation(cm.th1op)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--disable spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_SUMMON)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.th2con)
e4:SetTarget(cm.th2tg)
e4:SetOperation(cm.th2op)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e5)
end
function cm.handcon(e)
return Duel.GetFlagEffect(e:GetHandler():GetControler(),189133)~=0
end
function cm.hfilter(c)
return not c:IsPublic()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(cm.hfilter,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local ct=1
if Duel.IsPlayerAffectedByEffect(tp,189137) and Duel.GetFlagEffect(tp,189137)==0 and g:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(189137,2)) then
ct=2
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+189138,e,REASON_EFFECT,tp,1-tp,ev)
Duel.RegisterFlagEffect(tp,189137,RESET_PHASE+PHASE_END,0,1)
end
local ag=g:RandomSelect(tp,ct)
local ac=ag:GetFirst()
while ac do
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
end
end
function cm.cfilter(c)
return c:IsFaceup() and aux.IsCodeListed(c,189131)
end
function cm.th1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local tp=e:GetHandler():GetControler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) and eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,#eg,0,0)
end
function cm.th1op(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoHand(eg,nil,REASON_EFFECT)~=0 then
local ag=eg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if #ag~=0 then
local ac=ag:GetFirst()
while ac do
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
end
end
end
function cm.hcfilter(c)
return c:IsPublic() and c:IsType(TYPE_MONSTER)
end
function cm.th2con(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and Duel.GetCurrentChain()==0
end
function cm.th2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local tp=e:GetHandler():GetControler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.hcfilter,tp,0,LOCATION_HAND,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,#eg,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,#eg,0,0)
end
function cm.th2op(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
if Duel.SendtoHand(eg,nil,REASON_EFFECT)~=0 then
local ag=eg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if #ag~=0 then
local ac=ag:GetFirst()
while ac do
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
end
end
end
\ No newline at end of file
local m=189139
local cm=_G["c"..m]
cm.name="琅琊工坊"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--SSet
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.filter(c,e,tp)
return aux.IsCodeListed(c,189131) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
end
function cm.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,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 then
Duel.BreakEffect()
local ag=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,ag)
if ag:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
Duel.Damage(1-tp,2000,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
end
end
function cm.htfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable() and c:IsPublic()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.htfilter,tp,0,LOCATION_HAND,1,nil) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
local g=Duel.SelectMatchingCard(tp,cm.htfilter,tp,0,LOCATION_HAND,1,1,nil)
local code=g:GetFirst():GetCode()
if Duel.SSet(tp,g,1-tp)~=0 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,1)
e2:SetLabel(code)
e2:SetValue(cm.aclimit)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end
function cm.aclimit(e,re,tp)
local c=re:GetHandler()
local code=e:GetLabel()
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsCode(code)
end
\ No newline at end of file
local m=189140
local cm=_G["c"..m]
cm.name="桦树工坊"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
end
function cm.hfilter(c)
return not c:IsPublic()
end
function cm.tgfilter(c)
return c:IsType(TYPE_MONSTER)
end
function cm.hcfilter(c)
return c:IsLocation(LOCATION_HAND) and (c:IsPublic() or c:GetFlagEffect(189133)~=0)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(cm.hfilter,tp,0,LOCATION_HAND,nil)>0 and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.AnnounceType(tp))
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_MZONE)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.hfilter,tp,0,LOCATION_HAND,nil)
local rtype=0
if g:GetCount()~=0 then
local ct=1
if Duel.IsPlayerAffectedByEffect(tp,189137) and Duel.GetFlagEffect(tp,189137)==0 and g:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(189137,2)) then
ct=2
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+189138,e,REASON_EFFECT,tp,1-tp,ev)
Duel.RegisterFlagEffect(tp,189137,RESET_PHASE+PHASE_END,0,1)
end
local ag=g:RandomSelect(tp,ct)
local ac=ag:GetFirst()
while ac do
if bit.band(rtype,bit.band(ac:GetType(),0x7))==0 then
rtype=rtype+bit.band(ac:GetType(),0x7)
end
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #dg~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local opt=e:GetLabel()
if Duel.Destroy(sg,REASON_EFFECT)~=0 and ((opt==0 and bit.band(rtype,TYPE_MONSTER)~=0) or (opt==1 and bit.band(rtype,TYPE_SPELL)~=0) or (opt==2 and bit.band(rtype,TYPE_TRAP)~=0)) then
local fg=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #fg~=0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local hg=fg:Select(tp,1,1,nil)
if hg:GetCount()>0 then
local tc=hg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetValue(RESET_TURN_SET)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
end
end
end
end
end
function cm.drfilter(c)
return c:IsFaceup() and aux.IsCodeListed(c,189131) and c:IsAbleToDeck()
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) and chkc:IsControler(tp) and cm.drfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(cm.drfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,5,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.drfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,5,5,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)<=0 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
local m=189141
local cm=_G["c"..m]
cm.name="逻辑工作室"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--extra attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetCondition(aux.bpcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.atktg)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
end
function cm.hfilter(c)
return c:IsPublic()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.hfilter,tp,0,LOCATION_HAND,1,nil) and Duel.IsPlayerCanDraw(1-tp,1) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=1
local x=0
while ct<=3 do
if Duel.IsExistingMatchingCard(cm.hfilter,tp,0,LOCATION_HAND,1,nil) and Duel.IsPlayerCanDraw(1-tp,1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.hfilter,tp,0,LOCATION_HAND,1,1,nil)
if Duel.Destroy(g,REASON_EFFECT)==0 then return end
if g:GetFirst():IsType(TYPE_SPELL+TYPE_TRAP) then x=1 end
Duel.BreakEffect()
local ag=Duel.GetDecktopGroup(1-tp,1)
if Duel.Draw(1-tp,1,REASON_EFFECT)~=0 then
Duel.ConfirmCards(tp,ag)
Duel.ShuffleHand(1-tp)
end
end
ct=ct+1
if ct<=3 and ((not Duel.IsExistingMatchingCard(cm.hfilter,tp,0,LOCATION_HAND,1,nil)) or (not Duel.IsPlayerCanDraw(1-tp,1))) then
break
end
if ct<=3 and not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
break
end
end
if x==1 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,aux.ExceptThisCard(e),tp,POS_FACEUP,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e),tp,POS_FACEUP,REASON_EFFECT)
if #rg~=0 then
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
end
function cm.atkfilter(c)
return c:IsFaceup() and aux.IsCodeListed(c,189131) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.ftarget)
e2:SetLabel(tc:GetFieldID())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function cm.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
\ No newline at end of file
local m=189142
local cm=_G["c"..m]
cm.name="老男孩工坊"
function cm.initial_effect(c)
aux.AddCodeList(c,189131)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.hfilter(c)
return not c:IsPublic()
end
function cm.thfilter(c,typ)
local rtype=bit.band(c:GetType(),0x7)
return aux.IsCodeListed(c,189131) and c:IsAbleToHand() and ((not typ) or (bit.band(rtype,typ)~=0))
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(cm.hfilter,tp,0,LOCATION_HAND,nil)>0 and Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,nil) end
local list={}
local m=0
local s=0
local t=0
if Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,TYPE_MONSTER) then
table.insert(list,70)
m=1
end
if Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,TYPE_SPELL) then
table.insert(list,71)
s=1
end
if Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,TYPE_TRAP) then
table.insert(list,72)
t=1
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local op=Duel.SelectOption(tp,table.unpack(list))
local opt=0
if op==0 then
if m==1 then opt=0 end
if m==0 and s==1 then opt=1 end
if m==0 and s==0 and t==1 then opt=2 end
end
if op==1 then
if m==1 and s==1 then opt=1 end
if m==1 and s==0 and t==1 then opt=2 end
if m==0 and s==1 and t==1 then opt=2 end
end
if op==2 then
opt=2
end
e:SetLabel(opt)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.hfilter,tp,0,LOCATION_HAND,nil)
local rtype=0
if g:GetCount()~=0 then
local ct=1
if Duel.IsPlayerAffectedByEffect(tp,189137) and Duel.GetFlagEffect(tp,189137)==0 and g:GetCount()>=2 and Duel.SelectYesNo(tp,aux.Stringid(189137,2)) then
ct=2
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+189138,e,REASON_EFFECT,tp,1-tp,ev)
Duel.RegisterFlagEffect(tp,189137,RESET_PHASE+PHASE_END,0,1)
end
local ag=g:RandomSelect(tp,ct)
local ac=ag:GetFirst()
while ac do
if bit.band(rtype,bit.band(ac:GetType(),0x7))==0 then
rtype=rtype+bit.band(ac:GetType(),0x7)
end
ac:RegisterFlagEffect(189133,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,66)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e1)
ac=ag:GetNext()
end
Duel.ConfirmCards(tp,ag)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,rtype)
if g:GetCount()>0 then
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local opt=e:GetLabel()
if ((opt==0 and bit.band(rtype,TYPE_MONSTER)~=0) or (opt==1 and bit.band(rtype,TYPE_SPELL)~=0) or (opt==2 and bit.band(rtype,TYPE_TRAP)~=0)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
end
\ No newline at end of file
--二角獣の使い魔
function c49811210.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49811210,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetCountLimit(1,49811210)
e1:SetCost(c49811210.thcost)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(c49811210.thtg)
e1:SetOperation(c49811210.thop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49811210,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,49811211)
e2:SetCost(aux.bfgcost)
e2:SetCondition(c49811210.tgcon)
e2:SetTarget(c49811210.tgtg)
e2:SetOperation(c49811210.tgop)
c:RegisterEffect(e2)
end
function c49811210.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c49811210.thfilter(c)
return c:IsLevelBelow(5) and c:IsRace(RACE_BEAST) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsType(TYPE_TUNER)
end
function c49811210.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811210.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c49811210.thop(e,tp,eg,ep,ev,re,r,rp)
c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c49811210.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c49811210.splimit)
Duel.RegisterEffect(e1,tp)
end
function c49811210.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsAttribute(ATTRIBUTE_LIGHT)
end
function c49811210.tgfilter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK) and c:IsPreviousControler(tp)
end
function c49811210.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c49811210.tgfilter,1,nil,1-tp)
end
function c49811210.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c49811210.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c49811210.cfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if chk==0 then return ct>0 and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=ct and Duel.IsPlayerCanDiscardDeck(1-tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,ct)
end
function c49811210.tgop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c49811210.cfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if ct>0 then
Duel.DiscardDeck(1-tp,ct,REASON_EFFECT)
end
end
\ No newline at end of file
--三角獣の使い魔
function c49811212.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49811212,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,49811212)
e1:SetTarget(c49811212.sptg)
e1:SetOperation(c49811212.spop)
c:RegisterEffect(e1)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49811212,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,49811213)
e2:SetCost(aux.bfgcost)
e2:SetCondition(c49811212.rmcon)
e2:SetTarget(c49811212.rmtg)
e2:SetOperation(c49811212.rmop)
c:RegisterEffect(e2)
end
function c49811212.spfilter(c,e,tp)
return c:IsRace(RACE_BEAST) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c49811212.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c49811212.spfilter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c49811212.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c49811212.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c49811212.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 then
local g=Group.FromCards(c,tc)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c49811212.splimit)
Duel.RegisterEffect(e1,tp)
end
function c49811212.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_SYNCHRO)
end
function c49811212.rmfilter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK) and c:IsPreviousControler(tp)
end
function c49811212.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c49811212.rmfilter,1,nil,1-tp)
end
function c49811212.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
end
function c49811212.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811212.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c49811212.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c49811212.cfilter,tp,LOCATION_DECK,0,1,1,nil)
local tg=g:GetFirst()
if tg==nil then return end
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--三角獣
function c49811214.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c49811214.splimit)
c:RegisterEffect(e1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,49811214)
e1:SetCondition(c49811214.spcon)
e1:SetTarget(c49811214.sptg)
e1:SetOperation(c49811214.spop)
c:RegisterEffect(e1)
--gain effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(c49811214.efcon)
e2:SetOperation(c49811214.efop)
c:RegisterEffect(e2)
end
function c49811214.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c49811214.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c49811214.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c49811214.cfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil)
end
function c49811214.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c49811214.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
if c:IsSummonLocation(LOCATION_GRAVE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
local g=Duel.GetMatchingGroup(c49811214.cfilter,tp,LOCATION_REMOVED,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(49811214,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tag=g:Select(tp,1,1,nil)
Duel.SendtoHand(tag,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tag)
end
end
end
function c49811214.efcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsRace(RACE_BEAST)
end
function c49811214.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(49811214,1))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(2,49811214)
e1:SetCondition(c49811214.chcon)
e1:SetTarget(c49811214.chtg)
e1:SetOperation(c49811214.chop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(49811214,2))
end
function c49811214.chcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:GetActivateLocation()==LOCATION_GRAVE
end
function c49811214.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,rp,0,LOCATION_EXTRA,1,nil,e) end
end
function c49811214.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c49811214.repop)
end
function c49811214.repop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,1-tp,LOCATION_EXTRA,0,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DESTROY)
local sg=g:Select(1-tp,1,1,nil)
if sg:GetCount()>0 then
Duel.Destroy(sg,REASON_EFFECT)
end
end
\ No newline at end of file
--角獣の門
function c49811216.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,49811216)
e1:SetTarget(c49811216.target)
e1:SetOperation(c49811216.activate)
c:RegisterEffect(e1)
--add or special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49811216,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,49811217)
e2:SetCondition(c49811216.spcon)
e2:SetTarget(c49811216.sptg)
e2:SetOperation(c49811216.spop)
c:RegisterEffect(e2)
end
function c49811216.filter(c)
return (c:IsCode(63595262) or c:IsCode(64047146)) and c:IsAbleToHand()
end
function c49811216.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811216.filter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c49811216.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c49811216.filter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTarget(c49811216.rmtarget)
e1:SetTargetRange(0xff,0xff)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c49811216.rmtarget(e,c)
return c:IsType(TYPE_SPELL)
end
function c49811216.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c49811216.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c49811216.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c49811216.dfilter(c,e,tp,ft)
return c:IsRace(RACE_BEAST) and c:IsType(TYPE_TUNER) and (c:IsAttack(1000) or c:IsDefense(1000)) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c49811216.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c49811216.dfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,ft) end
end
function c49811216.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c49811216.dfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,ft)
local tc=g:GetFirst()
if tc then
if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
\ No newline at end of file
--角獣の予言
function c49811218.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,49811218)
e1:SetTarget(c49811218.target)
e1:SetOperation(c49811218.activate)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49811218,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,49811219)
e2:SetCondition(c49811218.rmcon)
e2:SetTarget(c49811218.rmtg)
e2:SetOperation(c49811218.rmop)
c:RegisterEffect(e2)
end
function c49811218.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1)
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
end
function c49811218.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerCanDiscardDeck(tp,1) then
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if tc:IsType(TYPE_SPELL) and tc:IsAbleToHand() then
Duel.DisableShuffleCheck()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ShuffleHand(tp)
else
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_REVEAL)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTarget(c49811218.rmtarget)
e1:SetTargetRange(0xff,0xff)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c49811218.rmtarget(e,c)
return c:IsType(TYPE_SPELL)
end
function c49811218.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c49811218.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c49811218.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c49811218.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c49811218.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--スタティック・フュプノコーン
function c49811220.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(c49811220.atkval)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCondition(c49811220.condition)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c49811220.efilter)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c49811220.valcheck)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c49811220.afilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c49811220.atkval(e,c)
return Duel.GetMatchingGroupCount(c49811220.afilter,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil)*-200
end
function c49811220.valcheck(e,c)
local g=c:GetMaterial()
if g:FilterCount(Card.IsRace,nil,RACE_BEAST)==#g then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c49811220.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) and e:GetLabel()==1
end
function c49811220.efilter(e,te)
return te:IsActiveType(TYPE_SPELL) and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
......@@ -17,7 +17,7 @@ function cm.filter(c)
return c:IsCode(60002134) and c:IsAbleToHand()
end
function cm.tgfilter(c)
return c:IsType(TYPE_MONSTER) and aux.IsCodeListed(c,60002134) and c:IsAbleToHand()
return c:IsType(TYPE_MONSTER) and aux.IsCodeListed(c,60002134) and c:IsAbleToHand() and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup()))
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return (chkc:IsLocation(LOCATION_GRAVE) or chkc:IsLocation(LOCATION_MZONE)) and chkc:IsControler(tp) and cm.tgfilter(chkc) end
......
......@@ -18,6 +18,7 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
......@@ -30,6 +31,20 @@ end
function cm.filter(c,e,tp)
return c:IsCode(60002134) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=false
local b2=false
local b3=false
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_EXTRA,0,1,nil,m+1) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,60002134) then b1=true end
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_EXTRA,0,1,nil,m+2) and Duel.IsPlayerCanDraw(tp,2) then b2=true end
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_EXTRA,0,1,nil,m+3) then b3=true end
if chk==0 then return b1 or b2 or b3 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(m,1)},
{b2,aux.Stringid(m,2)},
{b3,aux.Stringid(m,3)})
e:SetLabel(op)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Card.GetFlagEffect(c,60002134)~=0 and Duel.GetFlagEffect(tp,60002135)<4 then
......@@ -52,14 +67,11 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
if Card.GetFlagEffect(c,60002134)~=0 and Duel.GetFlagEffect(tp,60002135)>=4 then
Debug.Message("天之昭示,龙剑在此!")
local c=e:GetHandler()
Duel.Release(c,REASON_EFFECT)
local op=0
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
local op=e:GetLabel()
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
......
--星遗物-『星锥』
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddLinkProcedure(c,cm.matfilter,1,1)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0:SetValue(1)
c:RegisterEffect(e0)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetTarget(cm.mattg)
e0:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e0:SetTargetRange(LOCATION_HAND,0)
e0:SetValue(cm.matval)
c:RegisterEffect(e0)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon1)
e1:SetTarget(cm.thtg1)
e1:SetOperation(cm.thop1)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
end
function cm.matfilter(c)
return c:IsLinkSetCard(0xfe) and not c:IsCode(m)
end
function cm.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,true
end
function cm.mattg(e,c)
return c:IsSetCard(0xfe) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(5)
end
function cm.thcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter1(c)
return c:IsSetCard(0xfe) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
\ No newline at end of file
--星遗物-『星剑』
local cm,m,o=GetID()
function cm.initial_effect(c)
--summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_HAND)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.sumcon)
e4:SetCost(cm.sumcost)
e4:SetTarget(cm.sumtg)
e4:SetOperation(cm.sumop)
c:RegisterEffect(e4)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(27918365,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_RELEASE)
e3:SetCountLimit(1,m+10000000)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
--attack all
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ATTACK_ALL)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp
end
function cm.cfilter(c)
return c:IsSetCard(0xfe) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end
function cm.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local pos=0
if c:IsSummonable(true,nil,1) then pos=pos+POS_FACEUP_ATTACK end
if c:IsMSetable(true,nil,1) then pos=pos+POS_FACEDOWN_DEFENSE end
if pos==0 then return end
if Duel.SelectPosition(tp,c,pos)==POS_FACEUP_ATTACK then
Duel.Summon(tp,c,true,nil,1)
else
Duel.MSet(tp,c,true,nil,1)
end
end
function cm.thfilter(c)
return c:IsSetCard(0xfe) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--星遗物-『星核』
local cm,m,o=GetID()
function cm.initial_effect(c)
--summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_HAND)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.sumcon)
e4:SetCost(cm.sumcost)
e4:SetTarget(cm.sumtg)
e4:SetOperation(cm.sumop)
c:RegisterEffect(e4)
--normal summon/set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m+10000000)
e1:SetCondition(cm.sumcon2)
e1:SetTarget(cm.sumtg2)
e1:SetOperation(cm.sumop2)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.kop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetValue(cm.aclimit)
c:RegisterEffect(e4)
end
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp
end
function cm.cfilter(c)
return c:IsSetCard(0xfe) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end
function cm.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local pos=0
if c:IsSummonable(true,nil,1) then pos=pos+POS_FACEUP_ATTACK end
if c:IsMSetable(true,nil,1) then pos=pos+POS_FACEDOWN_DEFENSE end
if pos==0 then return end
if Duel.SelectPosition(tp,c,pos)==POS_FACEUP_ATTACK then
Duel.Summon(tp,c,true,nil,1)
else
Duel.MSet(tp,c,true,nil,1)
end
end
function cm.sumcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.sumtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=0
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_SET_SUMMON_COUNT_LIMIT)}
for _,te in ipairs(ce) do
ct=math.max(ct,te:GetValue())
end
return ct<7
end
end
function cm.sumop2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(7)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function cm.kter(c)
return c:IsFaceup()
end
function cm.kop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:Filter(cm.kter,nil):GetFirst()
while tc do
tc:RegisterFlagEffect(m,RESET_CHAIN,0,1)
tc=eg:GetNext()
end
end
function cm.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():GetFlagEffect(m)>0
end
\ No newline at end of file
--时溯之咏叹调
Duel.LoadScript("c60002355.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(Aria.ytdcost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--back
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCost(Aria.ytdcost)
e2:SetCondition(Aria.bkcon)
e2:SetTarget(Aria.bktg)
e2:SetOperation(Aria.bkop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsSetCard(0x627) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355) then
if chk==0 then return true end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355)>=2 then
Aria.StartAria(c)
end
if Duel.GetCurrentChain()>=4 then
Duel.RegisterFlagEffect(tp,70002355,RESET_PHASE+PHASE_END,0,1)
end
end
\ No newline at end of file
--达摩克里斯之咏叹调
Duel.LoadScript("c60002355.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(Aria.ytdcost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--back
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCondition(Aria.bkcon)
e2:SetCost(Aria.ytdcost)
e2:SetTarget(Aria.bktg)
e2:SetOperation(Aria.bkop)
c:RegisterEffect(e2)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2 end
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355) then
if chk==0 then return true end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
Duel.SortDecktop(tp,1-tp,3)
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355)>=2 then
Aria.StartAria(c)
end
if Duel.GetCurrentChain()>=4 then
Duel.RegisterFlagEffect(tp,70002355,RESET_PHASE+PHASE_END,0,1)
end
end
\ No newline at end of file
This diff is collapsed.
--虚无之咏叹调
Duel.LoadScript("c60002355.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(Aria.ytdcost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--back
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCondition(Aria.bkcon)
e2:SetCost(Aria.ytdcost)
e2:SetTarget(Aria.bktg)
e2:SetOperation(Aria.bkop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsSetCard(0x627) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.limit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355)>=2 then
Aria.StartAria(c)
end
if Duel.GetCurrentChain()>=4 then
Duel.RegisterFlagEffect(tp,70002355,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.limit(e,c,sump,sumtype,sumpos,targetp)
return c:IsType(TYPE_UNION) or c:IsType(TYPE_FLIP)
end
\ No newline at end of file
--元创之咏叹调
Duel.LoadScript("c60002355.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(Aria.ytdcost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--back
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCondition(Aria.bkcon)
e2:SetCost(Aria.ytdcost)
e2:SetTarget(Aria.bktg)
e2:SetOperation(Aria.bkop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsSetCard(0x627) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.spcheck(g)
return g:GetClassCount(Card.GetCode)==1
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355)>=2 then
if chk==0 then return true end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local ft=math.min(2,#g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=g:SelectSubGroup(tp,cm.spcheck,false,1,ft)
if #hg>0 then
Duel.SendtoGrave(hg,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
end
end
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355)>=2 then
Aria.StartAria(c)
end
if Duel.GetCurrentChain()>=4 then
Duel.RegisterFlagEffect(tp,70002355,RESET_PHASE+PHASE_END,0,1)
end
end
\ No newline at end of file
--赫尔维蒂之咏叹调
Duel.LoadScript("c60002355.lua")
local cm,m,o=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(Aria.ytdcost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--back
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCondition(Aria.bkcon)
e2:SetCost(Aria.ytdcost)
e2:SetTarget(Aria.bktg)
e2:SetOperation(Aria.bkop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355)>=2 then
if chk==0 then return true end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()~=1 or Duel.GetFlagEffect(tp,60002355)<2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
elseif Duel.GetCurrentChain()==1 and Duel.GetFlagEffect(tp,60002355)>=2 then
Aria.StartAria(c)
end
if Duel.GetCurrentChain()>=4 then
Duel.RegisterFlagEffect(tp,70002355,RESET_PHASE+PHASE_END,0,1)
end
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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