Commit 35527d53 authored by REIKAI's avatar REIKAI 💬

update pic and lua

parent 15ec5f3d
expansions/pics/33330400.jpg

91.3 KB | W: | H:

expansions/pics/33330400.jpg

60.7 KB | W: | H:

expansions/pics/33330400.jpg
expansions/pics/33330400.jpg
expansions/pics/33330400.jpg
expansions/pics/33330400.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330401.jpg

42.3 KB | W: | H:

expansions/pics/33330401.jpg

89.3 KB | W: | H:

expansions/pics/33330401.jpg
expansions/pics/33330401.jpg
expansions/pics/33330401.jpg
expansions/pics/33330401.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330402.jpg

37.3 KB | W: | H:

expansions/pics/33330402.jpg

81.9 KB | W: | H:

expansions/pics/33330402.jpg
expansions/pics/33330402.jpg
expansions/pics/33330402.jpg
expansions/pics/33330402.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330403.jpg

37.7 KB | W: | H:

expansions/pics/33330403.jpg

81 KB | W: | H:

expansions/pics/33330403.jpg
expansions/pics/33330403.jpg
expansions/pics/33330403.jpg
expansions/pics/33330403.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330404.jpg

38.2 KB | W: | H:

expansions/pics/33330404.jpg

80.4 KB | W: | H:

expansions/pics/33330404.jpg
expansions/pics/33330404.jpg
expansions/pics/33330404.jpg
expansions/pics/33330404.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330405.jpg

36.7 KB | W: | H:

expansions/pics/33330405.jpg

78.1 KB | W: | H:

expansions/pics/33330405.jpg
expansions/pics/33330405.jpg
expansions/pics/33330405.jpg
expansions/pics/33330405.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330406.jpg

38.4 KB | W: | H:

expansions/pics/33330406.jpg

80.9 KB | W: | H:

expansions/pics/33330406.jpg
expansions/pics/33330406.jpg
expansions/pics/33330406.jpg
expansions/pics/33330406.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330407.jpg

39.8 KB | W: | H:

expansions/pics/33330407.jpg

84.2 KB | W: | H:

expansions/pics/33330407.jpg
expansions/pics/33330407.jpg
expansions/pics/33330407.jpg
expansions/pics/33330407.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330408.jpg

38.1 KB | W: | H:

expansions/pics/33330408.jpg

79.7 KB | W: | H:

expansions/pics/33330408.jpg
expansions/pics/33330408.jpg
expansions/pics/33330408.jpg
expansions/pics/33330408.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330409.jpg

40.7 KB | W: | H:

expansions/pics/33330409.jpg

86.2 KB | W: | H:

expansions/pics/33330409.jpg
expansions/pics/33330409.jpg
expansions/pics/33330409.jpg
expansions/pics/33330409.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330410.jpg

45.2 KB | W: | H:

expansions/pics/33330410.jpg

94.4 KB | W: | H:

expansions/pics/33330410.jpg
expansions/pics/33330410.jpg
expansions/pics/33330410.jpg
expansions/pics/33330410.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330411.jpg

38.9 KB | W: | H:

expansions/pics/33330411.jpg

80.5 KB | W: | H:

expansions/pics/33330411.jpg
expansions/pics/33330411.jpg
expansions/pics/33330411.jpg
expansions/pics/33330411.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330412.jpg

41.4 KB | W: | H:

expansions/pics/33330412.jpg

91.9 KB | W: | H:

expansions/pics/33330412.jpg
expansions/pics/33330412.jpg
expansions/pics/33330412.jpg
expansions/pics/33330412.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/33330413.jpg

14.8 KB | W: | H:

expansions/pics/33330413.jpg

48.5 KB | W: | H:

expansions/pics/33330413.jpg
expansions/pics/33330413.jpg
expansions/pics/33330413.jpg
expansions/pics/33330413.jpg
  • 2-up
  • Swipe
  • Onion skin
