Commit cbb95e3a authored by Momobako's avatar Momobako

灵依bug修复

parent de65c36b
--灵依法师-升灵 --灵依法师-升灵
function c50000200.initial_effect(c) function c50000200.initial_effect(c)
--pendulum summon --pendulum summon
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--SUMMON_TYPE_RITUAL --SUMMON_TYPE_RITUAL
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(50000200,0)) e1:SetDescription(aux.Stringid(50000200,0))
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(c50000200.target) e1:SetTarget(c50000200.target)
e1:SetOperation(c50000200.operation) e1:SetOperation(c50000200.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--pzone sp --pzone sp
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50000200,1)) e2:SetDescription(aux.Stringid(50000200,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,50000200) e2:SetCountLimit(1,50000200)
e2:SetCost(c50000200.spcost) e2:SetCost(c50000200.spcost)
e2:SetTarget(c50000200.sptg) e2:SetTarget(c50000200.sptg)
e2:SetOperation(c50000200.spop) e2:SetOperation(c50000200.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--hand sp --hand sp
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetDescription(aux.Stringid(50000200,2)) e3:SetDescription(aux.Stringid(50000200,2))
e3:SetCode(EFFECT_SPSUMMON_PROC) e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE) e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND) e3:SetRange(LOCATION_HAND)
e3:SetCondition(c50000200.spcon) e3:SetCondition(c50000200.spcon)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand --tohand
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50000200,3)) e4:SetDescription(aux.Stringid(50000200,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_RELEASE) e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,500002001) e4:SetCountLimit(1,500002001)
e4:SetTarget(c50000200.thtg) e4:SetTarget(c50000200.thtg)
e4:SetOperation(c50000200.thop) e4:SetOperation(c50000200.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
c50000200.is_named_with_Rely=1 c50000200.is_named_with_Rely=1
function c50000200.IsRely(c) function c50000200.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
--SUMMON_TYPE_RITUAL --SUMMON_TYPE_RITUAL
function c50000200.ritual_filter(c) function c50000200.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end end
function c50000200.filter(c,e,tp,m,ft) function c50000200.filter(c,e,tp,m,ft)
if not c50000200.ritual_filter(c) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if not c50000200.ritual_filter(c) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end
if ft>0 then if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
else else
return mg:IsExists(c50000200.mfilterf,1,nil,tp,mg,c) return mg:IsExists(c50000200.mfilterf,1,nil,tp,mg,c)
end end
end end
function c50000200.mfilterf(c,tp,mg,rc) function c50000200.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then
Duel.SetSelectedCard(c) Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc) return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
else return false end else return false end
end end
function c50000200.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50000200.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c50000200.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft) return ft>-1 and Duel.IsExistingMatchingCard(c50000200.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c50000200.operation(e,tp,eg,ep,ev,re,r,rp) function c50000200.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c50000200.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,c50000200.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc:IsCode(21105106) then if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg) tc:ritual_custom_operation(mg)
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
else else
local mat=nil local mat=nil
if ft>0 then if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c50000200.mfilterf,1,1,nil,tp,mg,tc) mat=mg:FilterSelect(tp,c50000200.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat) Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc) local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
mat:Merge(mat2) mat:Merge(mat2)
end end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end end
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
--pzone sp --pzone sp
function c50000200.cfilter(c) function c50000200.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end end
function c50000200.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c50000200.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c50000200.cfilter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(tp,c50000200.cfilter,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.SelectReleaseGroup(tp,c50000200.cfilter,1,1,nil) local g=Duel.SelectReleaseGroup(tp,c50000200.cfilter,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c50000200.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000200.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if not e:GetHandler():IsRelateToEffect(e) then return end
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
function c50000200.spop(e,tp,eg,ep,ev,re,r,rp) end
local c=e:GetHandler() function c50000200.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end local c=e:GetHandler()
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if not c:IsRelateToEffect(e) then return end
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
Duel.SendtoGrave(c,REASON_RULE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
end Duel.SendtoGrave(c,REASON_RULE)
end end
--hand sp end
function c50000200.hspfilter(c) --hand sp
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) function c50000200.hspfilter(c)
end return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
function c50000200.spcon(e,c) end
if c==nil then return true end function c50000200.spcon(e,c)
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 if c==nil then return true end
and Duel.IsExistingMatchingCard(c50000200.hspfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end and Duel.IsExistingMatchingCard(c50000200.hspfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
--to hand end
function c50000200.thfilter(c) --to hand
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and (c:IsType(TYPE_RITUAL) or c:IsType(TYPE_PENDULUM)) and not c:IsCode(50000200) and c:IsAbleToHand() function c50000200.thfilter(c)
end return c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and (c:IsType(TYPE_RITUAL) or c:IsType(TYPE_PENDULUM)) and not c:IsCode(50000200) and c:IsAbleToHand()
function c50000200.thtg(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return Duel.IsExistingMatchingCard(c50000200.thfilter,tp,LOCATION_DECK,0,1,nil) end function c50000200.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) if chk==0 then return Duel.IsExistingMatchingCard(c50000200.thfilter,tp,LOCATION_DECK,0,1,nil) end
end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
function c50000200.thop(e,tp,eg,ep,ev,re,r,rp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) function c50000200.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c50000200.thfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
if g:GetCount()>0 then local g=Duel.SelectMatchingCard(tp,c50000200.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT) if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g) Duel.SendtoHand(g,nil,REASON_EFFECT)
end Duel.ConfirmCards(1-tp,g)
end
end end
\ No newline at end of file
--灵依法师-降灵 --灵依法师-降灵
function c50000201.initial_effect(c) function c50000201.initial_effect(c)
--pendulum summon --pendulum summon
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--SUMMON_TYPE_RITUAL --SUMMON_TYPE_RITUAL
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(50000201,0)) e1:SetDescription(aux.Stringid(50000201,0))
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(c50000201.target) e1:SetTarget(c50000201.target)
e1:SetOperation(c50000201.operation) e1:SetOperation(c50000201.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--atk-def up --atk-def up
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50000201,1)) e2:SetDescription(aux.Stringid(50000201,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,50000201) e2:SetCountLimit(1,50000201)
e2:SetCost(c50000201.adcost) e2:SetCost(c50000201.adcost)
e2:SetTarget(c50000201.adtg) e2:SetTarget(c50000201.adtg)
e2:SetOperation(c50000201.adop) e2:SetOperation(c50000201.adop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tohand --tohand
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50000201,2)) e3:SetDescription(aux.Stringid(50000201,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetTarget(c50000201.thtg) e3:SetTarget(c50000201.thtg)
e3:SetOperation(c50000201.thop) e3:SetOperation(c50000201.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand --tohand
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50000201,3)) e4:SetDescription(aux.Stringid(50000201,3))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_RELEASE) e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,500002011) e4:SetCountLimit(1,500002011)
e4:SetTarget(c50000201.sptg) e4:SetTarget(c50000201.sptg)
e4:SetOperation(c50000201.spop) e4:SetOperation(c50000201.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
c50000201.is_named_with_Rely=1 c50000201.is_named_with_Rely=1
function c50000201.IsRely(c) function c50000201.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
--SUMMON_TYPE_RITUAL --SUMMON_TYPE_RITUAL
function c50000201.ritual_filter(c) function c50000201.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end end
function c50000201.filter(c,e,tp,m,ft) function c50000201.filter(c,e,tp,m,ft)
if not c50000201.ritual_filter(c) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if not c50000201.ritual_filter(c) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end
if ft>0 then if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
else else
return mg:IsExists(c50000201.mfilterf,1,nil,tp,mg,c) return mg:IsExists(c50000201.mfilterf,1,nil,tp,mg,c)
end end
end end
function c50000201.mfilterf(c,tp,mg,rc) function c50000201.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then
Duel.SetSelectedCard(c) Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc) return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
else return false end else return false end
end end
function c50000201.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50000201.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c50000201.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg,ft) return ft>-1 and Duel.IsExistingMatchingCard(c50000201.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function c50000201.operation(e,tp,eg,ep,ev,re,r,rp) function c50000201.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c50000201.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,c50000201.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc:IsCode(21105106) then if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg) tc:ritual_custom_operation(mg)
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
else else
local mat=nil local mat=nil
if ft>0 then if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c50000201.mfilterf,1,1,nil,tp,mg,tc) mat=mg:FilterSelect(tp,c50000201.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat) Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc) local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
mat:Merge(mat2) mat:Merge(mat2)
end end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end end
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
--atk-def up --atk-def up
function c50000201.cfilter(c) function c50000201.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end end
function c50000201.adcost(e,tp,eg,ep,ev,re,r,rp,chk) function c50000201.adcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c50000201.cfilter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(tp,c50000201.cfilter,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.SelectReleaseGroup(tp,c50000201.cfilter,1,1,nil) local g=Duel.SelectReleaseGroup(tp,c50000201.cfilter,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c50000201.adtg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000201.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50000201.cfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c50000201.cfilter,tp,LOCATION_MZONE,0,1,nil) end
end end
function c50000201.adop(e,tp,eg,ep,ev,re,r,rp) function c50000201.adop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c50000201.cfilter,tp,LOCATION_MZONE,0,nil) if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=g:GetFirst() local g=Duel.GetMatchingGroup(c50000201.cfilter,tp,LOCATION_MZONE,0,nil)
while tc do local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) while tc do
e1:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetValue(800) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(800)
tc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+0x1fe0000)
local e2=e1:Clone() tc:RegisterEffect(e1)
e2:SetCode(EFFECT_UPDATE_DEFENSE) local e2=e1:Clone()
tc:RegisterEffect(e2) e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc=g:GetNext() tc:RegisterEffect(e2)
end tc=g:GetNext()
end end
--thand end
function c50000201.thfilter(c) --thand
return c50000201.IsRely(c) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() function c50000201.thfilter(c)
end return c50000201.IsRely(c) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
function c50000201.thtg(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return Duel.IsExistingMatchingCard(c50000201.thfilter,tp,LOCATION_DECK,0,1,nil) end function c50000201.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) if chk==0 then return Duel.IsExistingMatchingCard(c50000201.thfilter,tp,LOCATION_DECK,0,1,nil) end
end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
function c50000201.thop(e,tp,eg,ep,ev,re,r,rp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) function c50000201.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c50000201.thfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
if g:GetCount()>0 then local g=Duel.SelectMatchingCard(tp,c50000201.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT) if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g) Duel.SendtoHand(g,nil,REASON_EFFECT)
end Duel.ConfirmCards(1-tp,g)
end end
--hdsp end
function c50000201.sdfilter(c,e,tp) --hdsp
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false) function c50000201.sdfilter(c,e,tp)
end return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false)
function c50000201.sptg(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 function c50000201.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(c50000201.sdfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) and Duel.IsExistingMatchingCard(c50000201.sdfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
function c50000201.spop(e,tp,eg,ep,ev,re,r,rp) end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end function c50000201.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.SelectMatchingCard(tp,c50000201.sdfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:GetFirst() local g=Duel.SelectMatchingCard(tp,c50000201.sdfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then local sc=g:GetFirst()
Duel.SpecialSummon(g,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP) if g:GetCount()>0 then
sc:CompleteProcedure() Duel.SpecialSummon(g,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
end sc:CompleteProcedure()
end
end end
\ No newline at end of file
--灵依魔法·增援 --灵依魔法·增援
function c50000202.initial_effect(c) function c50000202.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,50000202+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,50000202+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c50000202.cost) e1:SetCost(c50000202.cost)
e1:SetTarget(c50000202.target) e1:SetTarget(c50000202.target)
e1:SetOperation(c50000202.operation) e1:SetOperation(c50000202.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c50000202.is_named_with_Rely=1 c50000202.is_named_with_Rely=1
function c50000202.IsRely(c) function c50000202.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
function c50000202.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c50000202.cost(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 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,e:GetHandler()) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end end
function c50000202.filter1(c) function c50000202.filter1(c)
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand() return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end end
function c50000202.filter2(c) function c50000202.filter2(c)
return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand() return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end end
function c50000202.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50000202.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50000202.filter1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c50000202.filter2,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c50000202.filter1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c50000202.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end end
function c50000202.operation(e,tp,eg,ep,ev,re,r,rp) function c50000202.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50000202.filter1,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c50000202.filter1,tp,LOCATION_DECK,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,c50000202.filter2,tp,LOCATION_DECK,0,1,1,nil) local g1=Duel.SelectMatchingCard(tp,c50000202.filter2,tp,LOCATION_DECK,0,1,1,nil)
g:Merge(g1) g:Merge(g1)
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)
end end
end end
\ No newline at end of file
--灵依法师-灵灭 --灵依法师-灵灭
function c50000203.initial_effect(c) function c50000203.initial_effect(c)
--pendulum summon --pendulum summon
aux.EnablePendulumAttribute(c) aux.EnablePendulumAttribute(c)
--tohand --tohand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetDescription(aux.Stringid(50000203,0)) e1:SetDescription(aux.Stringid(50000203,0))
e1:SetCode(EVENT_TO_DECK) e1:SetCode(EVENT_TO_DECK)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(c50000203.thcon) e1:SetCondition(c50000203.thcon)
e1:SetTarget(c50000203.thtg) e1:SetTarget(c50000203.thtg)
e1:SetOperation(c50000203.thop) e1:SetOperation(c50000203.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Remove Monster --Remove Monster
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_REMOVE) e2:SetCategory(CATEGORY_REMOVE)
e2:SetDescription(aux.Stringid(50000203,1)) e2:SetDescription(aux.Stringid(50000203,1))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,50000203) e2:SetCountLimit(1,50000203)
e2:SetCost(c50000203.cost) e2:SetCost(c50000203.cost)
e2:SetTarget(c50000203.target) e2:SetTarget(c50000203.target)
e2:SetOperation(c50000203.activate) e2:SetOperation(c50000203.activate)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--ritual level --ritual level
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_RITUAL_LEVEL) e3:SetCode(EFFECT_RITUAL_LEVEL)
e3:SetValue(c50000203.rlevel) e3:SetValue(c50000203.rlevel)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--Remove --Remove
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_REMOVE) e4:SetCategory(CATEGORY_REMOVE)
e4:SetDescription(aux.Stringid(50000203,2)) e4:SetDescription(aux.Stringid(50000203,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_RELEASE) e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,500002031) e4:SetCountLimit(1,500002031)
e4:SetTarget(c50000203.retg) e4:SetTarget(c50000203.retg)
e4:SetOperation(c50000203.reop) e4:SetOperation(c50000203.reop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
c50000203.is_named_with_Rely=1 c50000203.is_named_with_Rely=1
function c50000203.IsRely(c) function c50000203.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
function c50000203.thfilter(c,tp) function c50000203.thfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_EXTRA) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_EXTRA) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousLocation(LOCATION_ONFIELD)
end end
function c50000203.thcon(e,tp,eg,ep,ev,re,r,rp) function c50000203.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c50000203.thfilter,1,nil,tp) return eg:IsExists(c50000203.thfilter,1,nil,tp)
end end
function c50000203.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000203.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g=eg:Filter(c50000203.thfilter,nil,tp) local g=eg:Filter(c50000203.thfilter,nil,tp)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function c50000203.thop(e,tp,eg,ep,ev,re,r,rp) function c50000203.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local rg=g:Select(tp,1,1,nil) local rg=g:Select(tp,1,1,nil)
if rg:GetCount()>0 then if rg:GetCount()>0 then
Duel.SendtoHand(rg,nil,REASON_EFFECT) Duel.SendtoHand(rg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,rg) Duel.ConfirmCards(1-tp,rg)
end end
end end
--remove --remove
function c50000203.cfilter(c) function c50000203.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end end
function c50000203.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c50000203.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c50000203.cfilter,1,nil) end if chk==0 then return Duel.CheckReleaseGroup(tp,c50000203.cfilter,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.SelectReleaseGroup(tp,c50000203.cfilter,1,1,nil) local g=Duel.SelectReleaseGroup(tp,c50000203.cfilter,1,1,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c50000203.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c50000203.target(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:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c50000203.activate(e,tp,eg,ep,ev,re,r,rp) function c50000203.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() if not e:GetHandler():IsRelateToEffect(e) then return end
if tc:IsRelateToEffect(e) then local tc=Duel.GetFirstTarget()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) if tc:IsRelateToEffect(e) then
end Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end end
--ritual level end
function c50000203.rlevel(e,c) --ritual level
local lv=e:GetHandler():GetLevel() function c50000203.rlevel(e,c)
if c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) then local lv=e:GetHandler():GetLevel()
local clv=c:GetLevel() if c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) then
return lv*65536+clv local clv=c:GetLevel()
else return lv end return lv*65536+clv
end else return lv end
--remove s+t end
function c50000203.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) --remove s+t
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end function c50000203.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_SZONE,1,nil) end if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_SZONE,1,nil) end
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_SZONE,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_SZONE,1,1,nil)
end Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
function c50000203.reop(e,tp,eg,ep,ev,re,r,rp) end
local tc=Duel.GetFirstTarget() function c50000203.reop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then local tc=Duel.GetFirstTarget()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) if tc:IsRelateToEffect(e) then
end Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end end
\ No newline at end of file
--灵依魔法·灵依 --灵依魔法·灵依
function c50000204.initial_effect(c) function c50000204.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c50000204.target) e1:SetTarget(c50000204.target)
e1:SetOperation(c50000204.operation) e1:SetOperation(c50000204.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c50000204.thcon) e2:SetCondition(c50000204.thcon)
e2:SetTarget(c50000204.thtg) e2:SetTarget(c50000204.thtg)
e2:SetOperation(c50000204.thop) e2:SetOperation(c50000204.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
c50000204.is_named_with_Rely=1 c50000204.is_named_with_Rely=1
function c50000204.IsRely(c) function c50000204.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
function c50000204.ritual_filter(c) function c50000204.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end end
function c50000204.filter(c,e,tp,m,ft) function c50000204.filter(c,e,tp,m,ft)
if not c50000204.ritual_filter(c) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if not c50000204.ritual_filter(c) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end
if ft>0 then if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
else else
return mg:IsExists(c50000204.mfilterf,1,nil,tp,mg,c) return mg:IsExists(c50000204.mfilterf,1,nil,tp,mg,c)
end end
end end
function c50000204.mfilterf(c,tp,mg,rc) function c50000204.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) then
Duel.SetSelectedCard(c) Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc) return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
else return false end else return false end
end end
function c50000204.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50000204.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c50000204.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg,ft) return ft>-1 and Duel.IsExistingMatchingCard(c50000204.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c50000204.operation(e,tp,eg,ep,ev,re,r,rp) function c50000204.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c50000204.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,c50000204.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc:IsCode(21105106) then if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg) tc:ritual_custom_operation(mg)
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
else else
local mat=nil local mat=nil
if ft>0 then if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c50000204.mfilterf,1,1,nil,tp,mg,tc) mat=mg:FilterSelect(tp,c50000204.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat) Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc) local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
mat:Merge(mat2) mat:Merge(mat2)
end end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
end end
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
function c50000204.thfilter(c,tp) function c50000204.thfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end end
function c50000204.thcon(e,tp,eg,ep,ev,re,r,rp) function c50000204.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c50000204.thfilter,1,nil,tp) return eg:IsExists(c50000204.thfilter,1,nil,tp)
end end
function c50000204.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000204.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end end
function c50000204.thop(e,tp,eg,ep,ev,re,r,rp) function c50000204.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end end
end end
\ No newline at end of file
--灵依法师-幻灵 --灵依法师-幻灵
function c50000205.initial_effect(c) function c50000205.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.ritlimit) e1:SetValue(aux.ritlimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50000205,0)) e2:SetDescription(aux.Stringid(50000205,0))
e2:SetCategory(CATEGORY_TODECK) e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,50000205) e2:SetCountLimit(1,50000205)
e2:SetCondition(c50000205.tdcon) e2:SetCondition(c50000205.tdcon)
e2:SetTarget(c50000205.tdtg) e2:SetTarget(c50000205.tdtg)
e2:SetOperation(c50000205.tdop) e2:SetOperation(c50000205.tdop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--search --search
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50000205,1)) e3:SetDescription(aux.Stringid(50000205,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,500002051) e3:SetCountLimit(1,500002051)
e3:SetCondition(c50000205.thcon) e3:SetCondition(c50000205.thcon)
e3:SetTarget(c50000205.thtg) e3:SetTarget(c50000205.thtg)
e3:SetOperation(c50000205.thop) e3:SetOperation(c50000205.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
c50000205.is_named_with_Rely=1 c50000205.is_named_with_Rely=1
function c50000205.IsRely(c) function c50000205.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
--ritual effect --ritual effect
function c50000205.tdcon(e,tp,eg,ep,ev,re,r,rp) function c50000205.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end end
function c50000205.filter(c) function c50000205.filter(c)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsAbleToDeck() return c:GetSummonLocation()==LOCATION_EXTRA and c:IsAbleToDeck()
end end
function c50000205.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000205.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50000205.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c50000205.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c50000205.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c50000205.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end end
function c50000205.tdop(e,tp,eg,ep,ev,re,r,rp) function c50000205.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c50000205.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c50000205.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,0,REASON_EFFECT) Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
end end
end end
--tohand --tohand
function c50000205.thcon(e,tp,eg,ep,ev,re,r,rp) function c50000205.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL) return c:IsPreviousLocation(LOCATION_MZONE) and c:GetSummonType()==SUMMON_TYPE_RITUAL
end end
function c50000205.thfilter(c) function c50000205.thfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand() return c:IsType(TYPE_PENDULUM) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end end
function c50000205.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000205.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50000205.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c50000205.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c50000205.thop(e,tp,eg,ep,ev,re,r,rp) function c50000205.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50000205.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c50000205.thfilter,tp,LOCATION_DECK,0,1,1,nil)
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)
end end
end end
\ No newline at end of file
--灵依法师-解灵 --灵依法师-解灵
function c50000206.initial_effect(c) function c50000206.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.ritlimit) e1:SetValue(aux.ritlimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50000206,0)) e2:SetDescription(aux.Stringid(50000206,0))
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,50000206) e2:SetCountLimit(1,50000206)
e2:SetCondition(c50000206.thcon) e2:SetCondition(c50000206.thcon)
e2:SetTarget(c50000206.thtg) e2:SetTarget(c50000206.thtg)
e2:SetOperation(c50000206.thop) e2:SetOperation(c50000206.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--search --search
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50000206,1)) e3:SetDescription(aux.Stringid(50000206,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,500002061) e3:SetCountLimit(1,500002061)
e3:SetCondition(c50000206.secon) e3:SetCondition(c50000206.secon)
e3:SetTarget(c50000206.setg) e3:SetTarget(c50000206.setg)
e3:SetOperation(c50000206.seop) e3:SetOperation(c50000206.seop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
c50000206.is_named_with_Rely=1 c50000206.is_named_with_Rely=1
function c50000206.IsRely(c) function c50000206.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
--ritual effect --ritual effect
function c50000206.thcon(e,tp,eg,ep,ev,re,r,rp) function c50000206.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end end
function c50000206.filter(c) function c50000206.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function c50000206.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000206.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c50000206.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end if chk==0 then return Duel.IsExistingMatchingCard(c50000206.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(c50000206.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) local sg=Duel.GetMatchingGroup(c50000206.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
end end
function c50000206.thop(e,tp,eg,ep,ev,re,r,rp) function c50000206.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c50000206.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) local sg=Duel.GetMatchingGroup(c50000206.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
end end
--tohand --tohand
function c50000206.secon(e,tp,eg,ep,ev,re,r,rp) function c50000206.secon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL) return c:IsPreviousLocation(LOCATION_MZONE) and c:GetSummonType()==SUMMON_TYPE_RITUAL
end end
function c50000206.sefilter(c) function c50000206.sefilter(c)
return c:IsType(TYPE_SPELL) and c50000206.IsRely(c) and c:IsAbleToHand() return c:IsType(TYPE_SPELL) and c50000206.IsRely(c) and c:IsAbleToHand()
end end
function c50000206.setg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000206.setg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50000206.sefilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c50000206.sefilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c50000206.seop(e,tp,eg,ep,ev,re,r,rp) function c50000206.seop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50000206.sefilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c50000206.sefilter,tp,LOCATION_DECK,0,1,1,nil)
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)
end end
end end
\ No newline at end of file
--灵依法师-涂灵 --灵依法师-涂灵
function c50000207.initial_effect(c) function c50000207.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.ritlimit) e1:SetValue(aux.ritlimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50000207,0)) e2:SetDescription(aux.Stringid(50000207,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,50000207) e2:SetCountLimit(1,50000207)
e2:SetCondition(c50000207.tdcon) e2:SetCondition(c50000207.tdcon)
e2:SetTarget(c50000207.tdtg) e2:SetTarget(c50000207.tdtg)
e2:SetOperation(c50000207.tdop) e2:SetOperation(c50000207.tdop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--search or sp --search or sp
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50000207,1)) e3:SetDescription(aux.Stringid(50000207,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c50000207.con) e3:SetCondition(c50000207.con)
e3:SetCountLimit(1,500002071) e3:SetCountLimit(1,500002071)
e3:SetTarget(c50000207.tg) e3:SetTarget(c50000207.tg)
e3:SetOperation(c50000207.op) e3:SetOperation(c50000207.op)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--immune --immune
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_IMMUNE_EFFECT) e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(c50000207.efilter) e4:SetValue(c50000207.efilter)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--indes --indes
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE) e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e5:SetValue(c50000207.indval) e5:SetValue(c50000207.indval)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
c50000207.is_named_with_Rely=1 c50000207.is_named_with_Rely=1
function c50000207.IsRely(c) function c50000207.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
--ritual effect --ritual effect
function c50000207.tdcon(e,tp,eg,ep,ev,re,r,rp) function c50000207.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end end
function c50000207.filter(c) function c50000207.filter1(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsAbleToDeck() return c:GetSummonType()==SUMMON_TYPE_SPECIAL and c:IsAbleToDeck()
end end
function c50000207.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000207.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50000207.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c50000207.filter1,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c50000207.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c50000207.filter1,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1500)
end end
function c50000207.tdop(e,tp,eg,ep,ev,re,r,rp) function c50000207.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c50000207.filter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c50000207.filter1,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,0,REASON_EFFECT) Duel.SendtoDeck(g,nil,3,REASON_EFFECT)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Damage(1-tp,1500,REASON_EFFECT) Duel.Damage(1-tp,1500,REASON_EFFECT)
end end
end end
--se or sp --se or sp
function c50000207.con(e,tp,eg,ep,ev,re,r,rp) function c50000207.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL) return c:IsPreviousLocation(LOCATION_MZONE) and c:GetSummonType()==SUMMON_TYPE_RITUAL
end end
function c50000207.filter(c,ft,e,tp) function c50000207.filter(c,ft,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end end
function c50000207.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c50000207.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.IsExistingMatchingCard(c50000207.filter,tp,LOCATION_DECK,0,1,nil,ft,e,tp) return Duel.IsExistingMatchingCard(c50000207.filter,tp,LOCATION_DECK,0,1,nil,ft,e,tp)
end end
end end
function c50000207.op(e,tp,eg,ep,ev,re,r,rp) function c50000207.op(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,0)
local g=Duel.SelectMatchingCard(tp,c50000207.filter,tp,LOCATION_DECK,0,1,1,nil,ft,e,tp) local g=Duel.SelectMatchingCard(tp,c50000207.filter,tp,LOCATION_DECK,0,1,1,nil,ft,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
local th=g:GetFirst():IsAbleToHand() local th=g:GetFirst():IsAbleToHand()
local sp=ft>0 and g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false) local sp=ft>0 and g:GetFirst():IsCanBeSpecialSummoned(e,0,tp,false,false)
local op=0 local op=0
if th and sp then op=Duel.SelectOption(tp,aux.Stringid(50000207,2),aux.Stringid(50000207,3)) if th and sp then op=Duel.SelectOption(tp,aux.Stringid(50000207,2),aux.Stringid(50000207,3))
elseif th then op=0 elseif th then op=0
else op=1 end else op=1 end
if op==0 then if op==0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
else else
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end end
-- --
function c50000207.indval(e,c) function c50000207.indval(e,c)
return c:GetSummonLocation()==LOCATION_EXTRA return c:GetSummonLocation()==LOCATION_EXTRA
end end
function c50000207.efilter(e,te) function c50000207.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetHandler():GetSummonLocation()==LOCATION_EXTRA return te:IsActiveType(TYPE_MONSTER) and te:GetHandler():GetSummonLocation()==LOCATION_EXTRA
end end
\ No newline at end of file
--灵依魔法·唤灵 --灵依魔法·唤灵
function c50000208.initial_effect(c) function c50000208.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c50000208.condition) e1:SetCondition(c50000208.condition)
e1:SetCost(c50000208.cost) e1:SetCost(c50000208.cost)
e1:SetTarget(c50000208.target) e1:SetTarget(c50000208.target)
e1:SetOperation(c50000208.activate) e1:SetOperation(c50000208.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c50000208.is_named_with_Rely=1 c50000208.is_named_with_Rely=1
function c50000208.IsRely(c) function c50000208.IsRely(c)
local code=c:GetCode() local code=c:GetCode()
local mt=_G["c"..code] local mt=_G["c"..code]
if not mt then if not mt then
_G["c"..code]={} _G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code] mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
else else
_G["c"..code]=nil _G["c"..code]=nil
return false return false
end end
end end
return mt and mt.is_named_with_Rely return mt and mt.is_named_with_Rely
end end
function c50000208.condition(e,tp,eg,ep,ev,re,r,rp) function c50000208.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end end
function c50000208.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c50000208.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetLabelObject(e) e2:SetLabelObject(e)
e2:SetTarget(c50000208.splimit) e2:SetTarget(c50000208.splimit)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
function c50000208.splimit(e,c,sump,sumtype,sumpos,targetp,se) function c50000208.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se~=e:GetLabelObject() return se~=e:GetLabelObject()
end end
function c50000208.filter(c,e,tp) function c50000208.filter(c,e,tp)
return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) return c:IsType(TYPE_RITUAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true)
end end
function c50000208.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50000208.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c50000208.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c50000208.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c50000208.activate(e,tp,eg,ep,ev,re,r,rp) function c50000208.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c50000208.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c50000208.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end if not tc then return end
if Duel.SpecialSummon(g,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)~=0 then if Duel.SpecialSummon(g,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)~=0 then
tc:RegisterFlagEffect(50000208,RESET_EVENT+0x1fe0000,0,1) tc:RegisterFlagEffect(50000208,RESET_EVENT+0x1fe0000,0,1)
tc:CompleteProcedure() tc:CompleteProcedure()
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc) e2:SetLabelObject(tc)
e2:SetCondition(c50000208.descon) e2:SetCondition(c50000208.descon)
e2:SetOperation(c50000208.desop) e2:SetOperation(c50000208.desop)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
end end
function c50000208.descon(e,tp,eg,ep,ev,re,r,rp) function c50000208.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if tc:GetFlagEffect(50000208)~=0 then if tc:GetFlagEffect(50000208)~=0 then
return true return true
else else
e:Reset() e:Reset()
return false return false
end end
end end
function c50000208.desop(e,tp,eg,ep,ev,re,r,rp) function c50000208.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
\ No newline at end of file
--灵依法师-灵璇
local m=50000209
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetDescription(aux.Stringid(50000209,0))
e1:SetCode(EVENT_TO_DECK)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1)
e1:SetCondition(c50000209.drcon)
e1:SetTarget(c50000209.drtg)
e1:SetOperation(c50000209.drop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50000209,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,50000209)
e2:SetCost(c50000209.cost)
e2:SetTarget(c50000209.thtg)
e2:SetOperation(c50000209.thop)
c:RegisterEffect(e2)
--ritual level
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_RITUAL_LEVEL)
e3:SetValue(c50000209.rlevel)
c:RegisterEffect(e3)
--Remove
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetDescription(aux.Stringid(50000209,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,500002091)
e4:SetTarget(c50000209.thtg1)
e4:SetOperation(c50000209.thop1)
c:RegisterEffect(e4)
end
c50000209.is_named_with_Rely=1
function c50000209.IsRely(c)
local code=c:GetCode()
local mt=_G["c"..code]
if not mt then
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
mt=_G["c"..code]
_G["c"..code]=nil
else
_G["c"..code]=nil
return false
end
end
return mt and mt.is_named_with_Rely
end
function c50000209.drfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_EXTRA) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c50000209.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c50000209.drfilter,1,nil,tp)
end
function c50000209.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c50000209.drop(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 c50000209.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER)
end
function c50000209.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c50000209.cfilter,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.SelectReleaseGroup(tp,c50000209.cfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c50000209.filter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
end
function c50000209.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if not e:GetHandler():IsRelateToEffect(e) then return end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c50000209.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c50000209.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c50000209.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c50000209.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
--ritual level
function c50000209.rlevel(e,c)
local lv=e:GetHandler():GetLevel()
if c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_SPELLCASTER) then
local clv=c:GetLevel()
return lv*65536+clv
else return lv end
end
---
function c50000209.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c50000209.IsRely(c) and c:IsAbleToHand()
end
function c50000209.thtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c50000209.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c50000209.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c50000209.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c50000209.thop1(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
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