Commit 364e700c authored by POLYMER's avatar POLYMER

fix

parent 159fc787
No preview for this file type
--暗海
function Dark_Sea_counterfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER)
end
Duel.AddCustomActivityCounter(11633000,ACTIVITY_SPSUMMON,Dark_Sea_counterfilter)
function Dark_Sea_Effect(c,id)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_DECK)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCost(Dark_Sea_spcost)
e1:SetCondition(Dark_Sea_spcon)
e1:SetTarget(Dark_Sea_sptg)
e1:SetOperation(Dark_Sea_spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_ADJUST)
e2:SetCondition(Dark_Sea_pucon)
e2:SetOperation(Dark_Sea_puop)
c:RegisterEffect(e2)
end
function Dark_Sea_pucon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPublic()
end
function Dark_Sea_puop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
function Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(11633000,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:SetTarget(Dark_Sea_splimit)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function Dark_Sea_splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
function Dark_Sea_spfilter(c,e,tp,mg)
if bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) or not _G["c"..c:GetCode()].Is_Dark_Sea then return false end
local mg2=mg:Clone()
mg2:RemoveCard(c)
if c.mat_filter then
mg2=mg2:Filter(c.mat_filter,nil,tp)
end
return mg2:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
function Dark_Sea_matfilter(c)
return c:IsLevelAbove(1) and c:IsAbleToGrave() and _G["c"..c:GetCode()].Is_Dark_Sea
end
function Dark_Sea_spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function Dark_Sea_sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(Dark_Sea_matfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
if Duel.GetFlagEffect(tp,11633001)<2 then
mg=Duel.GetMatchingGroup(Dark_Sea_matfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_MZONE,0,nil)
end
if Duel.GetFlagEffect(tp,11633002)<1 then
return Duel.IsExistingMatchingCard(Dark_Sea_spfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg)
else
return Duel.IsExistingMatchingCard(Dark_Sea_spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg)
end
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function Dark_Sea_spop(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg=Duel.GetMatchingGroup(Dark_Sea_matfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
if Duel.GetFlagEffect(tp,11633001)<2 then
mg=Duel.GetMatchingGroup(Dark_Sea_matfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_MZONE,0,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Group.CreateGroup()
if Duel.GetFlagEffect(tp,11633002)<1 then
sg=Duel.SelectMatchingCard(tp,Dark_Sea_spfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
else
sg=Duel.SelectMatchingCard(tp,Dark_Sea_spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg)
end
if sg:GetCount()>0 then
local tc=sg:GetFirst()
mg:RemoveCard(tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,nil,tp)
end
local lv=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
aux.GCheckAdditional=function(sg) return sg:GetSum(Card.GetRitualLevel,tc)<=lv end
local mat=mg:SelectSubGroup(tp,aux.RitualCheckEqual,true,1,99,tc,lv)
aux.GCheckAdditional=nil
if not mat then goto cancel end
tc:SetMaterial(mat)
if mat:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.RegisterFlagEffect(tp,11633001,RESET_PHASE+PHASE_END,0,1) end
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect()
if tc:IsLocation(LOCATION_DECK) then Duel.RegisterFlagEffect(tp,11633002,RESET_PHASE+PHASE_END,0,1) end
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
\ No newline at end of file
--暗海的剑士
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+1)
e1:SetCost(Dark_Sea_spcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id+2)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(Dark_Sea_spcost)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
s.Is_Dark_Sea=true
function s.thfilter(c)
return _G["c"..c:GetCode()].Is_Dark_Sea 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) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,2,2,c)
if g:GetCount()==2 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
--暗海的枪兵
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,id+1)
e1:SetCost(s.tgcost)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e2:SetCountLimit(1,id+2)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(s.destg)
e2:SetCost(Dark_Sea_spcost)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
s.Is_Dark_Sea=true
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() and Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk) end
Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function s.tgfilter(c)
return _G["c"..c:GetCode()].Is_Dark_Sea and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function s.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--暗海的弓手
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id+1)
e1:SetCode(EVENT_TO_DECK)
e1:SetCost(Dark_Sea_spcost)
e1:SetCondition(s.drcon)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id+2)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(s.descost)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
end
s.Is_Dark_Sea=true
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() and Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk) end
Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function s.desfilter(c)
return _G["c"..c:GetCode()].Is_Dark_Sea and c:IsAbleToDeck()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_HAND)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()>0
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
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.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
\ No newline at end of file
--暗海的刺客
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+1)
e1:SetCost(Dark_Sea_spcost)
e1:SetTarget(s.tdtg)
e1:SetOperation(s.tdop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
end
s.Is_Dark_Sea=true
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,c)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.filter(c,tp)
return c:GetOwner()==1-tp
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,Duel.Damage(1-tp,eg:FilterCount(s.filter,nil,tp)*100,REASON_EFFECT),REASON_EFFECT)
end
\ No newline at end of file
--暗海的术士
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id+1)
e1:SetCost(Dark_Sea_spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER))
e2:SetValue(function (e)
return Duel.GetFlagEffect(0,id)*100
end)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_DECK)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
s.Is_Dark_Sea=true
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
Duel.RegisterFlagEffect(0,id,0,0,1)
tc=eg:GetNext()
end
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and _G["c"..c:GetCode()].Is_Dark_Sea
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.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 tc=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
--暗海的骑士
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id+1)
e1:SetCost(Dark_Sea_spcost)
e1:SetCondition(s.tdcon)
e1:SetTarget(s.tdtg)
e1:SetOperation(s.tdop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_TO_DECK)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
end
s.Is_Dark_Sea=true
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local num=eg:GetCount()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,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(function (e,c)
if c:IsControler(tp) then return num*100 else return -100*num end
end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
\ No newline at end of file
--暗海的狂人
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+1)
e1:SetCost(s.atkcost)
e1:SetCondition(s.atkcon)
e1:SetTarget(s.atktg)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--attack all
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetValue(1)
c:RegisterEffect(e2)
--effect limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetValue(s.aclimit)
c:RegisterEffect(e3)
end
s.Is_Dark_Sea=true
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() and Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk) end
Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function s.filter(c)
return c:IsFaceup() and _G["c"..c:GetCode()].Is_Dark_Sea
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(2000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetLabelObject(tc)
e2:SetCondition(s.shcon)
e2:SetOperation(s.shop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.regcon)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetBattleTarget() and r==REASON_BATTLE then
c:RegisterFlagEffect(id,RESET_PHASE+PHASE_DAMAGE,0,1)
end
return false
end
function s.shcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return eg:IsContains(tc) and tc:GetFlagEffect(id)~=0
end
function s.shfilter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function s.shop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.SendtoDeck(g:Select(tp,1,1,nil),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.aclimit(e,re,tp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
\ No newline at end of file
--暗海的圣裁
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
Dark_Sea_Effect(c,id)
--to hand
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+1)
e1:SetCost(Dark_Sea_spcost)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCost(s.atkcost)
e2:SetCondition(s.atkcon)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
end
s.Is_Dark_Sea=true
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function s.thfilter(c)
return _G["c"..c:GetCode()].Is_Dark_Sea 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+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if not bc then return false end
e:SetLabelObject(bc)
return bc:IsControler(1-tp) and bc:IsRelateToBattle()
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=e:GetLabelObject()
if chk==0 then return bc and c:GetFlagEffect(id)==0 and Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk) end
Dark_Sea_spcost(e,tp,eg,ep,ev,re,r,rp,chk)
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsFaceup() and bc:IsRelateToBattle() and bc:IsControler(1-tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(bc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
bc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(math.ceil(bc:GetDefense()/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
bc:RegisterEffect(e2)
end
end
\ No newline at end of file
--暗海的鲸脉
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_ADJUST)
e2:SetCondition(Dark_Sea_pucon)
e2:SetOperation(Dark_Sea_puop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_DECK)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id)
e3:SetCondition(Dark_Sea_spcon)
e3:SetOperation(s.addop)
c:RegisterEffect(e3)
end
s.Is_Dark_Sea=true
function s.drfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and bit.band(c:GetType(),0x81)==0x81
end
function s.drfilter2(c)
return _G["c"..c:GetCode()].Is_Dark_Sea and bit.band(c:GetType(),0x81)==0x81
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.drfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local dg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0):Filter(s.drfilter2,nil)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) and dg:GetCount()>=2 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,2-dg:GetCount(),nil) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_HAND)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0 then
Duel.BreakEffect()
local dg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0):Filter(s.drfilter2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local num=math.max(4-dg:GetCount(),0)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,num,99,nil)
if g:GetCount()>=num then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
function s.addop(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(tp,11633002)
if Duel.GetFlagEffect(tp,11633001)==2 then
Duel.ResetFlagEffect(tp,11633001)
Duel.RegisterFlagEffect(tp,11633001,RESET_PHASE+PHASE_END,0,1)
else
Duel.ResetFlagEffect(tp,11633001)
end
end
--浮于暗海的圣杯
if not require and loadfile then
function require(str)
require_list=require_list or {}
if not require_list[str] then
if string.find(str,"%.") then
require_list[str]=loadfile(str)
else
require_list[str]=loadfile(str..".lua")
end
require_list[str]()
return require_list[str]
end
return require_list[str]
end
end
if not require("expansions/script/c11633000") then require("expansions/script/c11633000") end
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_SEND_REPLACE)
e2:SetTarget(s.reptg)
e2:SetValue(s.repval)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EVENT_TO_DECK)
e3:SetCondition(s.drcon)
e3:SetOperation(s.drop)
c:RegisterEffect(e3)
end
s.Is_Dark_Sea=true
function s.filter(c)
return _G["c"..c:GetCode()].Is_Dark_Sea and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,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 s.repfilter(c,tp)
return c:IsLocation(LOCATION_ONFIELD) and c:GetDestination()==LOCATION_GRAVE and c:IsType(TYPE_MONSTER)
and c:IsAbleToHand()
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(id)==0 and bit.band(r,REASON_DESTROY)~=0 and eg:IsExists(s.repfilter,1,nil,tp) end
if Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
local g=eg:Filter(s.repfilter,nil,tp)
local ct=g:GetCount()
c:RegisterFlagEffect(id,RESET_PHASE+PHASE_END,0,1)
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
g=g:Select(tp,1,ct,nil)
end
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_DECK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
return true
else return false end
end
function s.repval(e,c)
return false
end
function s.drfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsPreviousPosition(POS_FACEUP)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.drfilter,1,nil)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:AddCounter(0x1162,1)
if c:IsCanRemoveCounter(tp,0x1162,6,REASON_EFFECT) then
c:RemoveCounter(tp,0x1162,6,REASON_EFFECT)
Duel.Draw(tp,3,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -86,7 +86,7 @@ function cm.LinkCondition(f,minc,maxc,gf)
if not aux.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_XMATERIAL)
if fg:IsExists(aux.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(aux.LCheckGoal,minc,maxc,tp,c,gf,lmat)
......@@ -115,7 +115,7 @@ function cm.LinkTarget(f,minc,maxc,gf)
if not aux.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=aux.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
......
......@@ -9,6 +9,8 @@ function s.initial_effect(c)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local sg=Group.CreateGroup()
sg:AddCard(Duel.CreateToken(tp,id))
Duel.ConfirmCards(1-tp,sg)
sg:AddCard(Duel.CreateToken(1-tp,id))
--Duel.ConfirmCards(1-tp,sg)
local code=sg:Select(1-tp,1,1,nil):GetOriginalCode()
Duel.Hint(HINT_CARD,0,code)
end
\ No newline at end of file
--星辉之星仪
function c9910602.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e2:SetCountLimit(1)
e2:SetCondition(c9910602.spcon)
e2:SetTarget(c9910602.sptg)
e2:SetOperation(c9910602.spop)
c:RegisterEffect(e2)
end
function c9910602.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity()
end
function c9910602.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_LINK)>0
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_EXTRA,0,1,nil)
and Duel.IsPlayerCanSpecialSummon(tp)
and (Duel.GetMZoneCount(tp)>0 or Duel.GetLocationCountFromEx(tp)>0) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
if b1 then
Duel.SetTargetParam(Duel.SelectOption(tp,1056,1063,1073,1076))
else
Duel.SetTargetParam(Duel.SelectOption(tp,1056,1063,1073))
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_EXTRA)
end
function c9910602.spop(e,tp,eg,ep,ev,re,r,rp)
local opt=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local ct=nil
if opt==0 then ct=TYPE_FUSION end
if opt==1 then ct=TYPE_SYNCHRO end
if opt==2 then ct=TYPE_XYZ end
if opt==3 then ct=TYPE_LINK end
if not Duel.IsPlayerCanSpecialSummon(tp)
or Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_EXTRA,0,nil)==0 then return end
Duel.ShuffleExtra(tp)
Duel.ConfirmExtratop(tp,1)
local tc=Duel.GetExtraTopGroup(tp,1):GetFirst()
if tc:IsType(ct) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
--星辉之星剑
function c9910603.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(c9910603.target)
e1:SetOperation(c9910603.activate)
c:RegisterEffect(e1)
end
function c9910603.rmfilter(c)
return c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) and c:IsAbleToRemove()
end
function c9910603.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c9910603.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9910603.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c9910603.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),PLAYER_ALL,LOCATION_GRAVE)
end
function c9910603.rfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c9910603.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_REMOVED)
local g1=Duel.GetMatchingGroup(c9910603.rfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if ct>=1 and g1:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9910603,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(9910603,3))
local sg=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9910603,4))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT+RESET_PHASE+PHASE_END)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1,true)
end
if ct>=2 and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(9910603,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
local g2=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,nil)
if ct==3 and g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9910603,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sg=g2:Select(tp,1,1,nil)
local tc=sg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
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)
tc:RegisterEffect(e3)
end
end
end
--星辉之星镜
function c9910604.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c9910604.target)
e1:SetOperation(c9910604.activate)
c:RegisterEffect(e1)
end
function c9910604.filter(c)
return c:IsCode(9910601) and c:IsAbleToHand()
end
function c9910604.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9910604.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c9910604.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c9910604.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--星辉之夜尽女神
function c9910626.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1)
e1:SetTarget(c9910626.mattg)
e1:SetOperation(c9910626.matop)
c:RegisterEffect(e1)
--tohand spell
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:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(c9910626.thcon)
e2:SetTarget(c9910626.thtg)
e2:SetOperation(c9910626.thop)
c:RegisterEffect(e2)
--tohand monster
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_REMOVE)
e3:SetCondition(c9910626.thcon2)
e3:SetOperation(c9910626.thop2)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c9910626.xfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c9910626.xfilter2(c,e)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and not c:IsImmuneToEffect(e)
end
function c9910626.mattg(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:IsCanOverlay() end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanOverlay,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c9910626.xfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,Card.IsCanOverlay,tp,0,LOCATION_MZONE,1,1,nil)
end
function c9910626.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
and Duel.IsExistingMatchingCard(c9910626.xfilter2,tp,LOCATION_MZONE,0,1,nil,e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=Duel.SelectMatchingCard(tp,c9910626.xfilter2,tp,LOCATION_MZONE,0,1,1,nil,e)
local sc=sg:GetFirst()
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(sc,Group.FromCards(tc))
end
end
function c9910626.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c9910626.thfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToHand()
end
function c9910626.thfilter2(c,e)
if bit.band(c:GetType(),0x82)~=0x82 or not c:IsAbleToHand() then return false end
local flag=0
local codes={}
table.insert(codes,e:GetLabel())
if #codes>0 then
for i=1,#codes do
if aux.IsCodeListed(c,codes[i]) then flag=1 end
end
end
return flag==1
end
function c9910626.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9910626.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9910626.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,c9910626.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
if not c:IsRelateToEffect(e) or not c:IsLocation(LOCATION_GRAVE) then return end
e:SetLabel(tc:GetOriginalCodeRule())
c:RegisterFlagEffect(9910626,RESET_EVENT+0x1e60000,0,1)
end
end
function c9910626.thcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup() and e:GetHandler():GetFlagEffect(9910626)~=0
end
function c9910626.thop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c9910626.thfilter2,tp,LOCATION_DECK,0,nil,e:GetLabelObject())
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9910626,0)) then
Duel.Hint(HINT_CARD,0,9910626)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--星辉之天察女神
function c9910628.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,10,2)
c:EnableReviveLimit()
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,9910628)
e1:SetCondition(c9910628.thcon)
e1:SetCost(c9910628.thcost)
e1:SetTarget(c9910628.thtg)
e1:SetOperation(c9910628.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCondition(c9910628.spcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c9910628.sptg)
e2:SetOperation(c9910628.spop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(9910628,ACTIVITY_CHAIN,c9910628.chainfilter)
end
function c9910628.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function c9910628.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(9910628,1-tp,ACTIVITY_CHAIN)~=0
end
function c9910628.thcost(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 c9910628.thfilter(c)
return ((c:IsSetCard(0x46) and c:IsType(TYPE_SPELL)) or c:IsType(TYPE_COUNTER)) and c:IsAbleToHand()
end
function c9910628.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9910628.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9910628.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c9910628.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 c9910628.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c9910628.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,nil,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c9910628.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil)
local tc=g:GetFirst()
if tc then
Duel.LinkSummon(tp,tc,nil)
end
end
--星辉之涅槃女神
function c9910630.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
aux.AddFusionProcFunRep(c,c9910630.ffilter,3,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c9910630.sprcon)
e2:SetOperation(c9910630.sprop)
c:RegisterEffect(e2)
--pendulum set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(c9910630.settg)
e3:SetOperation(c9910630.setop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_PZONE)
e4:SetCountLimit(1,9910631)
e4:SetCost(c9910630.rcost)
e4:SetTarget(c9910630.rtg)
e4:SetOperation(c9910630.rop)
c:RegisterEffect(e4)
if not c9910630.global_check then
c9910630.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c9910630.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c9910630.ffilter(c,fc,sub,mg,sg)
return not sg or sg:FilterCount(aux.TRUE,c)==0
or (sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())
and not sg:IsExists(Card.IsRace,1,c,c:GetRace()))
end
function c9910630.checkop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsActiveType(TYPE_MONSTER) then return end
local race=re:GetHandler():GetOriginalRace()
local labels={Duel.GetFlagEffectLabel(tp,9910631)}
local flag=0
for i=1,#labels do flag=bit.bor(flag,labels[i]) end
if bit.band(flag,race)==0 then
Duel.RegisterFlagEffect(tp,9910630,RESET_PHASE+PHASE_END,0,1)
end
Duel.RegisterFlagEffect(tp,9910631,RESET_PHASE+PHASE_END,0,1,race)
end
function c9910630.sprfilter1(c,sc)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end
function c9910630.sprfilter2(g,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 and g:GetClassCount(Card.GetRace)==3
and g:GetClassCount(Card.GetAttribute)==1
end
function c9910630.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c9910630.sprfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,c)
return Duel.GetFlagEffect(tp,9910630)>=3 and g:CheckSubGroup(c9910630.sprfilter2,3,3,tp,c)
end
function c9910630.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c9910630.sprfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,c9910630.sprfilter2,false,3,3,tp,c)
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c9910630.setfilter(c)
return c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
and (c:IsLocation(LOCATION_DECK) or c:IsFaceup())
end
function c9910630.settg(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))
and Duel.IsExistingMatchingCard(c9910630.setfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,1,nil) end
end
function c9910630.setop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c9910630.setfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c9910630.rcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c9910630.spfilter(c,e,tp,mc)
return bit.band(c:GetOriginalType(),0x81)==0x81 and (not c.mat_filter or c.mat_filter(mc,tp)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
end
function c9910630.rfilter2(c,lv,n)
if not n then n=0 end
return lv-n>=c:GetLevel()
end
function c9910630.filter(c,e,tp)
local sg=Duel.GetMatchingGroup(c9910630.spfilter,tp,LOCATION_HAND,0,c,e,tp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local lv=0
if c:GetLevel()>0 then lv=c:GetLevel()
elseif c:GetRank()>0 then lv=c:GetRank() end
return sg:IsExists(Card.IsLevelBelow,1,nil,lv)
end
function c9910630.mfilter(c)
return (c:GetLevel()>0 or c:GetRank()>0) and c:IsAbleToRemove()
end
function c9910630.rtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
local mg=Duel.GetMatchingGroup(c9910630.mfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,nil)
return mg:IsExists(c9910630.filter,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c9910630.rop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return end
local mg=Duel.GetMatchingGroup(c9910630.mfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local mat=mg:FilterSelect(tp,c9910630.filter,1,1,nil,e,tp)
local mc=mat:GetFirst()
if not mc then return end
local sg=Duel.GetMatchingGroup(c9910630.spfilter,tp,LOCATION_HAND,0,mc,e,tp,mc)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local lv=0
if mc:GetLevel()>0 then lv=mc:GetLevel()
elseif mc:GetRank()>0 then lv=mc:GetRank() end
if not sg:IsExists(Card.IsLevelBelow,1,nil,lv) then return end
local tg=Group.CreateGroup()
local n=0
while n<lv and tg:GetCount()<ft and (n==0 or sg:IsExists(c9910630.rfilter2,1,nil,lv,n) and Duel.SelectYesNo(tp,210)) do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rc=sg:FilterSelect(tp,c9910630.rfilter2,1,1,nil,lv,n):GetFirst()
tg:AddCard(rc)
n=n+rc:GetLevel()
sg:RemoveCard(rc)
end
for tc in aux.Next(tg) do
tc:SetMaterial(mat)
end
Duel.Remove(mat,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect()
for tc in aux.Next(tg) do
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
Duel.SpecialSummonComplete()
end
--星辉之极狱女神
function c9910633.initial_effect(c)
aux.EnablePendulumAttribute(c)
--revive limit
aux.EnableReviveLimitPendulumSummonable(c,LOCATION_HAND)
--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)
--token
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,9910633)
e1:SetTarget(c9910633.tktg)
e1:SetOperation(c9910633.tkop)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,9910634)
e2:SetTarget(c9910633.lvtg)
e2:SetOperation(c9910633.lvop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9910633,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_EXTRA)
e3:SetCountLimit(1,9910635)
e3:SetCondition(c9910633.thcon)
e3:SetTarget(c9910633.thtg)
e3:SetOperation(c9910633.thop)
c:RegisterEffect(e3)
end
function c9910633.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
local dis=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,0,0xe000e0)
Duel.SetTargetParam(dis)
Duel.Hint(HINT_ZONE,tp,dis)
end
function c9910633.tkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local dis=zone
if tp==1 then
dis=((zone&0xffff)<<16)|((zone>>16)&0xffff)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE_FIELD)
e1:SetValue(dis)
Duel.RegisterEffect(e1,tp)
zone=~zone&0xff
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,9910636,0,TYPES_TOKEN_MONSTER+TYPE_TUNER,1000,1000,1,RACE_ROCK,ATTRIBUTE_DARK)
and Duel.SelectYesNo(tp,aux.Stringid(9910633,0)) then
Duel.BreakEffect()
if Duel.Destroy(c,REASON_EFFECT)==0 then return end
local token=Duel.CreateToken(tp,9910636)
if token then Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP,zone) end
end
end
function c9910633.filter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c9910633.filter2(c,lv)
return not c:IsLevel(lv)
end
function c9910633.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c9910633.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
local ct={}
for i=2,10 do
if g:IsExists(c9910633.filter2,1,nil,i) then table.insert(ct,i) end
end
Duel.Hint(HINT_SELECTMSG,tp,HINGMSG_LVRANK)
local lv=Duel.AnnounceNumber(tp,table.unpack(ct))
e:SetLabel(lv)
end
function c9910633.lvop(e,tp,eg,ep,ev,re,r,rp)
local lv=e:GetLabel()
local g=Duel.GetMatchingGroup(c9910633.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c9910633.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup() and eg:IsExists(Card.IsType,1,nil,TYPE_TOKEN) and not eg:IsContains(e:GetHandler())
end
function c9910633.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c9910633.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,9910636))
e1:SetValue(1000)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e2,tp)
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