--天灾领域
local m=12001500
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.filter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.spfilter(c)
return c:IsAbleToHand()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,REASON_EFFECT)
end
end
--天外之灾 骨骸鱼
local m=12001501
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12001501,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.thfilter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.grace(g)
if not g then return false end
local race=0
local tc=g:GetFirst()
while tc do
race=race|tc:GetRace()
tc=g:GetNext()
end
return race
end
function cm.gatt(g)
if not g then return false end
local att=0
local tc=g:GetFirst()
while tc do
att=att|tc:GetAttribute()
tc=g:GetNext()
end
return race
end
function cm.spfilter1(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter2(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter3(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and not c:IsRace(race) and not c:IsAttribute(att)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,Group.FromCards(c)) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end
function cm.thfilter3(c,e,tp,tc,tt)
local race=tc:GetRace()
local att=tc:GetAttribute()
return not c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsRace(race) and c:IsAttribute(att) and (tt==1 and c:IsAbleToRemove() or tt==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) or tt==3 and c:IsAbleToHand() or tt==4 and c:IsAbleToGrave() )
end
function cm.reop(e,tp,tc,tt,loc)
if Duel.IsPlayerAffectedByEffect(tp,12001500) and Duel.IsExistingMatchingCard(cm.thfilter3,tp,loc,0,1,nil,e,tp,tc,tt) and Duel.SelectYesNo(tp,aux.Stringid(12001500,1)) then
local g1=Duel.SelectMatchingCard(tp,cm.thfilter3,tp,loc,0,1,1,nil,e,tp,tc,tt)
tc=g1:GetFirst()
end
if tt==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif tt==2 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif tt==3 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
elseif tt==4 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,Group.FromCards(c))
if #g1>0 then
cm.reop(e,tp,g1:GetFirst(),1,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+c)
if #g2>0 then
cm.reop(e,tp,g2:GetFirst(),1,LOCATION_DECK)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectMatchingCard(tp,cm.spfilter3,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+g2+c)
if #g3>0 then
cm.reop(e,tp,g3:GetFirst(),2,LOCATION_DECK)
end
end
end
end
\ No newline at end of file
--天外之灾 浮游蛇
local m=12001502
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12001501,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.thfilter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.grace(g)
if not g then return false end
local race=0
local tc=g:GetFirst()
while tc do
race=race|tc:GetRace()
tc=g:GetNext()
end
return race
end
function cm.gatt(g)
if not g then return false end
local att=0
local tc=g:GetFirst()
while tc do
att=att|tc:GetAttribute()
tc=g:GetNext()
end
return race
end
function cm.spfilter1(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter2(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter3(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsRace(race) and not c:IsAttribute(att)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,Group.FromCards(c)) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thfilter3(c,e,tp,tc,tt)
local race=tc:GetRace()
local att=tc:GetAttribute()
return not c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsRace(race) and c:IsAttribute(att) and (tt==1 and c:IsAbleToRemove() or tt==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) or tt==3 and c:IsAbleToHand() or tt==4 and c:IsAbleToGrave() )
end
function cm.reop(e,tp,tc,tt,loc)
if Duel.IsPlayerAffectedByEffect(tp,12001500) and Duel.IsExistingMatchingCard(cm.thfilter3,tp,loc,0,1,nil,e,tp,tc,tt) and Duel.SelectYesNo(tp,aux.Stringid(12001500,1)) then
local g1=Duel.SelectMatchingCard(tp,cm.thfilter3,tp,loc,0,1,1,nil,e,tp,tc,tt)
tc=g1:GetFirst()
end
if tt==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif tt==2 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif tt==3 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
elseif tt==4 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,Group.FromCards(c))
if #g1>0 then
cm.reop(e,tp,g1:GetFirst(),1,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+c)
if #g2>0 then
cm.reop(e,tp,g2:GetFirst(),1,LOCATION_DECK)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g3=Duel.SelectMatchingCard(tp,cm.spfilter3,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+g2+c)
if #g3>0 then
cm.reop(e,tp,g3:GetFirst(),3,LOCATION_DECK)
end
end
end
end
end
\ No newline at end of file
--天外之灾 赤衣虿
local m=12001503
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12001501,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.thfilter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.grace(g)
if not g then return false end
local race=0
local tc=g:GetFirst()
while tc do
race=race|tc:GetRace()
tc=g:GetNext()
end
return race
end
function cm.gatt(g)
if not g then return false end
local att=0
local tc=g:GetFirst()
while tc do
att=att|tc:GetAttribute()
tc=g:GetNext()
end
return race
end
function cm.spfilter1(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter2(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter3(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and not c:IsRace(race) and not c:IsAttribute(att)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,Group.FromCards(c)) and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.thfilter3(c,e,tp,tc,tt)
local race=tc:GetRace()
local att=tc:GetAttribute()
return not c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsRace(race) and c:IsAttribute(att) and (tt==1 and c:IsAbleToRemove() or tt==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) or tt==3 and c:IsAbleToHand() or tt==4 and c:IsAbleToGrave() )
end
function cm.reop(e,tp,tc,tt,loc)
if Duel.IsPlayerAffectedByEffect(tp,12001500) and Duel.IsExistingMatchingCard(cm.thfilter3,tp,loc,0,1,nil,e,tp,tc,tt) and Duel.SelectYesNo(tp,aux.Stringid(12001500,1)) then
local g1=Duel.SelectMatchingCard(tp,cm.thfilter3,tp,loc,0,1,1,nil,e,tp,tc,tt)
tc=g1:GetFirst()
end
if tt==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif tt==2 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif tt==3 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
elseif tt==4 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,Group.FromCards(c))
if #g1>0 then
cm.reop(e,tp,g1:GetFirst(),1,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+c)
if #g2>0 then
cm.reop(e,tp,g2:GetFirst(),1,LOCATION_DECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(tp,cm.spfilter3,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+g2+c)
if #g3>0 then
cm.reop(e,tp,g3:GetFirst(),4,LOCATION_DECK)
end
end
end
end
\ No newline at end of file
--天外之灾 白丝蛭
local m=12001504
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12001501,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.thfilter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.grace(g)
if not g then return false end
local race=0
local tc=g:GetFirst()
while tc do
race=race|tc:GetRace()
tc=g:GetNext()
end
return race
end
function cm.gatt(g)
if not g then return false end
local att=0
local tc=g:GetFirst()
while tc do
att=att|tc:GetAttribute()
tc=g:GetNext()
end
return race
end
function cm.spfilter1(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter2(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter3(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and not c:IsRace(race) and not c:IsAttribute(att)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,Group.FromCards(c)) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_REMOVED)
end
function cm.thfilter3(c,e,tp,tc,tt)
local race=tc:GetRace()
local att=tc:GetAttribute()
return not c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsRace(race) and c:IsAttribute(att) and (tt==1 and c:IsAbleToRemove() or tt==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) or tt==3 and c:IsAbleToHand() or tt==4 and c:IsAbleToGrave() )
end
function cm.reop(e,tp,tc,tt,loc)
if Duel.IsPlayerAffectedByEffect(tp,12001500) and Duel.IsExistingMatchingCard(cm.thfilter3,tp,loc,0,1,nil,e,tp,tc,tt) and Duel.SelectYesNo(tp,aux.Stringid(12001500,1)) then
local g1=Duel.SelectMatchingCard(tp,cm.thfilter3,tp,loc,0,1,1,nil,e,tp,tc,tt)
tc=g1:GetFirst()
end
if tt==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif tt==2 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif tt==3 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
elseif tt==4 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,Group.FromCards(c))
if #g1>0 then
cm.reop(e,tp,g1:GetFirst(),1,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+c)
if #g2>0 then
cm.reop(e,tp,g2:GetFirst(),1,LOCATION_DECK)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectMatchingCard(tp,cm.spfilter3,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,g1+g2+c)
if #g3>0 then
cm.reop(e,tp,g3:GetFirst(),2,LOCATION_REMOVED)
end
end
end
end
\ No newline at end of file
--天灾少女 零
local m=12001508
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,68468459)
--special summon self
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.sspcon)
c:RegisterEffect(e1)
--special summon other monsters
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+100)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.sspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)<Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.spcost(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 cm.spfilter(c,e,tp)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(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,cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.thfilter(c)
return c:IsCode(12001500) and c:IsAbleToRemove()
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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--天外之灾龙 终结
local m=12001510
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.sprcon)
e1:SetTarget(cm.sprtg)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.sprfilter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToDeckAsCost() and c:IsType(TYPE_MONSTER)
end
function cm.fselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0 and g:GetClassCount(Card.GetAttribute)==#g and g:GetClassCount(Card.GetRace)==#g
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,nil)
return rg:CheckSubGroup(cm.fselect,3,3,tp)
end
function cm.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=rg:SelectSubGroup(tp,cm.fselect,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoDeck(g,nil,2,REASON_COST)
g:DeleteGroup()
end
function cm.filter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.filter,1,1,REASON_COST+REASON_DISCARD)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,4))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_CANNOT_DRAW)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
end
function cm.searchfilter(c)
return c:IsSetCard(0x6fb9) and c:IsAbleToHand() and c:IsFaceup()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.searchfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function cm.dfilter(c,att)
return c:IsAttribute(att) and c:IsFaceup()
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.searchfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local att=g:GetFirst():GetAttribute()
local mg=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_MZONE,nil,att)
if #mg>0 then
if Duel.Destroy(mg,REASON_EFFECT)==0 then Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT) end
else
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
end
end
end
\ No newline at end of file
--天外之灾龙 降临
local m=12001511
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.sprcon)
e1:SetTarget(cm.sprtg)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12001510,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.condition)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.sprfilter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToDeckAsCost() and c:IsType(TYPE_MONSTER)
end
function cm.fselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0 and g:GetClassCount(Card.GetAttribute)==#g and g:GetClassCount(Card.GetRace)==#g
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,nil)
return rg:CheckSubGroup(cm.fselect,3,3,tp)
end
function cm.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=rg:SelectSubGroup(tp,cm.fselect,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoDeck(g,nil,2,REASON_COST)
g:DeleteGroup()
end
function cm.filter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.filter,1,1,REASON_COST+REASON_DISCARD)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,4))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_CANNOT_DRAW)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.rfilter(c,att)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and c:IsAttribute(att)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local att=re:GetHandler():GetAttribute()
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_DECK,0,1,nil,att) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.thfilter3(c,e,tp,tc,tt)
local race=tc:GetRace()
local att=tc:GetAttribute()
return not c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsRace(race) and c:IsAttribute(att) and (tt==1 and c:IsAbleToRemove() or tt==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) or tt==3 and c:IsAbleToHand() or tt==4 and c:IsAbleToGrave() )
end
function cm.reop(e,tp,tc,tt,loc)
if Duel.IsPlayerAffectedByEffect(tp,12001500) and Duel.IsExistingMatchingCard(cm.thfilter3,tp,loc,0,1,nil,e,tp,tc,tt) and Duel.SelectYesNo(tp,aux.Stringid(12001500,1)) then
local g1=Duel.SelectMatchingCard(tp,cm.thfilter3,tp,loc,0,1,1,nil,e,tp,tc,tt)
tc=g1:GetFirst()
end
if tt==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif tt==2 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif tt==3 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
elseif tt==4 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local att=re:GetHandler():GetAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_DECK,0,1,1,nil,att)
if #g1>0 then
cm.reop(e,tp,g1:GetFirst(),1,LOCATION_DECK)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,att))
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
--天外之灾神 混沌的零形
local m=12001515
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x6fb9),3,true)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.sprcon)
e2:SetOperation(cm.sprop)
c:RegisterEffect(e2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.desreptg)
e2:SetValue(cm.desrepval)
e2:SetOperation(cm.desrepop)
c:RegisterEffect(e2)
end
function cm.sprfilter1(c,sc,tp)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL) and Duel.IsExistingMatchingCard(cm.sprfilter2,tp,LOCATION_MZONE,0,1,nil,tp,sc,c)
end
function cm.sprfilter2(c,tp,sc,tc)
return c:IsSetCard(0x6fb9) and c:IsLevel(11) and c:IsAbleToRemoveAsCost() and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL) and c:GetRace()~=tc:GetRace() and c:GetAttribute()~=tc:GetAttribute()
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.sprfilter1,tp,LOCATION_HAND,0,1,nil,c,tp)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.sprfilter1,tp,LOCATION_HAND,0,1,1,nil,c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.sprfilter2,tp,LOCATION_MZONE,0,1,1,nil,tp,c,g1:GetFirst())
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function cm.filter(c)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.filter,1,1,REASON_COST+REASON_DISCARD)
end
function cm.spfilter(c,e,tp)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.spop(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.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local att=g:GetFirst();GetAttribute()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,1)
e1:SetTarget(function()
return c:IsAttribute(att)
end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,2,nil) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.desrepval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_CARD,0,m)
end
--天灾蠢动
local m=12001520
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.IsPlayerCanRemove(tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.grace(g)
if not g then return false end
local race=0
local tc=g:GetFirst()
while tc do
race=race|tc:GetRace()
tc=g:GetNext()
end
return race
end
function cm.gatt(g)
if not g then return false end
local att=0
local tc=g:GetFirst()
while tc do
att=att|tc:GetAttribute()
tc=g:GetNext()
end
return race
end
function cm.spfilter1(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter3(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsRace(race) and not c:IsAttribute(att)
end
function cm.thfilter3(c,e,tp,tc,tt)
local race=tc:GetRace()
local att=tc:GetAttribute()
return not c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsRace(race) and c:IsAttribute(att) and (tt==1 and c:IsAbleToRemove() or tt==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) or tt==3 and c:IsAbleToHand() or tt==4 and c:IsAbleToGrave() )
end
function cm.reop(e,tp,tc,tt,loc)
if Duel.IsPlayerAffectedByEffect(tp,12001500) and Duel.IsExistingMatchingCard(cm.thfilter3,tp,loc,0,1,nil,e,tp,tc,tt) and Duel.SelectYesNo(tp,aux.Stringid(12001500,1)) then
local g1=Duel.SelectMatchingCard(tp,cm.thfilter3,tp,loc,0,1,1,nil,e,tp,tc,tt)
tc=g1:GetFirst()
end
if tt==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif tt==2 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif tt==3 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
elseif tt==4 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 or not Duel.IsPlayerCanRemove(tp) then return end
local g=Duel.GetDecktopGroup(tp,1)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 and g:GetFirst():IsType(TYPE_MONSTER) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,g)
if #g1>0 then
cm.reop(e,tp,g1:GetFirst(),1,LOCATION_DECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g3=Duel.SelectMatchingCard(tp,cm.spfilter3,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+g)
if #g3>0 then
cm.reop(e,tp,g3:GetFirst(),3,LOCATION_DECK)
end
end
end
end
\ No newline at end of file
--天灾接触
local m=12001521
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.grace(g)
if not g then return false end
local race=0
local tc=g:GetFirst()
while tc do
race=race|tc:GetRace()
tc=g:GetNext()
end
return race
end
function cm.gatt(g)
if not g then return false end
local att=0
local tc=g:GetFirst()
while tc do
att=att|tc:GetAttribute()
tc=g:GetNext()
end
return race
end
function cm.spfilter1(c,e,tp)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,Group.FromCards(c))
end
function cm.spfilter2(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsRace(race) and not c:IsAttribute(att) and Duel.IsExistingMatchingCard(cm.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,g+c)
end
function cm.spfilter3(c,e,tp,g)
local att=cm.gatt(g)
local race=cm.grace(g)
return c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsRace(race) and not c:IsAttribute(att)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thfilter3(c,e,tp,tc,tt)
local race=tc:GetRace()
local att=tc:GetAttribute()
return not c:IsSetCard(0x6fb9) and c:IsType(TYPE_MONSTER) and c:IsRace(race) and c:IsAttribute(att) and (tt==1 and c:IsAbleToRemove() or tt==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) or tt==3 and c:IsAbleToHand() or tt==4 and c:IsAbleToGrave() )
end
function cm.reop(e,tp,tc,tt,loc)
if Duel.IsPlayerAffectedByEffect(tp,12001500) and Duel.IsExistingMatchingCard(cm.thfilter3,tp,loc,0,1,nil,e,tp,tc,tt) and Duel.SelectYesNo(tp,aux.Stringid(12001500,1)) then
local g1=Duel.SelectMatchingCard(tp,cm.thfilter3,tp,loc,0,1,1,nil,e,tp,tc,tt)
tc=g1:GetFirst()
end
if tt==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
elseif tt==2 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
elseif tt==3 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
elseif tt==4 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g1>0 then
cm.reop(e,tp,g1:GetFirst(),1,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1)
if #g2>0 then
cm.reop(e,tp,g2:GetFirst(),1,LOCATION_DECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g3=Duel.SelectMatchingCard(tp,cm.spfilter3,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1+g2)
if #g3>0 then
cm.reop(e,tp,g3:GetFirst(),3,LOCATION_DECK)
end
end
end
end
\ No newline at end of file
--天灾融合
local m=12001522
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
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)
end
function cm.gcheck(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=1
end
function cm.filter0(c)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function cm.filter1(c,e)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function cm.gcheck(sg)
return sg:GetClassCount(Card.GetRace)==#sg and sg:GetClassCount(Card.GetAttribute)==#sg
end
function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_THUNDER+RACE_AQUA+RACE_ROCK+RACE_PYRO) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
Auxiliary.GCheckAdditional=cm.gcheck
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
Auxiliary.GCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
Auxiliary.GCheckAdditional=cm.gcheck
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
Auxiliary.GCheckAdditional=nil
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(mat,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
...@@ -56,12 +56,6 @@ function c12005012.matfilter(c) ...@@ -56,12 +56,6 @@ function c12005012.matfilter(c)
return c:IsSetCard(0xfb0) and c:IsReleasable() and c:IsFaceup() return c:IsSetCard(0xfb0) and c:IsReleasable() and c:IsFaceup()
end end
function c12005012.thop(e,tp,eg,ep,ev,re,r,rp) function c12005012.thop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetTargetRange(0,LOCATION_DECK)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......
...@@ -3,7 +3,7 @@ function c12013001.initial_effect(c) ...@@ -3,7 +3,7 @@ function c12013001.initial_effect(c)
--search --search
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12013001,0)) e1:SetDescription(aux.Stringid(12013001,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,12013001) e1:SetCountLimit(1,12013001)
...@@ -28,19 +28,20 @@ function c12013001.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,19 +28,20 @@ function c12013001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c12013001.filter(c)
return c:IsSetCard(0xfb6) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c12013001.target(e,tp,eg,ep,ev,re,r,rp,chk) function c12013001.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12013001.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c12013001.operation(e,tp,eg,ep,ev,re,r,rp) function c12013001.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local g=Duel.SelectMatchingCard(tp,c12013001.filter,tp,LOCATION_DECK,0,1,1,nil) local ct=Duel.Draw(p,d,REASON_EFFECT)
if g:GetCount()>0 then if ct~=0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.BreakEffect()
Duel.ConfirmCards(1-tp,g) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end end
end end
function c12013001.reccon(e,tp,eg,ep,ev,re,r,rp) function c12013001.reccon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -91,7 +91,7 @@ end ...@@ -91,7 +91,7 @@ end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp) function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,0,LOCATION_GRAVE,nil) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,0,LOCATION_GRAVE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end end
end end
function cm.retreg(e,tp,eg,ep,ev,re,r,rp) function cm.retreg(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -59,7 +59,7 @@ function cm.remop(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,7 +59,7 @@ function cm.remop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsAbleToHand() return c:IsAbleToHand() and c:IsSetCard(0x6fa6)
end end
function cm.rtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
......
...@@ -37,10 +37,20 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,10 +37,20 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.BreakEffect() local e1=Effect.CreateEffect(c)
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
end end
end end
unction cm.splimit(e,c)
return not c:IsAttackBelow(1500)
end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsCanTurnSet() return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsCanTurnSet()
end end
......
...@@ -40,7 +40,7 @@ function c12030008.initial_effect(c) ...@@ -40,7 +40,7 @@ function c12030008.initial_effect(c)
end end
function c12030008.condition(e,tp,eg,ep,ev,re,r,rp) function c12030008.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ( Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)<Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil) or Duel.GetTurnPlayer()==tp ) and re:GetHandler():GetLocation()==LOCATION_GRAVE return ( Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)<Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil) or Duel.GetTurnPlayer()==tp ) and re:GetHandler():GetLocation()==LOCATION_GRAVE and Duel.GetCurrentChain()>=3
end end
function c12030008.target(e,tp,eg,ep,ev,re,r,rp,chk) function c12030008.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -25,12 +25,12 @@ function c12037000.initial_effect(c) ...@@ -25,12 +25,12 @@ function c12037000.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_TO_HAND) e3:SetCode(EFFECT_CANNOT_DRAW)
e3:SetTargetRange(1,1) e3:SetTargetRange(1,1)
e3:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c12037000.con3) e3:SetCondition(c12037000.con3)
c:RegisterEffect(e3) c:RegisterEffect(e3)
-- --
end end
-- --
......
...@@ -39,6 +39,17 @@ function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,6 +39,17 @@ function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,63,c) local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,63,c)
g:AddCard(c) g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
local tc=g:GetFirst()
while tc do
if tc:IsLocation(LOCATION_GRAVE) and not tc:IsSetCard(0x1fb5) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
tc=g:GetNext()
end
end end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
--幻梦础 阿撒托斯
local m=12044073
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
c:EnableReviveLimit()
--summon/spsummon cost
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_COST)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
e0:SetCost(cm.spcost)
e0:SetOperation(cm.costop)
c:RegisterEffect(e0)
--target
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TODECK)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--special summon proc
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_DECK)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop)
e2:SetValue(1)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCondition(cm.actcon)
e4:SetOperation(cm.actop)
e4:SetLabelObject(e2)
c:RegisterEffect(e4)
--to hand
local e22=Effect.CreateEffect(c)
e22:SetDescription(aux.Stringid(m,2))
e22:SetCategory(CATEGORY_TODECK)
e22:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e22:SetProperty(EFFECT_FLAG_DELAY)
e22:SetCode(EVENT_SPSUMMON_SUCCESS)
e22:SetRange(LOCATION_MZONE)
e22:SetTarget(cm.tdtg)
e22:SetOperation(cm.tdop)
c:RegisterEffect(e22)
local e3=e22:Clone()
e3:SetCode(EVENT_FLIP)
c:RegisterEffect(e3)
end
function cm.spcost(e,c,tp)
return Duel.GetFlagEffect(tp,m)==0 or not c:IsLocation(LOCATION_DECK)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsLocation(LOCATION_DECK) then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.thfilter1(c)
return c:IsSetCard(0x8fb5) and c:IsFaceup()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK,0,11,nil)
end
function cm.rmfilter(c)
return c:IsFacedown() and c:IsAbleToRemove()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,LOCATION_DECK,0,nil)
if not g then return end
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,tp,2,REASON_EFFECT)
c:ReverseInDeck()
Duel.ShuffleDeck(tp)
end
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return c:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():CompleteProcedure()
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
return re==te
end
function cm.actfilter(c,tp)
return c:IsCode(12044075) and c:GetActivateEffect():IsActivatable(tp)
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SendtoDeck(c,2,nil,REASON_EFFECT)
local g=Duel.GetMatchingGroup(cm.actfilter,tp,LOCATION_DECK,0,nil,tp)
if g:GetCount()>0 then
tc=g:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function cm.filter(c)
return c:IsAbleToDeck()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if not g then return end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--虚妄之诺
local m=12044075
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,12044073)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.rstg)
e1:SetOperation(cm.rsop)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(cm.spcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.filter(c,e,tp)
return c:IsType(TYPE_RITUAL) and c:IsFaceup()
end
function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then
mg:Merge(m2)
end
if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp)
else
mg:RemoveCard(c)
end
local lv=level_function(c)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil
return res
end
function cm.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_DECK,0,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.RitualUltimateFilter,tp,LOCATION_DECK,0,1,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local tc=g:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,0))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_SINGLE_RANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCondition(cm.imcon)
e1:SetValue(cm.efilter)
tc:RegisterEffect(e1,true)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function cm.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function cm.imcon(e)
return not Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_DECK,0,1,nil)
end
function cm.cfilter(c)
return c:IsPreviousSetCard(0x8fb5) and c:IsLevelAbove(8) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
\ No newline at end of file
--两人一体 斯伊
local m=12047030
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--change name
aux.EnableChangeCode(c,12047000,LOCATION_MZONE+LOCATION_GRAVE)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.cfilter(c,tp)
return c:GetSummonPlayer()==1-tp
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function cm.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function cm.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x3fa8) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_GRAVE,0,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--伊斯&斯伊 ~Alone With You~
local m=12047031
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,12047000,12047000,true,true)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.negtg)
e1:SetOperation(cm.negop)
c:RegisterEffect(e1)
--to grave
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_TO_GRAVE)
e0:SetOperation(cm.regop)
c:RegisterEffect(e0)
--to hand/spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return c:IsSetCard(0x3fa8) and c:IsAbleToHand()
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return ep==1-tp and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=11 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local fid=e:GetHandler():GetFieldID()
if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)<11 then return end
local g=Duel.GetDecktopGroup(1-tp,11)
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local og=Duel.GetOperatedGroup()
e:GetLabelObject():Merge(og)
for tc in aux.Next(og) do
tc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,fid)
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabelObject(og)
e2:SetLabel(fid)
e2:SetCondition(cm.retcon)
e2:SetOperation(cm.retop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function cm.retfilter(c,fid)
return c:GetFlagEffectLabel(m)==fid
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(cm.retfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local sg=g:Filter(cm.retfilter,nil,e:GetLabel())
g:DeleteGroup()
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)>0
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(cm.disop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
Duel.Hint(HINT_CARD,0,m)
Duel.NegateEffect(ev)
end
\ No newline at end of file
...@@ -7,15 +7,6 @@ cm.named_with_IDA=true ...@@ -7,15 +7,6 @@ cm.named_with_IDA=true
function c12051021.initial_effect(c) function c12051021.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(c12051021.filter),4,4) aux.AddLinkProcedure(c,aux.FilterBoolFunction(c12051021.filter),4,4)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c12051021.imcon)
e3:SetValue(c12051021.efilter)
c:RegisterEffect(e3)
local e31=Effect.CreateEffect(c) local e31=Effect.CreateEffect(c)
e31:SetCategory(CATEGORY_SPECIAL_SUMMON) e31:SetCategory(CATEGORY_SPECIAL_SUMMON)
e31:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e31:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
...@@ -37,6 +28,16 @@ function c12051021.initial_effect(c) ...@@ -37,6 +28,16 @@ function c12051021.initial_effect(c)
e1:SetTarget(c12051021.destg) e1:SetTarget(c12051021.destg)
e1:SetOperation(c12051021.desop) e1:SetOperation(c12051021.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetCondition(c12051021.imcon)
e4:SetValue(c12051021.efilter)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
end end
function c12051021.imcon(e) function c12051021.imcon(e)
return e:GetHandler():GetSequence()>4 return e:GetHandler():GetSequence()>4
......
...@@ -8,6 +8,13 @@ function c12051023.initial_effect(c) ...@@ -8,6 +8,13 @@ function c12051023.initial_effect(c)
--link summon --link summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,c12051023.mfilter,1,1) aux.AddLinkProcedure(c,c12051023.mfilter,1,1)
--XYZ SUM
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.linklimit)
c:RegisterEffect(e0)
--search --search
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12051023,0)) e1:SetDescription(aux.Stringid(12051023,0))
......
...@@ -5,7 +5,7 @@ Duel.LoadScript("c12000000.lua") ...@@ -5,7 +5,7 @@ Duel.LoadScript("c12000000.lua")
function cm.initial_effect(c) function cm.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xafbc),aux.FilterBoolFunction(Card.IsFusionAttribute,ATTRIBUTE_DARK),false) aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xafbc),aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),false)
--special summon other monsters --special summon other monsters
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
......
...@@ -41,7 +41,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,7 +41,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return g:GetCount()>0 end if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if Duel.GetFlagEffect(tp,m)>9 then --[[if Duel.GetFlagEffect(tp,m)>9 then
local c=e:GetHandler() local c=e:GetHandler()
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
...@@ -51,7 +51,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,7 +51,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
e3:SetValue(cm.efilter) e3:SetValue(cm.efilter)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end]]--
end end
function cm.efilter(e,te) function cm.efilter(e,te)
return te:GetOwner()~=e:GetOwner() return te:GetOwner()~=e:GetOwner()
......
--同心协唱之歌 罗洛涅萝尔
local m=12087054
local cm=_G["c"..m]
Duel.LoadScript("c12000000.lua")
cm.named_with_RRNRU=true
function cm.initial_effect(c)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetOperation(cm.reop)
e2:SetCountLimit(1,m+100)
c:RegisterEffect(e2)
local e1=e2:Clone()
e1:SetCode(EVENT_FLIP)
c:RegisterEffect(e1)
--set
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(12087053,3))
e6:SetCategory(CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_PHASE+PHASE_END)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetTarget(cm.settg)
e6:SetOperation(cm.setop)
c:RegisterEffect(e6)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function cm.spfilter(c,e,tp)
return srre.check_set_RRNRU(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN)
if c:IsCanTurnSet() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_SZONE,0,1,nil) end
end
function cm.filter(c)
return srre.check_set_RRNRUS(c) and c:IsFacedown() and not c:IsForbidden()
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(12087050,1))
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_SZONE,0,1,1,nil):GetFirst()
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
tc:CancelToGrave(false)
tc:CreateEffectRelation(e)
if tc and srre.check_set_RRNRUS(tc) and tc.wteffect then
tc.wteffect(e,tp,eg,ep,ev,re,r,rp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(cm.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=c:IsCanTurnSet()
local b2=c:IsAbleToHand()
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local b1=c:IsCanTurnSet()
local b2=c:IsAbleToHand()
local op=3
if b1 and b2 then
if Duel.SelectYesNo(tp,aux.Stringid(12087050,5)) then op=0 else op=1 end
elseif b1 then op=1
elseif b2 then op=0
end
if op==0 then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
if op==1 then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--恶梦启示录 --恶梦启示录
if not pcall(function() require("expansions/script/c33301000") end) then require("script/c33301000") end
local m=33330400 local m=33330400
local cm=_G["c"..m] local cm=_G["c"..m]
if not rsv.Nightmare then function cm.initial_effect(c)
rsv.Nightmare={} local e1=Effect.CreateEffect(c)
rsnm=rsv.Nightmare e1:SetType(EFFECT_TYPE_ACTIVATE)
function rsnm.SummonFun(c,code,type2,isgrave,istograve) e1:SetCode(EVENT_FREE_CHAIN)
local e0=Effect.CreateEffect(c) c:RegisterEffect(e1)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e0)
if type2 then
local e1=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,rsnm.spcon2,rsnm.spop2)
local lab=not isgrave and LOCATION_ONFIELD or LOCATION_GRAVE
local val=not istograve and 0 or 1
e1:SetLabel(lab)
e1:SetValue(val)
return e1
end
local e1=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,rsnm.spcon,rsnm.spop)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,rsnm.counterfilter)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetDescription(aux.Stringid(m,0))
e2:SetCode(EFFECT_SPSUMMON_COST) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetRange(LOCATION_SZONE)
e2:SetCost(rsnm.limcost) e2:SetCode(EVENT_CHAINING)
e2:SetOperation(rsnm.limop) e2:SetCountLimit(1)
e2:SetCost(cm.cost)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=rsef.STO(c,EVENT_TO_GRAVE,{m,0},{1,code},"se,th","de,dsp",rsnm.thcon,nil,rsop.target(rsnm.thfilter,"th",LOCATION_DECK),rsnm.thop) local e3=Effect.CreateEffect(c)
return e1,e2,e3 e3:SetDescription(aux.Stringid(m,1))
end e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
function rsnm.counterfilter(c) e3:SetRange(LOCATION_SZONE)
if c:GetSummonLocation()&LOCATION_HAND+LOCATION_DECK ==0 then return true end e3:SetCode(EVENT_ATTACK_ANNOUNCE)
return c:IsSetCard(0x4552) e3:SetCondition(cm.poscon)
end e3:SetTarget(cm.postg)
function rsnm.spcfilter(c,tp) e3:SetOperation(cm.posop)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeckAsCost() and Duel.GetMZoneCount(tp,c,tp)>0 c:RegisterEffect(e3)
end end
function rsnm.spcon(e,c) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if c==nil then return true end e:SetLabel(100)
local tp=c:GetControler() return true
return Duel.IsExistingMatchingCard(rsnm.spcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp)
end
function rsnm.spop(e,tp)
rshint.Select(tp,"td")
local tg=Duel.SelectMatchingCard(tp,rsnm.spcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp)
Duel.SendtoDeck(tg,nil,2,REASON_COST)
end
function rsnm.spcfilter2(c,e)
local val=e:GetValue()
return c:IsSetCard(0x4552) and ((val==0 and c:IsAbleToDeckOrExtraAsCost()) or (val==1 and c:IsAbleToGraveAsCost()))
end
function rsnm.spcfilter3(g,tp,loc)
return Duel.GetMZoneCount(tp,g,tp)>0 and ((loc==LOCATION_ONFIELD and #g==1) or (loc==LOCATION_GRAVE and #g==2))
end
function rsnm.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(rsnm.spcfilter2,tp,LOCATION_HAND+e:GetLabel(),0,c,e)
return g:CheckSubGroup(rsnm.spcfilter3,1,2,tp,e:GetLabel())
end
function rsnm.cffilter(c)
return c:IsFacedown() or c:IsLocation(LOCATION_HAND)
end
function rsnm.spop2(e,tp)
local g=Duel.GetMatchingGroup(rsnm.spcfilter2,tp,LOCATION_HAND+e:GetLabel(),0,e:GetHandler(),e)
rshint.Select(tp,"td")
local tg=g:SelectSubGroup(tp,rsnm.spcfilter3,false,1,2,tp,e:GetLabel())
local cg=tg:Filter(rsnm.cffilter,nil)
if #cg>0 then
Duel.ConfirmCards(1-tp,cg)
end
if e:GetValue()==0 then
Duel.SendtoDeck(tg,nil,2,REASON_COST)
else
Duel.SendtoGrave(tg,REASON_COST)
end
end
function rsnm.limcost(e,c,tp)
return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0
end
function rsnm.limop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(rsnm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function rsnm.splimit(e,c)
if c:IsLocation(LOCATION_HAND+LOCATION_DECK) then return not c:IsSetCard(0x4552)
else return false
end
end
function rsnm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function rsnm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x4552)
end
function rsnm.thop(e,tp)
rshint.Select(tp,"th")
local tg=Duel.SelectMatchingCard(tp,rsnm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function rsnm.FilpFun(c,code,cate,con,tg,op,ctlimit)
local limit=ctlimit and {1,code} or nil
local e1=rsef.STO(c,EVENT_FLIP,{code,0},limit,cate,"de",con,nil,tg,op)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
if not c:IsStatus(STATUS_COPYING_EFFECT) then
local mt=getmetatable(c)
mt.flip_effect=e1
end
return e1
end
function rsnm.FilpFun2(c,code,cate,con,tg,op)
local e1=rsef.STO(c,EVENT_FLIP,{code,0},nil,cate,"de,dsp",con,nil,tg,op)
if not c:IsStatus(STATUS_COPYING_EFFECT) then
local mt=getmetatable(c)
mt.flip_effect=e1
end
local e2=rsef.RegisterClone(c,e1,"code",EVENT_SPSUMMON_SUCCESS)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
return e1,e2
end
--------------
end
--------------
if cm then
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsef.QO(c,EVENT_CHAINING,{m,0},1,nil,nil,LOCATION_SZONE,cm.con,rscost.reglabel(100),cm.tg,cm.op)
local e3=rsef.FTO(c,EVENT_ATTACK_ANNOUNCE,{m,1},nil,"pos",nil,LOCATION_SZONE,cm.poscon,nil,rsop.target(cm.posfilter,"pos",LOCATION_MZONE,0,true),cm.posop)
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp return rp~=tp
...@@ -148,7 +40,7 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -148,7 +40,7 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil,e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end end
e:SetLabel(0) e:SetLabel(0)
rshint.Select(tp,"pos") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tc=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst() local tc=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true) Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true)
e:SetLabelObject(tc) e:SetLabelObject(tc)
...@@ -157,9 +49,14 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -157,9 +49,14 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=aux.ExceptThisCard(e) local c=aux.ExceptThisCard(e)
if not c then return end if not c then return end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if not tc:IsSetCard(0x4552) then return end if not tc:IsSetCard(0x6552) then return end
local e1=rsef.SV_IMMUNE_EFFECT(c,cm.val,nil,rsreset.est_pend) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_SZONE)
e1:SetValue(cm.val)
e1:SetOwnerPlayer(tp) e1:SetOwnerPlayer(tp)
c:RegisterEffect(e1,true)
local te=tc.flip_effect local te=tc.flip_effect
if not te then return end if not te then return end
local tg=te:GetTarget() local tg=te:GetTarget()
...@@ -175,7 +72,12 @@ function cm.poscon(e,tp,eg,ep,ev,re,r,rp) ...@@ -175,7 +72,12 @@ function cm.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) return Duel.GetAttacker():IsControler(1-tp)
end end
function cm.posfilter(c) function cm.posfilter(c)
return c:IsFaceup() and c:IsSetCard(0x4552) return c:IsFaceup() and c:IsSetCard(0x6552)
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,eg,ep,ev,re,r,rp)
end
end end
function cm.posop(e,tp) function cm.posop(e,tp)
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_MZONE,0,nil)
...@@ -183,7 +85,7 @@ function cm.posop(e,tp) ...@@ -183,7 +85,7 @@ function cm.posop(e,tp)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
local sg=Duel.GetMatchingGroup(cm.sfilter,tp,LOCATION_MZONE,0,nil) local sg=Duel.GetMatchingGroup(cm.sfilter,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(sg) Duel.ShuffleSetCard(sg)
rshint.Select(1-tp,HINTMSG_OPPO) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_OPPO)
local ac=Duel.SelectMatchingCard(1-tp,nil,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() local ac=Duel.SelectMatchingCard(1-tp,nil,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
Duel.ChangeAttackTarget(ac) Duel.ChangeAttackTarget(ac)
end end
...@@ -191,5 +93,3 @@ end ...@@ -191,5 +93,3 @@ end
function cm.sfilter(c) function cm.sfilter(c)
return c:IsFacedown() and c:GetSequence()<5 return c:IsFacedown() and c:GetSequence()<5
end end
--------------
end
--恶梦启示 偏见 --恶梦启示 偏见
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330401 local m=33330401
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m)
local e4=rsnm.FilpFun(c,m,"atk",cm.con,nil,cm.op) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.tg)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end end
function cm.con(e,tp) function cm.spcfilter(c,tp)
return Duel.IsExistingMatchingCard(cm.getcount,tp,0,LOCATION_MZONE,1,nil,true) return c:IsFaceup() and c:GetSequence()<5
end end
function cm.op(e,tp) function cm.spcon(e,tp)
local g=Duel.GetMatchingGroup(cm.getcount,tp,0,LOCATION_MZONE,nil) local c=e:GetHandler()
if #g<=0 then return end local tp=c:GetControler()
for tc in aux.Next(g) do return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
local atk=cm.getcount(tc) end
local e1=rsef.SV_SET({e:GetHandler(),tc},"atkf",atk*200,nil,rsreset.est) function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end end
end end
function cm.getcount(c,isreturn) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local ct=0 return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
if c:IsLevelAbove(1) then ct=c:GetLevel() end
elseif c:IsRankAbove(1) then ct=c:GetRank() function cm.thfilter(c)
elseif c:IsLinkAbove(1) then ct=c:GetLink() return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.op(e,tp)
local race=Duel.AnnounceRace(tp,1,0x1ffffff)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(race)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(Duel.GetTurnCount())
e2:SetCondition(cm.spcone)
e2:SetOperation(cm.spope)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.spfiltere(c,e,tp)
return c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function cm.spcone(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfiltere,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.spope(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfiltere),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end end
if isreturn then return ct>0 end
return ct
end end
\ No newline at end of file
--恶梦启示 虚伪 --恶梦启示 虚伪
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330402 local m=33330402
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,"eq",nil,rsop.target({cm.eqfilter,"eq",0,LOCATION_MZONE },{cm.cfilter,nil,LOCATION_MZONE }),cm.op) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.tg)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end
function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler()
local tp=c:GetControler()
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x4552) and not c:IsStatus(STATUS_BATTLE_DESTROYED) return c:IsFaceup() and c:IsSetCard(0x6552) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end end
function cm.eqfilter(c,e,tp) function cm.eqfilter(c,e,tp)
return c:IsFaceup() and c:IsAbleToChangeControler() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 return c:IsFaceup() and c:IsAbleToChangeControler() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.eqfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,0)
end
function cm.op(e,tp) function cm.op(e,tp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
if #g<=0 then return end if #g<=0 then return end
rsof.SelectHint(tp,"eq") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tg=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp) local tg=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
if #tg<=0 then return end if #tg<=0 then return end
rsof.SelectHint(tp,HINTMSG_SELF) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local tg2=g:Select(tp,1,1,nil) local tg2=g:Select(tp,1,1,nil)
Duel.HintSelection(tg) Duel.HintSelection(tg)
Duel.HintSelection(tg2) Duel.HintSelection(tg2)
local tc=tg:GetFirst() local tc=tg:GetFirst()
local tc2=tg2:GetFirst() local tc2=tg2:GetFirst()
if not rsop.eqop(e,tc,tc2) then return end if not Duel.Equip(tp,tc,tc2) then return end
--equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(tc2)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
--update atk
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP) e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
...@@ -34,3 +115,6 @@ function cm.op(e,tp) ...@@ -34,3 +115,6 @@ function cm.op(e,tp)
e1:SetValue(tc:GetTextAttack()) e1:SetValue(tc:GetTextAttack())
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
function cm.eqlimit(e,c)
return c==e:GetLabelObject()
end
\ No newline at end of file
--恶梦启示 怀疑 --恶梦启示 怀疑
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330403 local m=33330403
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,"rm",cm.con,nil,cm.op) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.con)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end
function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler()
local tp=c:GetControler()
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end end
function cm.con(e,tp) function cm.con(e,tp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
...@@ -15,15 +82,14 @@ function cm.op(e,tp) ...@@ -15,15 +82,14 @@ function cm.op(e,tp)
local opt=Duel.AnnounceType(tp) local opt=Duel.AnnounceType(tp)
Duel.ConfirmDecktop(1-tp,1) Duel.ConfirmDecktop(1-tp,1)
if (opt==0 and tc:IsType(TYPE_MONSTER)) or (opt==1 and tc:IsType(TYPE_SPELL)) or (opt==2 and tc:IsType(TYPE_TRAP)) then if (opt==0 and tc:IsType(TYPE_MONSTER)) or (opt==1 and tc:IsType(TYPE_SPELL)) or (opt==2 and tc:IsType(TYPE_TRAP)) then
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND) local hg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if #hg<=0 then return end if #hg<=0 then return end
Duel.ConfirmCards(tp,hg) Duel.ConfirmCards(tp,hg)
if hg:IsExists(cm.rmfilter,1,nil,opt) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if hg:IsExists(cm.rmfilter,1,nil,opt) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
rsof.SelectHint(tp,"rm") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=hg:FilterSelect(tp,cm.rmfilter,1,2,nil,opt) local rg=hg:FilterSelect(tp,cm.rmfilter,1,1,nil,opt)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end end
Duel.ShuffleHand(1-tp)
end end
end end
function cm.rmfilter(c,opt) function cm.rmfilter(c,opt)
......
--恶梦启示 抑郁 --恶梦启示 抑郁
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330404 local m=33330404
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,"sp",nil,rsop.target(cm.spfilter,"sp",LOCATION_HAND+LOCATION_GRAVE ),cm.op,true) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end
function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler()
local tp=c:GetControler()
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsSetCard(0x6552) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return c:IsFaceup() and not c:IsDisabled()
end end
function cm.op(e,tp) function cm.op(e,tp)
rshint.Select(tp,"sp") local c = e:GetHandler()
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if #sg>0 then if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP) local tc=sg:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
tc:RegisterEffect(e2)
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)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
tc:RegisterEffect(e2)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4))
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabelObject(tc)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
Duel.RegisterEffect(e2,tp)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)>0 then
return true
else
e:Reset()
return false
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if tc:IsAttack(0) then
e:Reset()
return
end
Duel.Hint(HINT_CARD,0,m)
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then
Duel.Destroy(tc,REASON_EFFECT)
e:Reset()
end end
end end
\ No newline at end of file
--恶梦启示 绝望 --恶梦启示 绝望
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330405 local m=33330405
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,"pos,dr",cm.con,nil,cm.op,true) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_POSITION+CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.con)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end
function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler()
local tp=c:GetControler()
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end end
function cm.con(e,tp) function cm.con(e,tp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
...@@ -27,7 +94,7 @@ function cm.op(e,tp) ...@@ -27,7 +94,7 @@ function cm.op(e,tp)
if #tg>0 then if #tg>0 then
local ft=Duel.GetLocationCount(i,LOCATION_SZONE) local ft=Duel.GetLocationCount(i,LOCATION_SZONE)
local ct=math.min(#tg,ft) local ct=math.min(#tg,ft)
rsof.SelectHint(i,{m,1}) Duel.Hint(HINT_SELECTMSG,i,aux.Stringid(m,1))
local sg=tg:Select(i,ct,ct,nil) local sg=tg:Select(i,ct,ct,nil)
Duel.HintSelection(sg) Duel.HintSelection(sg)
for tc in aux.Next(sg) do for tc in aux.Next(sg) do
...@@ -44,24 +111,7 @@ function cm.op(e,tp) ...@@ -44,24 +111,7 @@ function cm.op(e,tp)
end end
tg=Duel.GetMatchingGroup(Card.IsFaceup,i,LOCATION_MZONE,0,nil) tg=Duel.GetMatchingGroup(Card.IsFaceup,i,LOCATION_MZONE,0,nil)
if #tg>0 then if #tg>0 then
--Duel.SendtoDeck(tg,nil,2,REASON_EFFECT) Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
Duel.Remove(tg,POS_FACEUP,REASON_RULE)
end end
end end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCondition(cm.flipcon)
e1:SetOperation(cm.flipop)
Duel.RegisterEffect(e1,tp)
end
function cm.flipcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,1,nil)
end
function cm.flipop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_MZONE,nil)
local ct=Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
Duel.Draw(1-tp,ct,REASON_EFFECT)
end end
\ No newline at end of file
--恶梦启示 孤独 --恶梦启示 孤独
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330406 local m=33330406
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,nil,nil,nil,cm.op,true) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.tg)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end
function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler()
local tp=c:GetControler()
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.spfiltere(c,e,tp)
return c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfiltere,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsFacedown() or not c:IsCode(m) return c:IsFaceup() and not c:IsCode(m)
end end
function cm.op(e,tp) function cm.op(e,tp)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct==0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
ct=1
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfiltere),tp,LOCATION_DECK,0,1,ct,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sg)
end
if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end
local turnp=Duel.GetTurnPlayer() Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(m,3))
Duel.SkipPhase(turnp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1) local rg = Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_MZONE,0,1,1,nil)
Duel.SkipPhase(turnp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1) local g = Duel.GetMatchingGroup(Card.IsAbleToGrave,1-tp,LOCATION_MZONE,0,rg)
Duel.SkipPhase(turnp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1) Duel.SendtoGrave(g,REASON_RULE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,turnp)
end end
--恶梦启示 卑劣 --恶梦启示 卑劣
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330407 local m=33330407
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,"atk",nil,rsop.target(cm.cfilter,nil,0,LOCATION_MZONE),cm.op) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.tg)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end
function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler()
local tp=c:GetControler()
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsFaceup() and c:IsAttackAbove(1) return c:IsFaceup() and c:IsAttackAbove(1)
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,g:GetCount(),0,0)
end
function cm.op(e,tp) function cm.op(e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local rg = Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if rg:GetCount()>0 then
local rc=rg:GetFirst()
local atk=rc:GetAttack()
local c=e:GetHandler() local c=e:GetHandler()
rsof.SelectHint(tp,HINTMSG_OPPO) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tg=Duel.SelectMatchingCard(tp,cm.cfilter,tp,0,LOCATION_MZONE,1,1,nil)
if #tg<=0 then return end
Duel.HintSelection(tg)
local atk=tg:GetFirst():GetAttack()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do for tc in aux.Next(g) do
local e1=rsef.SV_UPDATE({c,tc},"atk",-atk,nil,rsreset.est_pend,"cd") local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end end
end end
\ No newline at end of file
--恶梦启示 诋毁 --恶梦启示 诋毁
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330408 local m=33330408
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,"rm",nil,rsop.target(cm.rmfilter,"rm",0,LOCATION_GRAVE+LOCATION_EXTRA),cm.op,true) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.tg)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end
function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler()
local tp=c:GetControler()
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.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 cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end end
function cm.rmfilter(c) function cm.rmfilter(c)
return c:IsFaceup() and c:IsAbleToRemove() return c:IsFaceup() and c:IsAbleToRemove() and c:IsType(TYPE_MONSTER)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end end
function cm.op(e,tp) function cm.op(e,tp)
rsof.SelectHint(tp,"rm") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.rmfilter),tp,0,LOCATION_GRAVE+LOCATION_EXTRA,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.rmfilter),tp,0,LOCATION_GRAVE+LOCATION_EXTRA,1,1,nil):GetFirst()
if not tc or Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)<=0 or not tc:IsLocation(LOCATION_REMOVED) then return end if not tc or Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)<=0 or not tc:IsLocation(LOCATION_REMOVED) then return end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_ACTIVATING) e1:SetCode(EVENT_CHAIN_ACTIVATING)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetReset(rsreset.pend,2) e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCondition(cm.chcon) e1:SetCondition(cm.chcon)
e1:SetOperation(cm.chop) e1:SetOperation(cm.chop)
e1:SetLabelObject(tc) e1:SetLabelObject(tc)
......
--恶梦启示 衰弱 --恶梦启示 衰弱
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330409 local m=33330409
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1,e2,e3=rsnm.SummonFun(c,m) local e1=Effect.CreateEffect(c)
local e4=rsnm.FilpFun(c,m,"dis",nil,rsop.target(aux.disfilter1,"dis",LOCATION_ONFIELD,LOCATION_ONFIELD),cm.op) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_FLIP)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.tg)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
local mt=getmetatable(c)
mt.flip_effect=e4
end end
function cm.op(e,tp) function cm.spcfilter(c,tp)
return c:IsFaceup() and c:GetSequence()<5
end
function cm.spcon(e,tp)
local c=e:GetHandler() local c=e:GetHandler()
rsof.SelectHint(tp,"dis") local tp=c:GetControler()
local tc=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil):GetFirst() return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp)
if not tc then return end end
Duel.HintSelection(rsgf.Mix2(tc)) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.NegateRelatedChain(tc,RESET_TURN_SET) if chk == 0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
local e1,e2=rsef.SV_LIMIT({c,tc},"dis,dise",nil,nil,rsreset.est) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552)
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.check(c)
return c:IsFaceup() and c:IsAbleToGrave()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.check,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g = Duel.GetMatchingGroup(cm.check,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0)
end
function cm.op(e,tp)
local g=Duel.GetMatchingGroup(cm.check,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local dice=Duel.TossDice(tp,1)
local tg=g:RandomSelect(tp,dice)
Duel.SendtoGrave(tg,REASON_EFFECT)
end end
\ No newline at end of file
--恶梦启示 怨恨 --恶梦启示 怨恨
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330410 local m=33330410
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--aux.AddLinkProcedure(c,cm.lfilter,2) --aux.AddLinkProcedure(c,cm.lfilter,2)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),2,2,cm.lcheck) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),2,2,cm.lcheck)
local e1=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,0},{1,m},nil,"de,dsp",nil,nil,rsop.target(cm.tfilter,nil,LOCATION_GRAVE+LOCATION_REMOVED,0,2),cm.op) local e1=Effect.CreateEffect(c)
local e2=rsef.QO(c,nil,{m,1},{1,m+100},"se,th",nil,LOCATION_MZONE,nil,rscost.cost(cm.cfilter,{"pos",cm.fun},LOCATION_MZONE),rsop.target(cm.thfilter,"th",LOCATION_DECK),cm.thop) e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+100)
e2:SetCondition(cm.dcheck)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--cannot be target/indestructable --cannot be target/indestructable
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
...@@ -30,21 +51,34 @@ end ...@@ -30,21 +51,34 @@ end
function cm.lcheck(g,lc) function cm.lcheck(g,lc)
return g:IsExists(Card.IsSetCard,1,nil,0x6552) return g:IsExists(Card.IsSetCard,1,nil,0x6552)
end end
function cm.tfilter(c,e,tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>1 and c:IsRace(RACE_FIEND) and c:IsFaceup()
end
function cm.indcon(e) function cm.indcon(e)
return e:GetHandler():GetLinkedGroupCount()>0 return e:GetHandler():GetLinkedGroupCount()>0
end end
function cm.op(e,tp) function cm.tfilter(g,tp)
local g1=g:Filter(Card.IsControler,nil,tp)
local g2=g:Filter(Card.IsControler,nil,1-tp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>=g1:GetCount() and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>=g2:GetCount()
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER)
end
function cm.tfcheck(c)
return c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local dg=eg:Filter(cm.tfcheck,nil,TYPE_MONSTER)
if chk==0 then return dg:CheckSubGroup(cm.tfilter,1,2,tp) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,rg,1,0,0)
end
function cm.op(e,tp,eg)
local c=e:GetHandler() local c=e:GetHandler()
rsof.SelectHint(tp,HINTMSG_SELF) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,nil) local dg=eg:Filter(cm.tfcheck,nil,TYPE_MONSTER)
local tg=dg:SelectSubGroup(tp,cm.tfilter,false,1,2,tp)
if #tg<=0 then return end if #tg<=0 then return end
Duel.HintSelection(tg) Duel.HintSelection(tg)
for tc in aux.Next(tg) do for tc in aux.Next(tg) do
if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then if Duel.MoveToField(tc,tp,tc:GetControler(),LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -52,26 +86,57 @@ function cm.op(e,tp) ...@@ -52,26 +86,57 @@ function cm.op(e,tp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS) e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e2:SetValue(m)
tc:RegisterEffect(e2,true)
end end
end end
end end
function cm.cfilter(c) function cm.dcheck(e,tp)
return (c:IsFacedown() and c:IsCanChangePosition()) or (c:IsFaceup() and c:IsCanTurnSet()) local lg=e:GetHandler():GetLinkedGroup()
return lg:IsExists(cm.cfilter,1,nil)
end end
function cm.fun(g,e,tp) function cm.cfilter(c)
local tc=g:GetFirst() return ((c:IsFacedown() or c:IsPosition(POS_FACEUP_ATTACK)) and c:IsCanChangePosition()) or (c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanTurnSet())
if tc:IsFaceup() then Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x6552) return c:IsAbleToHand() and c:IsSetCard(0x6552)
end 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) function cm.thop(e,tp)
--rsof.SelectHint(tp,"th") local lg=e:GetHandler():GetLinkedGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tg=lg:FilterSelect(tp,cm.cfilter,1,1,nil)
if tg:GetCount()==0 then return end
local tc=tg:GetFirst()
local prepos=tc:GetPosition()
if tc:IsFaceup() then
if tc:IsPosition(POS_FACEUP_ATTACK) then
if c:IsCanTurnSet() then
Duel.SelectPosition(tp,tc,POS_FACEUP_DEFENSE|POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
end
else
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
else
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
end
local pos=tc:GetPosition()
if pos~=prepos then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg) Duel.ConfirmCards(1-tp,tg)
end end
end
end end
\ No newline at end of file
--恶梦启示 急躁 --恶梦启示 急躁
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330411 local m=33330411
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1=rsnm.SummonFun(c,m,true,false,true) local e1=Effect.CreateEffect(c)
local e2,e3=rsnm.FilpFun2(c,m,"atk",nil,rsop.target2(cm.fun,{cm.posfilter,"pos",LOCATION_MZONE }),cm.op) e1:SetType(EFFECT_TYPE_FIELD)
local e4=rsef.QO(c,nil,{m,1},{1,m},"sp",nil,LOCATION_MZONE,nil,cm.cost,rsop.target(cm.spfilter,"sp",LOCATION_HAND+LOCATION_GRAVE),cm.spop) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.spcon2)
e1:SetOperation(cm.spop2)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m)
e2:SetCost(cm.cost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
end end
function cm.fun(g,e,tp) function cm.spcfilter2(c)
Duel.SetChainLimit(cm.chlimit) return c:IsSetCard(0x6552) and c:IsAbleToGraveAsCost()
end end
function cm.chlimit(e,ep,tp) function cm.spcfilter3(g,tp)
return tp==ep return Duel.GetMZoneCount(tp,g,tp)>0
end end
function cm.posfilter(c) function cm.spcon2(e,c)
return c:IsDefensePos() and c:IsCanChangePosition() if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.spcfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
return g:CheckSubGroup(cm.spcfilter3,1,1,tp)
end end
function cm.cfilter(c) function cm.cffilter(c)
return c:IsType(TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsFaceup() return c:IsFacedown() or c:IsLocation(LOCATION_HAND)
end end
function cm.op(e,tp) function cm.spop2(e,tp)
rshint.Select(tp,"pos") local g=Duel.GetMatchingGroup(cm.spcfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler())
local tc=Duel.SelectMatchingCard(tp,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if not tc then return end local tg=g:SelectSubGroup(tp,cm.spcfilter3,false,1,1,tp)
Duel.HintSelection(rsgf.Mix2(tc)) local cg=tg:Filter(cm.cffilter,nil)
if Duel.ChangePosition(tc,POS_FACEUP_ATTACK)<=0 then return end if #cg>0 then
local ct=Duel.GetMatchingGroupCount(cm.cfilter,tp,LOCATION_ONFIELD,0,nil) Duel.ConfirmCards(1-tp,cg)
if ct<=0 or not Duel.SelectYesNo(tp,aux.Stringid(m,2)) then return end end
Duel.BreakEffect() Duel.SendtoGrave(tg,nil,2,REASON_COST)
local e1=rsef.SV_UPDATE({e:GetHandler(),tc},"atk",ct*500,nil,rsreset.est,"cd") end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttackTarget()
if chk==0 then return tc and tc:IsAttackAbove(1) end
e:SetLabelObject(tc)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=e:GetLabelObject()
if Duel.NegateAttack() and bc and bc:IsRelateToBattle() and bc:IsFaceup() and bc:IsAttackAbove(1) then
local fid=e:GetHandler():GetFieldID()
bc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(bc)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
Duel.RegisterEffect(e1,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(0)
bc:RegisterEffect(e1)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
e3:SetLabelObject(e2)
e3:SetOperation(cm.op2)
c:RegisterEffect(e3)
end end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():Reset()
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
function cm.resfilter(c,e,tp) function cm.resfilter(c,e,tp)
return c:IsReleasable() and c:IsFaceup() and Duel.GetMZoneCount(tp,c,tp)>0 return c:IsReleasable() and c:IsFaceup() and Duel.GetMZoneCount(tp,c,tp)>0
end end
...@@ -41,9 +137,13 @@ end ...@@ -41,9 +137,13 @@ end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsSetCard(0x6552) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) return c:IsSetCard(0x6552) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp) function cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
rshint.Select(tp,"sp") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
......
--恶梦启示 虚荣 --恶梦启示 虚荣
if not pcall(function() require("expansions/script/c33330400") end) then require("script/c33330400") end
local m=33330412 local m=33330412
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
local e1=rsnm.SummonFun(c,m,true,true) --send to gy
local e2,e3=rsnm.FilpFun2(c,m,"atk",nil,rsop.target(Card.IsCanTurnSet,"pos",LOCATION_MZONE),cm.op) local e1=Effect.CreateEffect(c)
local e4=rsef.STO(c,EVENT_TO_GRAVE,{m,1},{1,m},"sp","de,dsp",nil,nil,rsop.target(cm.spfilter,"sp",LOCATION_DECK),cm.spop) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+100)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end end
function cm.op(e,tp) function cm.check(c)
return c:IsFaceup() and c:IsSetCard(0x6552)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.check,tp,LOCATION_MZONE,0,1,nil)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
rshint.Select(tp,"pos") if chk==0 then return c:IsAbleToGrave() end
local tc=Duel.SelectMatchingCard(tp,Card.IsCanTurnSet,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,tp,0)
if not tc or Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)<=0 then return end end
local e1=rsef.FV_CANNOT_BE_TARGET({c,tp},"effect",aux.tgoval,aux.TargetBoolFunction(Card.IsFacedown),{LOCATION_MZONE,0},nil,rsreset.pend) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
if c:IsLocation(LOCATION_GRAVE) then
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(Duel.GetTurnCount()+1)
e2:SetLabelObject(c)
e2:SetReset(RESET_PHASE+PHASE_END,1)
e2:SetCondition(cm.rmcon)
e2:SetOperation(cm.rmop)
Duel.RegisterEffect(e2,tp)
end
end
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(m)~=0 then
return tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
else
e:Reset()
return false
end
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.SpecialSummon(e:GetLabelObject(),0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsSetCard(0x6552) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and not c:IsCode(m) return c:IsSetCard(0x6552) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and not c:IsCode(m)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp) function cm.spop(e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
rshint.Select(tp,"sp") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
......
--咒念树 --咒念树
if not pcall(function() require("expansions/script/c33301000") end) then require("script/c33301000") end
local m=33330413 local m=33330413
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),aux.FilterBoolFunction(Card.IsRace,RACE_PLANT),true) aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_FIEND),aux.FilterBoolFunction(Card.IsRace,RACE_PLANT),true)
rscf.SetSpecialSummonProduce(c,LOCATION_EXTRA,cm.con,cm.op)
local e1=rsef.QO(c,nil,{m,0},{1,m},"sp",nil,LOCATION_MZONE,nil,rscost.cost(cm.cfilter,"res",LOCATION_ONFIELD),rsop.target(cm.spfilter,"sp",LOCATION_GRAVE),cm.spop) local e0=Effect.CreateEffect(c)
local e2=rsef.SV_IMMUNE_EFFECT(c,rsval.imes,rscon.excard(Card.IsFacedown)) e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(cm.con)
e0:SetOperation(cm.op)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.imcon)
e2:SetValue(cm.imval)
c:RegisterEffect(e2)
end end
function cm.con(e,c) function cm.con(e,c)
if c==nil then return true end if c==nil then return true end
...@@ -15,16 +41,25 @@ function cm.con(e,c) ...@@ -15,16 +41,25 @@ function cm.con(e,c)
return Duel.IsExistingMatchingCard(cm.resfilter,tp,LOCATION_SZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.resfilter,tp,LOCATION_SZONE,0,1,nil)
end end
function cm.resfilter(c) function cm.resfilter(c)
return c:GetOriginalType()&TYPE_MONSTER ~=0 and c:IsReleasable() and c:IsType(TYPE_TRAP) return c:GetOriginalType()&TYPE_MONSTER ~=0 and c:IsReleasable()
end end
function cm.op(e,tp) function cm.op(e,tp)
rshint.Select(tp,"res") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.resfilter,tp,LOCATION_SZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.resfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function cm.cfilter(c,e,tp) function cm.cfilter(c,e,tp)
return c:IsReleasable() and Duel.GetMZoneCount(tp,c,tp)>0 return c:IsReleasable() and Duel.GetMZoneCount(tp,c,tp)>0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil,e,tp) end
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp)
Duel.Release(g,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) return c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end end
...@@ -38,7 +73,7 @@ function cm.spop(e,tp) ...@@ -38,7 +73,7 @@ function cm.spop(e,tp)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
rshint.Select(tp,"sp") Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
...@@ -47,3 +82,11 @@ end ...@@ -47,3 +82,11 @@ end
function cm.splimit(e,c) function cm.splimit(e,c)
return not c:IsRace(RACE_FIEND) return not c:IsRace(RACE_FIEND)
end end
function cm.imcon(e)
local c=e:GetHandler()
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,c)
end
function cm.imval(e,re)
return re:GetHandler()~=e:GetHandler()
end
\ No newline at end of file
Hata_no_Kokoro={} or Hata_no_Kokoro
Hnk = Hata_no_Kokoro
function Hata_no_Kokoro.eff2(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(Hata_no_Kokoro.recon)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetTarget(Hata_no_Kokoro.indestg)
c:RegisterEffect(e2)
end
function Hata_no_Kokoro.recon(e)
return e:GetHandler():IsFaceup()
end
function Hata_no_Kokoro.indestg(e,c,rp,r,re)
return c:IsFaceup() and c:IsType(TYPE_EQUIP) and c:IsLocation(LOCATION_SZONE) and c:GetEquipTarget()==e:GetHandler()
end
function Hata_no_Kokoro.eff3(c,id,loc)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_DESTROY)
e1:SetRange(LOCATION_REMOVED)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(Hata_no_Kokoro.spcon)
e1:SetTarget(Hata_no_Kokoro.sptg)
e1:SetOperation(Hata_no_Kokoro.spop(loc))
c:RegisterEffect(e1)
end
function Hata_no_Kokoro.defilter(c,tp)
return c:IsType(TYPE_EQUIP) and c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp)
end
function Hata_no_Kokoro.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Hata_no_Kokoro.defilter,1,nil,tp)
end
function Hata_no_Kokoro.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_REMOVED)
end
function Hata_no_Kokoro.eqfilter(c,tc,tp)
if not c:IsType(TYPE_EQUIP) then return end
return c:CheckEquipTarget(tc) and c:CheckUniqueOnField(tp,LOCATION_SZONE) and not c:IsForbidden()
end
function Hata_no_Kokoro.spop(loc)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
if Duel.IsExistingMatchingCard(Hata_no_Kokoro.eqfilter,tp,loc,0,1,nil,c,tp) then
local g=Duel.SelectMatchingCard(tp,Hata_no_Kokoro.eqfilter,tp,loc,0,1,1,nil,c,tp)
local tc2=g:GetFirst()
Duel.Equip(tp,tc2,c)
end
end
end
end
end
function Hata_no_Kokoro.hnk_equip(c,id,e)
c:SetUniqueOnField(1,0,id)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(Hata_no_Kokoro.eqtg)
e1:SetOperation(Hata_no_Kokoro.eqop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(Hata_no_Kokoro.eqlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(Hata_no_Kokoro.eftg)
e3:SetLabelObject(e)
c:RegisterEffect(e3)
end
function Hata_no_Kokoro.eqlimit(e,c)
return c:IsSetCard(0x431)
end
function Hata_no_Kokoro.filter(c)
return c:IsFaceup() and c:IsSetCard(0x431)
end
function Hata_no_Kokoro.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and Hata_no_Kokoro.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Hata_no_Kokoro.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Hata_no_Kokoro.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function Hata_no_Kokoro.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function Hata_no_Kokoro.anger_eq(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function Hata_no_Kokoro.eftg(e,c)
return e:GetOwner():GetEquipTarget()==c and c:IsSetCard(0x431)
end
function Hata_no_Kokoro.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsContains(c)
end
function Hata_no_Kokoro.become_target(c,id)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(Hata_no_Kokoro.efcon)
return e1
end
function Hata_no_Kokoro.worries_eq(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function Hata_no_Kokoro.fun_eq(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(Hata_no_Kokoro.efilter)
c:RegisterEffect(e1)
end
function Hata_no_Kokoro.efilter(e,te)
if te:GetOwnerPlayer()==e:GetHandlerPlayer() or not te:IsActivated() then return false end
if not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g or not g:IsContains(e:GetOwner():GetEquipTarget())
end
function Hata_no_Kokoro.steff2q(c,id)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id-1000)
e1:SetTarget(Hata_no_Kokoro.tdtgq)
e1:SetOperation(Hata_no_Kokoro.tdop)
c:RegisterEffect(e1)
end
function Hata_no_Kokoro.steff2(c,id)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id-1000)
e1:SetTarget(Hata_no_Kokoro.tdtg)
e1:SetOperation(Hata_no_Kokoro.tdop)
c:RegisterEffect(e1)
end
function Hata_no_Kokoro.tdfilterq(c)
return c:IsSetCard(0x431) and c:IsType(TYPE_EQUIP) and c:IsAbleToDeck()
end
function Hata_no_Kokoro.tdfilter(c)
return c:IsSetCard(0x431) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function Hata_no_Kokoro.tdtgq(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsSetCard(0x431) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Hata_no_Kokoro.tdfilterq,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Hata_no_Kokoro.tdfilterq,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,tp,LOCATION_GRAVE)
end
function Hata_no_Kokoro.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsSetCard(0x431) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Hata_no_Kokoro.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Hata_no_Kokoro.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function Hata_no_Kokoro.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc =Duel.GetFirstTarget()
local c=e:GetHandler()
if tc then
local g=Group.CreateGroup()
if tc:IsRelateToEffect(e) then
g:AddCard(tc)
end
if c:IsRelateToEffect(e) then
g:AddCard(c)
end
if #g>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
function Hata_no_Kokoro.pbfilter(c)
return not c:IsPublic()
end
function Hata_no_Kokoro.public(c,id,tp)
if Duel.IsExistingMatchingCard(Hata_no_Kokoro.pbfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,Hata_no_Kokoro.pbfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
-- 面灵气 秦心
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.equip(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipCount()>0
end
function s.defilter(c,tc)
return c:IsLocation(LOCATION_SZONE) and c:IsType(TYPE_EQUIP)
end
function s.eqfilter(c,tc,code,tp)
return Hnk.eqfilter(c,tc,tp) and not c:IsCode(code)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
local c=e:GetHandler()
local eqg=c:GetEquipGroup()
if chk==0 then return eqg:FilterCount(s.defilter,nil)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.defilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,LOCATION_SZONE)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc =Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
local code=tc:GetCode()
local c=e:GetHandler()
if Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,c,code,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,c,code,tp)
local tc2=g:GetFirst()
Duel.Equip(tp,tc2,c)
end
end
end
function s.initial_effect(c)
s.equip(c)
Hnk.eff2(c)
Hnk.eff3(c,id,LOCATION_GRAVE)
end
\ No newline at end of file
-- 面灵气 吼怒的妖狐面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.effgain(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCondition(s.descon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
return e1
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler():GetBattleTarget(),1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if bc:IsRelateToBattle() then
Duel.Destroy(bc,REASON_EFFECT)
end
end
function s.destory(c)
local e1=Hnk.become_target(c,id)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetTarget(s.destg2)
e1:SetOperation(s.desop2)
c:RegisterEffect(e1)
end
function s.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function s.initial_effect(c)
Hnk.hnk_equip(c,id,s.effgain(c))
Hnk.anger_eq(c)
s.destory(c)
end
\ No newline at end of file
-- 面灵气 怒声的大蜘蛛面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.effgain(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCondition(s.ntrcon)
e1:SetTarget(s.ntrtg)
e1:SetOperation(s.ntrop)
return e1
end
function s.ntrcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function s.ntrtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return tc and tc:IsControlerCanBeChanged() end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0)
end
function s.ntrop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
if tc:IsRelateToBattle() then
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
function s.ntr(c)
local e1=Hnk.become_target(c,id)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetTarget(s.ntrtg2)
e1:SetOperation(s.ntrop2)
c:RegisterEffect(e1)
end
function s.ntrfilter(c)
return c:IsControlerCanBeChanged() and c:IsFaceup()
end
function s.ntrtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.ntrfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE,LOCATION_REASON_CONTROL) end
local g=Duel.GetMatchingGroup(s.ntrfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function s.ntrop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,s.ntrfilter,tp,0,LOCATION_MZONE,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.GetControl(g,tp,PHASE_END,1)
end
end
function s.initial_effect(c)
Hnk.hnk_equip(c,id,s.effgain(c))
Hnk.anger_eq(c)
s.ntr(c)
end
\ No newline at end of file
-- 面灵气 忧叹的长壁面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.effgain(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.discon)
e1:SetOperation(s.disop)
return e1
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainDisablable(ev) and Hnk.efcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():GetFlagEffect(id)<=0
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,0)) then
Duel.Hint(HINT_CARD,0,id)
Duel.NegateEffect(ev)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
end
end
function s.neg(c)
local e1=Hnk.become_target(c,id)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.negtg)
e1:SetOperation(s.negop)
c:RegisterEffect(e1)
end
function s.ntrfilter(c)
return c:IsControlerCanBeChanged() and c:IsFaceup()
end
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp)
and not tc:IsDisabled() and not tc:IsImmuneToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
function s.initial_effect(c)
Hnk.hnk_equip(c,id,s.effgain(c))
Hnk.worries_eq(c)
s.neg(c)
end
-- 面灵气 忧心的鬼婆面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.effgain(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.rmcon)
e1:SetOperation(s.rmop)
return e1
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rp==1-tp and rc:IsAbleToRemove() and Hnk.efcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():GetFlagEffect(id)<=0
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,0)) then
Duel.Hint(HINT_CARD,0,id)
Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
end
end
function s.remove(c)
local e1=Hnk.become_target(c,id)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetTarget(s.rmtg2)
e1:SetOperation(s.rmop2)
c:RegisterEffect(e1)
end
function s.rmfilter(c)
return c:IsAbleToRemove()
end
function s.rmtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.ntrfilter,tp,0,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,1,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function s.initial_effect(c)
Hnk.hnk_equip(c,id,s.effgain(c))
Hnk.worries_eq(c)
s.remove(c)
end
-- 面灵气 欢喜的狮子面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.effgain(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(s.op)
return e1
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(s.drcon)
e1:SetOperation(s.drop)
e1:SetLabelObject(c)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and e:GetOwner():GetFlagEffect(id)>0
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
if c:IsOnField() and Duel.IsPlayerCanDraw(tp,1) then
Duel.Hint(HINT_CARD,0,id)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.draw(c)
local e1=Hnk.become_target(c,id)
e1:SetCategory(CATEGORY_DRAW)
e1:SetTarget(s.drtg2)
e1:SetOperation(s.drop2)
c:RegisterEffect(e1)
end
function s.rmfilter(c)
return c:IsAbleToRemove()
end
function s.drtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.drop2(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function s.initial_effect(c)
Hnk.hnk_equip(c,id,s.effgain(c))
Hnk.fun_eq(c)
s.draw(c)
end
-- 面灵气 狂喜的火男面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.effgain(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(s.op)
return e1
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(s.thcon)
e1:SetOperation(s.thop)
e1:SetLabelObject(c)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and e:GetOwner():GetFlagEffect(id)>0
end
function s.filter(c)
return c:IsSetCard(0x431) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
if not c:IsOnField() then return end
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.set(c)
local e1=Hnk.become_target(c,id)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop2)
c:RegisterEffect(e1)
end
function s.thfilter(c)
if not (c:IsSetCard(0x431) and c:IsType(TYPE_TRAP)) then return false end
return c:IsAbleToHand() or c:IsSSetable()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
end
function s.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsSSetable() or Duel.SelectOption(tp,1190,1153)==0) then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SSet(tp,tc)
end
end
end
function s.initial_effect(c)
Hnk.hnk_equip(c,id,s.effgain(c))
Hnk.fun_eq(c)
s.set(c)
end
-- 面灵气 心的轮盘
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.change(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.chtg)
e1:SetOperation(s.chop)
c:RegisterEffect(e1)
end
function s.tdfilter(c,tp)
if c:IsFacedown() or not c:IsSetCard(0x431) or not c:IsType(TYPE_EQUIP) or not c:IsAbleToDeck() then return false end
local ec=c:GetEquipTarget()
local code=c:GetCode()
return Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK,0,1,nil,code,ec,tp)
end
function s.eqfilter(c,code)
return c:IsSetCard(0x431) and c:IsType(TYPE_SPELL) and not c:IsCode(code)
end
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_SZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_SZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,tp,LOCATION_SZONE)
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ec=tc:GetEquipTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
local tc2=tg:GetFirst()
local flag=0
if tc2:IsType(TYPE_EQUIP) and Hnk.eqfilter(tc2,ec,tp) then
if not tc2:IsAbleToHand() then
flag=1
elseif Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
flag=1
end
end
if flag==0 then
Duel.SendtoHand(tc2,tp,REASON_EFFECT)
else
Duel.Equip(tp,tc2,ec)
end
end
end
function s.initial_effect(c)
s.change(c)
Hata_no_Kokoro.steff2(c,id)
end
-- 面灵气 希望的恋心
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.spsummon(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.con)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_REMOVED) or c:IsSetCard(0x431)
end
function s.cfilter(c)
return c:GetSequence()<5
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(0x431) and c:IsLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_REMOVED)
end
function s.filter(c,e,tp)
return c:IsSetCard(0x431) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g2=Duel.SelectMatchingCard(tp,Hnk.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc,tp)
local tc2=g2:GetFirst()
Duel.Equip(tp,tc2,tc)
end
end
end
end
function s.initial_effect(c)
s.spsummon(c)
end
-- 面灵气 秦心·深秘
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.equip(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and (re:IsActiveType(TYPE_MONSTER) or re:GetHandler():IsType(TYPE_SPELL))
end
function s.defilter(c)
return c:IsSetCard(0x431)
end
function s.eqfilter(c,tc,code,tp)
return Hnk.eqfilter(c,tc,tp) and not c:IsCode(code)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsSetCard(0x431) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(s.defilter,tp,LOCATION_ONFIELD,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.defilter,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,LOCATION_ONFIELD)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc =Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
local code=tc:GetCode()
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,c,code,tp)
local tc2=g:GetFirst()
Duel.Equip(tp,tc2,c)
end
end
end
function s.initial_effect(c)
s.equip(c)
Hnk.eff2(c)
Hnk.eff3(c,id,LOCATION_DECK)
end
-- 面灵气 秦心·凭依
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.equip(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE)~=0
end
function s.eqfilter(c,tp)
return c:IsFaceup() and (c:IsAbleToChangeControler() or c:IsControler(tp))
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToChangeControler() end
local c=e:GetHandler()
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0
and tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.BreakEffect()
Duel.Equip(tp,tc,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(s.eqlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled()
end
function s.initial_effect(c)
s.equip(c)
Hnk.eff2(c)
Hnk.eff3(c,id,LOCATION_HAND)
end
-- 凭依「喜怒哀乐附体」
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.eff1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,tp)
return c:IsSetCard(0x431) and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,c,tp)
end
function s.eqfilter(c,tc,tp)
return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(tc) and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst()
Duel.SetOperationInfo(0,CATEGORY_EQUIP,tc,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp)
local eqc=g:GetFirst()
if Duel.Equip(tp,eqc,tc) then
Hnk.public(e:GetHandler(),id,tp)
end
end
end
function s.search(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.thcon)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.thfilter(c)
return c:IsSetCard(0x431) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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
function s.initial_effect(c)
s.eff1(c)
s.search(c)
end
-- 怒符「愤怒的忌狼之面」
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.eff1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsAbleToGrave()
end
function s.eqfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsSetCard(0x431) and c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
g2:Merge(g1)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g2,2,0,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(600)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,600)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
Duel.Recover(tp,600,REASON_EFFECT)
Hnk.public(e:GetHandler(),id,tp)
end
end
function s.initial_effect(c)
s.eff1(c)
Hata_no_Kokoro.steff2q(c,id)
end
-- 忧符「忧世之苦不绝如轮」
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.eff1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(s.con)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.confilter(c)
return c:IsSetCard(0x431) and c:IsFaceup()
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp)
and not tc:IsDisabled() and not tc:IsImmuneToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
Hnk.public(e:GetHandler(),id,tp)
end
end
function s.initial_effect(c)
s.eff1(c)
Hata_no_Kokoro.steff2q(c,id)
end
-- 喜符「昂扬的神乐狮子」
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.eff1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.sfilter(c)
return c:IsSetCard(0x431) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(s.sfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and
Duel.IsExistingTarget(s.sfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
if Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Hnk.public(e:GetHandler(),id,tp)
end
end
end
end
function s.initial_effect(c)
s.eff1(c)
Hata_no_Kokoro.steff2q(c,id)
end
-- 「假面丧心舞 暗黑能乐」
local s,id=GetID()
function s.eff1(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.con)
e1:SetTarget(aux.nbtg)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x431) and c:IsType(TYPE_MONSTER)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function s.thfilter(c)
return c:IsSetCard(0x431) and c:IsFaceup() and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
local tc=g:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.eff2(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(aux.bfgcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsType(TYPE_TRAP) and c:IsSetCard(0x431) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
local tc=g:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
function s.initial_effect(c)
s.eff1(c)
s.eff2(c)
end
-- 「亡失的情感」
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.aih(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetRange(LOCATION_FZONE)
e1:SetTarget(s.aihtg)
e1:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e1)
end
function s.aihtg(e,c)
return c:IsSetCard(0x431) and c:IsPublic()
end
function s.eq(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.filter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x431) and Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_DECK,0,1,nil,c,tp)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsSetCard(0x431) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_DECK,0,1,nil,tc,tp) then return end
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,Hnk.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc,tp)
local eqc=g:GetFirst()
Duel.Equip(tp,eqc,tc)
end
end
function s.atkup(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetCost(s.atkcost)
e1:SetTarget(s.atktg)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
end
function s.pbfilter(c)
return c:IsSetCard(0x431) and c:IsType(TYPE_TRAP) and not c:IsPublic()
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.pbfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.pbfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
function s.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x431)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
c:RegisterEffect(e1)
s.eq(c)
s.aih(c)
s.atkup(c)
end
-- 面灵气 秦心·希望之面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.search(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,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,id)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.thfilter(c)
return c:IsSetCard(0x431) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,e:GetHandler())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Hnk.public(e:GetHandler(),id,tp)
end
end
function s.tohand(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id-1000)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg2)
e1:SetOperation(s.thop2)
c:RegisterEffect(e1)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() end
local eqg=c:GetEquipGroup()
eqg:KeepAlive()
e:SetLabelObject(eqg)
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.thfilter2(c)
return c:IsSetCard(0x431) and c:IsAbleToHand()
end
function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.thfilter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE)
end
function s.thfilter3(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand()
end
function s.thop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
local eqg=e:GetLabelObject()
if #eqg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local eqc=eqg:Filter(s.thfilter3,nil):Select(tp,1,1,nil)
Duel.SendtoHand(eqc,nil,REASON_EFFECT)
eqg:DeleteGroup()
end
end
end
function s.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,s.lcheck)
s.search(c)
s.tohand(c)
end
function s.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x431)
end
\ No newline at end of file
-- 面灵气 秦心※心貌百面
xpcall(function() require("expansions/script/c47310000") end,function() require("script/c47310000") end)
local s,id=GetID()
function s.equip(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.eqcon)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_DECK,0,1,nil,c,tp)
or Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_HAND,0,1,nil,c,tp)
or Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_GRAVE,0,1,nil,c,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_HAND,0,1,nil,c,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local eqc=Duel.SelectMatchingCard(tp,Hnk.eqfilter,tp,LOCATION_HAND,0,1,1,nil,c,tp)
Duel.Equip(tp,eqc:GetFirst(),c,true,true)
end
if Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_DECK,0,1,nil,c,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local eqc=Duel.SelectMatchingCard(tp,Hnk.eqfilter,tp,LOCATION_DECK,0,1,1,nil,c,tp)
Duel.Equip(tp,eqc:GetFirst(),c,true,true)
end
if Duel.IsExistingMatchingCard(Hnk.eqfilter,tp,LOCATION_GRAVE,0,1,nil,c,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local eqc=Duel.SelectMatchingCard(tp,Hnk.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,c,tp)
Duel.Equip(tp,eqc:GetFirst(),c,true,true)
end
Duel.EquipComplete()
end
end
function s.replace(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(s.desreptg)
e2:SetValue(s.desrepval)
e2:SetOperation(s.desrepop)
c:RegisterEffect(e2)
end
function s.defilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function s.repfilter(c)
return not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(s.defilter,1,nil,tp)
and c:GetEquipGroup():FilterCount(s.repfilter,nil)>0 end
return Duel.SelectEffectYesNo(tp,c,96)
end
function s.desrepval(e,c)
return s.defilter(c,e:GetHandlerPlayer())
end
function s.eqfilter2(c,tc)
return c:IsType(TYPE_EQUIP) and c:GetEquipTarget()==tc
end
function s.desrepop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local eqg=c:GetEquipGroup():Filter(s.repfilter,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=eqg:Select(Card.IsAbleToGrave,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REPLACE)
Duel.Hint(HINT_CARD,0,id)
end
function s.tohand(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
end
function s.tgfilter(c,tc)
return c:IsType(TYPE_EQUIP) and c:GetEquipTarget()==tc and c:IsAbleToGrave()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToGrave() end
local c=e:GetHandler()
local code=re:GetHandler():GetCode()
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,c)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,code) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,c)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,1,tp,LOCATION_SZONE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function s.thfilter(c,code)
return c:IsSetCard(0x431) and c:IsType(TYPE_TRAP) and not c:IsCode(code) and c:IsAbleToHand()
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local code=re:GetHandler():GetCode()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,code)
local thc=g:GetFirst()
Duel.SendtoHand(thc,tp,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
thc:RegisterEffect(e1)
if tc and tc:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function s.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,4,s.lcheck)
s.equip(c)
s.replace(c)
s.tohand(c)
end
function s.lfilter(c)
return c:IsLinkSetCard(0x431) and c:IsType(TYPE_LINK)
end
function s.lcheck(g)
return g:IsExists(s.lfilter,1,nil)
end
\ No newline at end of file
--白玉楼的亡灵少女 幽幽子
function c88178301.initial_effect(c)
aux.AddMaterialCodeList(c,88178304)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c88178301.splimit)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,1)
e1:SetCondition(c88178301.spcon)
e1:SetOperation(c88178301.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c88178301.efilter)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178301,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c88178301.spcon1)
e3:SetCost(c88178301.descost)
e3:SetOperation(c88178301.atkop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
if not c88178301.global_check then
c88178301.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVED)
ge1:SetOperation(c88178301.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c88178301.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if not rc:IsRelateToEffect(re) or not re:IsActiveType(TYPE_MONSTER) then return end
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
if loc==LOCATION_MZONE and rc:GetFlagEffect(88178301)==0 then
rc:RegisterFlagEffect(88178301,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c88178301.rfilter(c)
return c:IsFaceup() and c:GetFlagEffect(88178301)>0
end
function c88178301.splimit(e,se,sp,st)
return se:GetHandler():IsCodeListed(c,88178304)
end
function c88178301.spfilter(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function c88178301.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c88178301.rfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function c88178301.spop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c88178301.rfilter,tp,0,LOCATION_MZONE,1,7,nil,tp)
local atk=0
local tc=g:GetFirst()
while tc do
local batk=tc:GetAttack()
if batk>0 then
atk=atk+batk
end
tc=g:GetNext()
end
Duel.Release(g,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END,2)
e2:SetTargetRange(1,0)
e2:SetTarget(c88178301.splimit)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetLabelObject(e)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e3,tp)
end
function c88178301.splimit(e,c)
return not c:IsSetCard(0x595)
end
function c88178301.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c88178301.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c88178301.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsAttackAbove,1,c,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,Card.IsAttackAbove,1,1,c,1)
Duel.Release(g,REASON_COST)
e:SetLabel(g:GetFirst():GetPreviousAttackOnField())
end
function c88178301.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(e:GetLabel())
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--白玉楼的园艺师 妖梦
function c88178302.initial_effect(c)
aux.AddMaterialCodeList(c,88178304)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178302,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c88178302.spcon)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88178302,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,88178302)
e2:SetTarget(c88178302.thtg)
e2:SetOperation(c88178302.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_ADD_RACE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(RACE_ZOMBIE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88178302,2))
e4:SetType(EFFECT_TYPE_QUICK_F)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c88178302.condition)
e4:SetOperation(c88178302.operation)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c88178302.cfilter(c)
return c:IsSetCard(0x595) and c:IsFaceup()
end
function c88178302.spcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and (Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0) or (Duel.IsExistingMatchingCard(c88178302.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0)
end
function c88178302.thfilter(c)
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c88178302.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178302.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88178302.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178302.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c88178302.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and aux.IsCodeListed(re:GetHandler(),88178304)
end
function c88178302.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--白玉楼
function c88178304.initial_effect(c)
aux.AddMaterialCodeList(c,88178304,88178309)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88178304+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c88178304.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_DISABLE)
e2:SetCondition(c88178304.lvcon)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_PIERCE)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x595))
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88178304,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,881783040)
e4:SetCost(aux.bfgcost)
e4:SetTarget(c88178304.thtg1)
e4:SetOperation(c88178304.thop1)
c:RegisterEffect(e4)
end
function c88178304.filter(c)
return c:IsSetCard(0x595) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c88178304.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c88178304.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(88178304,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c88178304.lvcon(e)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c88178304.thfilter1(c)
return c:IsCode(88178309) and c:IsAbleToHand()
end
function c88178304.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178304.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88178304.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178304.thfilter1,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
--半分虚幻的园艺师 魂魄妖梦-楼观剑
function c88178312.initial_effect(c)
aux.EnableChangeCode(c,88178302,LOCATION_MZONE+LOCATION_GRAVE)
aux.AddMaterialCodeList(c,88178304)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c88178312.lkcon)
e0:SetOperation(c88178312.lkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178312,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,88178312)
e1:SetCondition(c88178312.thcon)
e1:SetTarget(c88178312.thtg)
e1:SetOperation(c88178312.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c88178312.imfilter)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178312,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,88278312)
e3:SetCondition(c88178312.condition)
e3:SetTarget(c88178312.target)
e3:SetOperation(c88178312.operation)
c:RegisterEffect(e3)
end
function c88178312.lkfilter(c,lc,tp)
local flag=c:IsFaceup() and c:IsCanBeLinkMaterial(lc)
if c:IsType(TYPE_MONSTER) then
return flag and c:IsSetCard(0x595)
else
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_SPELL)
end
end
function c88178312.lvfilter(c)
if c:IsType(TYPE_SPELL) then
if c:IsType(TYPE_LINK) and c:GetLink()>1 then
return 1+0x10000*c:GetLink()
else
return 1
end
else
return 1
end
end
function c88178312.lcheck(tp,sg,lc,minc,ct)
return ct>=minc and sg:CheckWithSumEqual(c88178312.lvfilter,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
end
function c88178312.lkchenk(c,tp,sg,mg,lc,ct,minc,maxc)
sg:AddCard(c)
ct=ct+1
local res=c88178312.lcheck(tp,sg,lc,minc,ct) or (ct<maxc and mg:IsExists(c88178312.lkchenk,1,sg,tp,sg,mg,lc,ct,minc,maxc))
sg:RemoveCard(c)
ct=ct-1
return res
end
--
function c88178312.lkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c88178312.lkfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
local pc=pe:GetHandler()
if not mg:IsContains(pc) then return false end
sg:AddCard(pc)
end
local ct=sg:GetCount()
local minc=2
local maxc=2
if ct>maxc then return false end
return c88178312.lcheck(tp,sg,c,minc,ct) or mg:IsExists(c88178312.lkchenk,1,nil,tp,sg,mg,c,ct,minc,maxc) and (not sg or not sg:IsExists(Card.IsLocation,1,c,LOCATION_HAND)) and Duel.IsExistingMatchingCard(c88178312.cs,tp,LOCATION_MZONE,0,1,nil)
end
function c88178312.cs(c)
return c:IsSetCard(0x595)
end
function c88178312.lkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c88178312.lkfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
sg:AddCard(pe:GetHandler())
end
local ct=sg:GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
sg:Select(tp,ct,ct,nil)
local minc=2
local maxc=2
for i=ct,maxc-1 do
local cg=mg:Filter(c88178312.lkchenk,sg,tp,sg,mg,c,i,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if c88178312.lcheck(tp,sg,c,minc,i) then
if not Duel.SelectYesNo(tp,210) then break end
minct=0
end
if not sg or not sg:IsExists(Card.IsLocation,1,c,LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
tg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND,0,nil,TYPE_SPELL)
cg:Sub(tg)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
end
end
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK)
end
function c88178312.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c88178312.thfilter(c)
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c88178312.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178312.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88178312.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178312.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
function c88178312.imfilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
function c88178312.condition(e)
return e:GetHandler():GetSequence()>4
end
function c88178312.thfilter1(c,tp)
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c88178312.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178312.thfilter1,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c88178312.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178312.thfilter1,tp,LOCATION_GRAVE,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--修罗剑『现世妄执』
function c88178313.initial_effect(c)
aux.AddMaterialCodeList(c,88178304)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88178314+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c88178313.target)
e1:SetOperation(c88178313.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c88178313.spcon)
c:RegisterEffect(e2)
end
function c88178313.filter(c)
return aux.IsCodeListed(c,88178304) and c:IsAbleToHand()
end
function c88178313.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c88178313.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88178313.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c88178313.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c88178313.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if Duel.IsExistingMatchingCard(c88178313.actcfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) then
if Duel.SelectYesNo(tp,aux.Stringid(88178313,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectTarget(tp,c88178313.js,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(dg,nil,0,REASON_EFFECT)
end
end
end
end
function c88178313.actcfilter(c)
return c:IsCode(88178302)
end
function c88178313.js(c)
return aux.IsCodeListed(c,88178304) and c:IsAbleToDeck()
end
function c88178313.cfilter(c)
return c:IsSetCard(0x595)
end
function c88178313.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c88178313.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
--人界剑『悟入幻想』
function c88178314.initial_effect(c)
aux.AddMaterialCodeList(c,88178304)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178314,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,88178314+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c88178314.target)
e1:SetOperation(c88178314.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c88178314.spcon)
c:RegisterEffect(e2)
end
function c88178314.filter(c)
return c:IsSetCard(0x595) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c88178314.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178314.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
end
end
function c88178314.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178314.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(c88178314.actcfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) then
if Duel.SelectYesNo(tp,aux.Stringid(88178314,1)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
function c88178314.actcfilter(c)
return c:IsCode(88178302)
end
function c88178314.cfilter(c)
return c:IsSetCard(0x595) and c:IsFaceup()
end
function c88178314.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c88178314.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
--半分虚幻的园艺师 魂魄妖梦-白楼剑
function c88178315.initial_effect(c)
aux.EnableChangeCode(c,88178302,LOCATION_MZONE+LOCATION_GRAVE)
aux.AddMaterialCodeList(c,88178304)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c88178315.lkcon)
e0:SetOperation(c88178315.lkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178315,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,88178315)
e1:SetCondition(c88178315.thcon)
e1:SetTarget(c88178315.thtg)
e1:SetOperation(c88178315.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c88178315.imfilter)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178315,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,88278315)
e3:SetCondition(c88178315.condition)
e3:SetTarget(c88178315.target)
e3:SetOperation(c88178315.operation)
c:RegisterEffect(e3)
end
function c88178315.lkfilter(c,lc,tp)
local flag=c:IsFaceup() and c:IsCanBeLinkMaterial(lc)
if c:IsType(TYPE_MONSTER) then
return flag and c:IsSetCard(0x595)
else
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_TRAP)
end
end
function c88178315.lvfilter(c)
if c:IsType(TYPE_TRAP) then
if c:IsType(TYPE_LINK) and c:GetLink()>1 then
return 1+0x10000*c:GetLink()
else
return 1
end
else
return 1
end
end
function c88178315.lcheck(tp,sg,lc,minc,ct)
return ct>=minc and sg:CheckWithSumEqual(c88178315.lvfilter,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
end
function c88178315.lkchenk(c,tp,sg,mg,lc,ct,minc,maxc)
sg:AddCard(c)
ct=ct+1
local res=c88178315.lcheck(tp,sg,lc,minc,ct) or (ct<maxc and mg:IsExists(c88178315.lkchenk,1,sg,tp,sg,mg,lc,ct,minc,maxc))
sg:RemoveCard(c)
ct=ct-1
return res
end
--
function c88178315.lkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c88178315.lkfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
local pc=pe:GetHandler()
if not mg:IsContains(pc) then return false end
sg:AddCard(pc)
end
local ct=sg:GetCount()
local minc=2
local maxc=2
if ct>maxc then return false end
return c88178315.lcheck(tp,sg,c,minc,ct) or mg:IsExists(c88178315.lkchenk,1,nil,tp,sg,mg,c,ct,minc,maxc) and (not sg or not sg:IsExists(Card.IsLocation,1,c,LOCATION_HAND)) and Duel.IsExistingMatchingCard(c88178315.cs,tp,LOCATION_MZONE,0,1,nil)
end
function c88178315.cs(c)
return c:IsSetCard(0x595)
end
function c88178315.lkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c88178315.lkfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
sg:AddCard(pe:GetHandler())
end
local ct=sg:GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
sg:Select(tp,ct,ct,nil)
local minc=2
local maxc=2
for i=ct,maxc-1 do
local cg=mg:Filter(c88178315.lkchenk,sg,tp,sg,mg,c,i,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if c88178315.lcheck(tp,sg,c,minc,i) then
if not Duel.SelectYesNo(tp,210) then break end
minct=0
end
if not sg or not sg:IsExists(Card.IsLocation,1,c,LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
tg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND,0,nil,TYPE_SPELL)
cg:Sub(tg)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
end
end
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK)
end
function c88178315.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c88178315.thfilter(c)
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c88178315.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178315.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88178315.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178315.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
function c88178315.imfilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
function c88178315.condition(e)
return e:GetHandler():GetSequence()>4
end
function c88178315.thfilter1(c,tp)
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c88178315.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178315.thfilter1,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c88178315.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178315.thfilter1,tp,LOCATION_GRAVE,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--生命的二刀流 魂魄妖梦
function c88178317.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178317,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,88178317)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c88178317.spcost)
e1:SetTarget(c88178317.sptg)
e1:SetOperation(c88178317.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88178317,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,88278317)
e2:SetTarget(c88178317.thtg)
e2:SetOperation(c88178317.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_ADD_RACE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(RACE_WARRIOR)
c:RegisterEffect(e3)
end
function c88178317.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c88178317.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) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c88178317.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c88178317.splimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function c88178317.splimit(e,c)
return not c:IsSetCard(0x595)
end
function c88178317.thfilter(c)
return aux.IsCodeListed(c,88178304) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c88178317.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178317.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88178317.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88178317.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
--八云家
function c88178401.initial_effect(c)
aux.AddMaterialCodeList(c,88178309)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88178401+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c88178401.activate)
c:RegisterEffect(e1)
end
function c88178401.filter(c)
return c:IsSetCard(0x596) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c88178401.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c88178401.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(88178401,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--隙间妖怪 八云紫
function c88178402.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178402,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,88178402)
e1:SetTarget(c88178402.sptg)
e1:SetOperation(c88178402.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88178402,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,88278402)
e2:SetTarget(c88178402.thtg)
e2:SetOperation(c88178402.thop)
c:RegisterEffect(e2)
end
function c88178402.spfilter(c,e,tp)
return c:IsSetCard(0x596) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c88178402.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c88178402.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c88178402.spop(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,c88178402.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c88178402.thfilter(c)
return c:IsSetCard(0x596) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsAbleToRemove()
end
function c88178402.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178402.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c88178402.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c88178402.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--隙间妖怪的式神 八云蓝
function c88178403.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,88178403)
e1:SetCondition(c88178403.spcon1)
e1:SetTarget(c88178403.sptg)
e1:SetOperation(c88178403.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_REMOVED)
e2:SetCondition(c88178403.spcon2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178403,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,88278403)
e3:SetTarget(c88178403.thtg)
e3:SetOperation(c88178403.thop)
c:RegisterEffect(e3)
end
function c88178403.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 c88178403.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c88178403.cfilter1(c)
return c:IsFaceup() and c:IsSetCard(0x596)
end
function c88178403.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c88178403.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c88178403.cfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x596) and c:IsCode(88178402)
end
function c88178403.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c88178403.cfilter2,tp,LOCATION_MZONE,0,1,nil)
end
function c88178403.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x596) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsAbleToHand()
end
function c88178403.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c88178403.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88178403.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c88178403.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c88178403.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--八云恋
function c88178406.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,88178402,88178006,true,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88178406,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c88178406.discon)
e2:SetTarget(c88178406.distg)
e2:SetOperation(c88178406.disop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178406,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,88178406)
e3:SetCost(c88178406.spcost)
e3:SetTarget(c88178406.sptg)
e3:SetOperation(c88178406.spop)
c:RegisterEffect(e3)
end
function c88178406.discon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and bit.band(Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION),LOCATION_ONFIELD)~=0 and re:GetHandler()~=e:GetHandler()
end
function c88178406.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c88178406.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c88178406.costfilter(c)
return c:IsAbleToDeckAsCost()
end
function c88178406.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c88178406.costfilter,tp,LOCATION_REMOVED,0,1,c) and Duel.IsExistingTarget(c88178406.costfilter,tp,0,LOCATION_REMOVED,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,c88178406.costfilter,tp,LOCATION_REMOVED,0,1,1,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,c88178406.costfilter,tp,0,LOCATION_REMOVED,1,1,c)
g1:Merge(g2)
Duel.SendtoDeck(g1,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c88178406.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 c88178406.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--隙间妖怪的式神的式神 橙
function c88178407.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178407,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND+LOCATION_REMOVED)
e1:SetCountLimit(1,88178407)
e1:SetCondition(c88178407.spcon)
e1:SetTarget(c88178407.sptg)
e1:SetOperation(c88178407.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88178407,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,88278407)
e2:SetTarget(c88178407.rmtg)
e2:SetOperation(c88178407.rmop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178407,2))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,88378407)
e3:SetCost(c88178407.lvcost)
e3:SetTarget(c88178407.lvtg)
e3:SetOperation(c88178407.lvop)
c:RegisterEffect(e3)
end
function c88178407.cfilter(c)
return c:IsSetCard(0x596) and c:IsFaceup()
end
function c88178407.spcon(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then return false end
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
or Duel.IsExistingMatchingCard(c88178407.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c88178407.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 c88178407.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(88178407,3))
end
function c88178407.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c88178407.chkfilter(c)
return c:IsSetCard(0x596) and not c:IsAbleToRemove()
end
function c88178407.rmfilter(c)
return c:IsSetCard(0x596) and c:IsAbleToRemove()
end
function c88178407.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(c88178407.rmfilter,tp,LOCATION_GRAVE,0,1,nil)
and not Duel.IsExistingMatchingCard(c88178407.chkfilter,tp,0,LOCATION_GRAVE,1,nil)
end
local g=Duel.GetMatchingGroup(c88178407.rmfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c88178407.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c88178407.rmfilter,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c88178407.costfilter(c)
return not c:IsCode(88178407) and c:IsSetCard(0x596) and c:IsAbleToRemoveAsCost()
end
function c88178407.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178407.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c88178407.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c88178407.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLevelAbove(0) and not c:IsLevel(8) end
end
function c88178407.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(8)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--操纵境界程度的能力
function c88178408.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88178408)
e1:SetTarget(c88178408.target)
e1:SetOperation(c88178408.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,88278408)
e2:SetTarget(c88178408.thtg)
e2:SetOperation(c88178408.thop)
c:RegisterEffect(e2)
end
function c88178408.filter(c)
return c:IsSetCard(0x596) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c88178408.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178408.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c88178408.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c88178401.filter,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
function c88178408.thfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x596) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c88178408.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c88178408.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88178408.thfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c88178408.thfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c88178408.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--神隐的主犯 八云紫
function c88178409.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178409,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,88178409)
e1:SetCost(c88178409.cost)
e1:SetTarget(c88178409.target)
e1:SetOperation(c88178409.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_FUSION_SUBSTITUTE)
e2:SetCondition(c88178409.subcon)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,88278409)
e3:SetTarget(c88178409.tdtg)
e3:SetOperation(c88178409.tdop)
c:RegisterEffect(e3)
end
function c88178409.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c88178409.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c88178409.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x596) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c88178409.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c88178409.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c88178409.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c88178409.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c88178409.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c88178409.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c88178409.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c88178409.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
end
function c88178409.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c88178409.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_DECK) then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--幻想的境界 八云紫
function c88178410.initial_effect(c)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x596),8,2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178410,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,88178410)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(c88178410.rmcost)
e3:SetTarget(c88178410.rmtg)
e3:SetOperation(c88178410.rmop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88178410,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,88278410)
e4:SetTarget(c88178410.thtg)
e4:SetOperation(c88178410.thop)
c:RegisterEffect(e4)
end
function c88178410.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c88178410.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD)
end
function c88178410.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
function c88178410.thfilter(c)
return c:IsSetCard(0x596) and c:IsAbleToHand()
end
function c88178410.rmfilter(c)
return c:IsSetCard(0x596) and c:IsAbleToRemove()
end
function c88178410.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178410.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c88178410.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88178410.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c88178410.rmfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if #g1>0 then
Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c88178410.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g2>0 then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
end
\ No newline at end of file
--苏醒的冬眠妖怪
function c88178411.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88178411+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c88178411.condition)
e1:SetTarget(c88178411.target)
e1:SetOperation(c88178411.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,88278411)
e2:SetTarget(c88178411.thtg)
e2:SetOperation(c88178411.thop)
c:RegisterEffect(e2)
end
function c88178411.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
end
function c88178411.filter(c,e,tp)
return c:IsSetCard(0x3596) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c88178411.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c88178411.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c88178411.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c88178411.thfilter(c)
return c:IsSetCard(0x596) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsAbleToRemove()
end
function c88178411.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,c88178411.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c88178411.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
function c88178411.thfilter1(c,e,tp)
return c:IsSetCard(0x596) and c:IsFaceup()
end
function c88178411.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c88178411.thfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88178411.thfilter1,tp,LOCATION_REMOVED,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c88178411.thfilter1,tp,LOCATION_REMOVED,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c88178411.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(Group.FromCards(c,tc),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
--野游的八云家
function c88178414.initial_effect(c)
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x596),aux.NonTuner(Card.IsSetCard,0x596),1)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88178414,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,88178414)
e1:SetCondition(c88178414.remcon)
e1:SetTarget(c88178414.remtg)
e1:SetOperation(c88178414.remop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88178414,4))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,88278414)
e2:SetCondition(c88178414.spcon)
e2:SetTarget(c88178414.sptg)
e2:SetOperation(c88178414.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88178414,5))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCountLimit(1,88378414)
e3:SetCost(c88178414.damcost)
e3:SetTarget(c88178414.damtg)
e3:SetOperation(c88178414.damop)
c:RegisterEffect(e3)
end
function c88178414.remcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c88178414.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c88178414.remop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and ((g2:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(88178414,1))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
sg:Merge(sg1)
end
if g2:GetCount()>0 and ((sg:GetCount()==0 and g3:GetCount()==0) or Duel.SelectYesNo(tp,aux.Stringid(88178414,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg2=g2:Select(tp,1,1,nil)
Duel.HintSelection(sg2)
sg:Merge(sg2)
end
if g3:GetCount()>0 and (sg:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(88178414,3))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg3=g3:RandomSelect(tp,1)
sg:Merge(sg3)
end
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
function c88178414.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsPreviousLocation(LOCATION_MZONE) and rp==1-tp and c:IsPreviousControler(tp)
end
function c88178414.spfilter(c,e,tp)
return c:IsSetCard(0x596) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c88178414.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88178414.spfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end
function c88178414.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c88178414.spfilter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.Overlay(tc,c)
end
end
function c88178414.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckOrExtraAsCost() end
Duel.SendtoDeck(e:GetHandler(),tp,SEQ_DECKSHUFFLE,REASON_COST)
end
function c88178414.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c88178414.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
--东方的幻想巫女 博丽灵梦
function c88188002.initial_effect(c)
c:EnableCounterPermit(0x0592)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88188002,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,88188002)
e1:SetTarget(c88188002.thtg)
e1:SetOperation(c88188002.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c88188002.reptg)
e3:SetOperation(c88188002.repop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88188002,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,88189002)
e4:SetCondition(c88188002.spcon)
e4:SetTarget(c88188002.sptg)
e4:SetOperation(c88188002.spop)
c:RegisterEffect(e4)
end
function c88188002.thfilter(c)
return c:IsSetCard(0x3592) and ((c:IsType(TYPE_SPELL) and (c:IsType(TYPE_CONTINUOUS) or c:IsType(TYPE_EQUIP) or c:IsType(TYPE_FIELD) or c:IsType(TYPE_QUICKPLAY) or c:IsType(TYPE_RITUAL))) or c:IsType(TYPE_TRAP)) and c:IsAbleToHand()
end
function c88188002.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88188002.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88188002.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88188002.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if c:IsRelateToEffect(e) and c:IsCanAddCounter(0x0592,3) then
c:AddCounter(0x0592,3)
end
end
end
function c88188002.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
and c:IsCanRemoveCounter(tp,0x0592,1,REASON_EFFECT)
end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c88188002.repop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(tp,0x0592,1,REASON_EFFECT)
end
function c88188002.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c88188002.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) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c88188002.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--东方的幻想魔法使 雾雨魔理沙
function c88188003.initial_effect(c)
--to gy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88188003,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,88188003)
e1:SetCost(c88188003.tgcost)
e1:SetTarget(c88188003.tgtg)
e1:SetOperation(c88188003.tgop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTarget(c88188003.reptg)
e2:SetValue(c88188003.repval)
e2:SetOperation(c88188003.repop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88188003,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,88189003)
e3:SetTarget(c88188003.sptg)
e3:SetOperation(c88188003.spop)
c:RegisterEffect(e3)
end
function c88188003.tgfilter(c)
return c:IsSetCard(0x3592) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c88188003.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c88188003.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88188003.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c88188003.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c88188003.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c88188003.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsSetCard(0x3592) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c88188003.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c88188003.repfilter,1,c,tp) and c:IsAbleToRemove()
and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c88188003.repval(e,c)
return c88188003.repfilter(c,e:GetHandlerPlayer())
end
function c88188003.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
function c88188003.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 c88188003.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DINOSAUR)
end
function c88188003.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
\ No newline at end of file
--幻想的人偶使 爱丽丝
function c88198005.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88198005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,88198005+EFFECT_COUNT_CODE_DUEL)
e1:SetTarget(c88198005.target)
e1:SetOperation(c88198005.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,88298005+EFFECT_COUNT_CODE_DUEL)
e2:SetTarget(c88198005.sptg)
e2:SetOperation(c88198005.spop)
c:RegisterEffect(e2)
end
function c88198005.filter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsLevelAbove(3)
end
function c88198005.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c88198005.filter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c88198005.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsPlayerCanSpecialSummonMonster(tp,88198007,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c88198005.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function c88198005.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) or tc:GetLevel()<3 then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-2)
tc:RegisterEffect(e1)
if not tc:IsImmuneToEffect(e1) and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,88198007,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) then
local token=Duel.CreateToken(tp,88198007)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,1,0)
e1:SetTarget(c88198005.splimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
end
function c88198005.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end
function c88198005.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsReleasable()
end
function c88198005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c88198005.costfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c88198005.costfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c88198005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,88198008,nil,TYPES_TOKEN_MONSTER,0,0,2,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c88198005.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,88198008,nil,TYPES_TOKEN_MONSTER,0,0,2,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) then
local token=Duel.CreateToken(tp,88198008)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,1,0)
e1:SetTarget(c88198005.splimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
--七色的人偶师 爱丽丝·玛格特罗依德
function c88198006.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c88198006.tz,aux.NonTuner(Card.IsRace,RACE_SPELLCASTER),2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88198006,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,88198006)
e1:SetTarget(c88198006.remtg)
e1:SetOperation(c88198006.remop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88198006,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,88298006)
e2:SetCondition(c88198006.discon)
e2:SetCost(c88198006.discost)
e2:SetTarget(c88198006.distg)
e2:SetOperation(c88198006.disop)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88198006,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,88398006)
e2:SetCondition(c88198006.spcon)
e2:SetCost(c88198006.spcost)
e2:SetTarget(c88198006.sptg)
e2:SetOperation(c88198006.spop)
c:RegisterEffect(e2)
end
function c88198006.tz(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function c88198006.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsPlayerCanSpecialSummonMonster(tp,88198007,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) and Duel.IsPlayerCanSpecialSummonMonster(tp,88198008,nil,TYPES_TOKEN_MONSTER,0,0,2,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
end
function c88198006.remop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.IsPlayerCanSpecialSummonMonster(tp,88198007,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) and Duel.IsPlayerCanSpecialSummonMonster(tp,88198008,nil,TYPES_TOKEN_MONSTER,0,0,2,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) then
local token1=Duel.CreateToken(tp,88198007)
local token2=Duel.CreateToken(tp,88198008)
Duel.SpecialSummon(token1,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(token2,0,tp,tp,false,false,POS_FACEUP)
end
end
function c88198006.discon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp
end
function c88198006.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsType(TYPE_TOKEN) and c:IsReleasable()
end
function c88198006.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c88198006.costfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c88198006.costfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c88198006.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c88198006.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c88198006.spcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsRace(RACE_SPELLCASTER) and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c88198006.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c88198006.spcfilter,1,nil,tp)
end
function c88198006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c88198006.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return true end
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c88198006.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--奇妙幻想乡
function c88199001.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88199001+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c88199001.target)
e1:SetOperation(c88199001.operation)
c:RegisterEffect(e1)
end
function c88199001.filter1(c)
return c:GetType()==TYPE_SPELL and c:IsSetCard(0x3592)
and Duel.IsExistingMatchingCard(c88199001.filter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c88199001.filter2(c,code)
return aux.IsCodeListed(c,code) and c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end
function c88199001.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88199001.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88199001.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,c88199001.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g1:GetCount()==0 then return end
Duel.ConfirmCards(1-tp,g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c88199001.filter2,tp,LOCATION_DECK,0,1,1,nil,g1:GetFirst():GetCode())
Duel.ConfirmCards(1-tp,g2)
if g2:GetCount()~=0 then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
--幻想乡的被遗忘者 冴月麟
function c88199002.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88199002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE+LOCATION_HAND)
e1:SetCountLimit(1,88199002)
e1:SetCost(c88199002.cost)
e1:SetTarget(c88199002.target)
e1:SetOperation(c88199002.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88199002,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,88299002)
e2:SetTarget(c88199002.thtg)
e2:SetOperation(c88199002.thop)
c:RegisterEffect(e2)
end
function c88199002.costfilter(c)
return c:IsSetCard(0x3592) and c:IsAbleToRemoveAsCost()
end
function c88199002.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88199002.costfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c88199002.costfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c88199002.target(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 c88199002.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c88199002.thfilter(c)
return c:IsSetCard(0x6592) and c:IsAbleToHand()
end
function c88199002.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88199002.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88199002.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88199002.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
--决斗者的秘宝 星之魔方
function c9300006.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c)
aux.AddCodeList(c,14175008)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.ritlimit)
c:RegisterEffect(e0)
--left zone
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9300006,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCondition(c9300006.sccon1)
e1:SetTarget(c9300006.pftg)
e1:SetOperation(c9300006.pfop)
c:RegisterEffect(e1)
--right zone
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9300006,0))
e2:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(c9300006.sccon2)
e2:SetTarget(c9300006.tg2)
e2:SetOperation(c9300006.op2)
c:RegisterEffect(e2)
--hand synchro
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_SYNCHRO_MATERIAL)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,9300006)
e3:SetValue(c9300006.matval)
c:RegisterEffect(e3)
--register HOpT
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_PRE_MATERIAL)
e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetLabelObject(e1)
e4:SetCondition(c9300006.hsyncon)
e4:SetOperation(c9300006.hsynreg)
c:RegisterEffect(e4)
--pendulum
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetOperation(c9300006.op)
c:RegisterEffect(e5)
--to Pzone
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(9300006,1))
e6:SetCategory(CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetRange(LOCATION_GRAVE+LOCATION_EXTRA)
e6:SetCountLimit(1,9301006)
e6:SetCondition(c9300006.pencon)
e6:SetTarget(c9300006.pentg)
e6:SetOperation(c9300006.penop)
c:RegisterEffect(e6)
end
c9300006.toss_dice=true
c9300006.setname="MagiCube"
function c9300006.sccon1(e)
return e:GetHandler()==Duel.GetFieldCard(e:GetHandlerPlayer(),LOCATION_PZONE,0) and not e:GetHandler():IsDisabled()
end
function c9300006.filter1(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e) and c:IsDestructable(e)
end
function c9300006.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c9300006.pftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local res=Duel.IsExistingMatchingCard(c9300006.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c9300006.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
end
function c9300006.pfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c9300006.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c9300006.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c9300006.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local res=false
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
if Duel.Destroy(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)==#mat1 then
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
res=true
end
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
res=true
end
end
end
function c9300006.sccon2(e)
return e:GetHandler()==Duel.GetFieldCard(e:GetHandlerPlayer(),LOCATION_PZONE,1) and not e:GetHandler():IsDisabled()
end
function c9300006.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function c9300006.spfilter(c,e,tp,dc)
return c:GetOriginalType()&TYPE_RITUAL~=0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and c:GetLevel()==dc
end
function c9300006.op2(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.TossDice(tp,1)
local rec=dc*100
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c9300006.spfilter),tp,LOCATION_HAND+LOCATION_PZONE+LOCATION_GRAVE,0,nil,e,tp,dc)
if Duel.Recover(tp,rec,REASON_EFFECT)>0 and g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(9300006,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
function c9300006.matval(e,c)
return c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_TUNER)
end
function c9300006.hsyncon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_SYNCHRO and c9300006.matval(nil,c:GetReasonCard()) and c:IsPreviousLocation(LOCATION_HAND)
end
function c9300006.hsynreg(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():UseCountLimit(tp)
end
function c9300006.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_RITUAL) then return end
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9300006,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetCountLimit(1,9300006)
e2:SetValue(c9300006.pendvalue)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c9300006.pendvalue(e,c)
return c:IsLocation(LOCATION_EXTRA)
end
function c9300006.cfilter(c,tp)
return c:IsFaceup() and c:IsLinkAbove(3) and c:IsSummonType(SUMMON_TYPE_LINK) and c:IsSummonPlayer(tp)
end
function c9300006.pencon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c9300006.cfilter,1,nil,tp)
end
function c9300006.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
Duel.SetOperationInfo(0,0,e:GetHandler(),1,0,0)
end
function c9300006.penop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--褪去繁华
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
function s.tgfilter1(c,e,tp)
return c:IsFaceup() and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function s.spfilter(c,e,tp,mc)
return (not c:IsType(TYPE_EFFECT)) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false,POS_FACEUP,c:GetControler()) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tp=e:GetHandler():GetControler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.tgfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.tgfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
local tgp=tc:GetControler()
local code=tc:GetCode()
local att=tc:GetAttribute()
local rac=tc:GetRace()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tgp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(rac)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e3:SetValue(att)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e3)
sc:CompleteProcedure()
end
end
--再来一杯
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_DRAW)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--to decktop
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetTarget(s.dttg)
e2:SetOperation(s.dtop)
c:RegisterEffect(e2)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function s.dttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
end
function s.dtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,1,nil)
local tg=g:GetFirst()
if tg==nil then return end
if Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_EFFECT)
end
end
\ No newline at end of file
--功能性饮料 原汁不原味
local s,id=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.tg1)
e1:SetOperation(s.op1)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
--
function s.cfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,tc)
e:SetLabelObject(tc)
end
function s.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=e:GetLabel()==100
e:SetLabel(0)
return res
and Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),0,0x3286,1800,1200,4,nil,nil)
and not c:IsLocation(LOCATION_MZONE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function s.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local att=tc:GetAttribute()
local rac=tc:GetRace()
if Duel.GetMZoneCount(tp)<1 then return end
if not c:IsRelateToEffect(e) then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),0,0x3286,1800,1200,4,nil,nil) then
c:AddMonsterAttribute(TYPE_NORMAL,att)
if Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)~=0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(rac)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e3:SetValue(att)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3)
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
end
end
end
---
function s.refilter(c)
return c:IsAbleToRemove() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() and Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.refilter,tp,LOCATION_DECK,0,1,1,nil)
local tg=g:GetFirst()
if Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment