Commit aaf6b9a5 authored by fallenstardust's avatar fallenstardust

add 24pr、1204 script

parent ca539b0c
Pipeline #24021 passed with stages
in 50 seconds
--ミラァと燐寸之仔
function c100213001.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100213001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100213001)
e1:SetCost(c100213001.spcost)
e1:SetTarget(c100213001.sptg)
e1:SetOperation(c100213001.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100213001,1))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100213101)
e2:SetCondition(c100213001.negcon)
e2:SetCost(c100213001.negcost)
e2:SetTarget(c100213001.negtg)
e2:SetOperation(c100213001.negop)
c:RegisterEffect(e2)
end
function c100213001.cfilter(c,tp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,c:GetCode()) and not c:IsPublic()
end
function c100213001.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100213001.cfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,tp)
if chk==0 then return g:CheckSubGroup(aux.dncheck,3,3) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
end
function c100213001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100213001.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP)
end
function c100213001.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp and Duel.IsChainNegatable(ev)
end
function c100213001.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF and e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c100213001.filter(c,re)
return c:IsCode(re:GetHandler():GetCode()) and c:IsAbleToGrave()
end
function c100213001.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100213001.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,re) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA+LOCATION_EXTRA)
end
function c100213001.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100213001.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,re)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
Duel.NegateActivation(ev)
end
end
\ No newline at end of file
--三色零件
--code by lightup37
function c101204004.initial_effect(c)
aux.AddCodeList(c,101204051)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101204004,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101204004)
e1:SetTarget(c101204004.thtg)
e1:SetOperation(c101204004.thop)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--break
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101204004,2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c101204004.stcon)
e2:SetTarget(c101204004.sttg)
e2:SetOperation(c101204004.stop)
e2:SetCountLimit(1,101204004+100)
c:RegisterEffect(e2)
end
function c101204004.thfilter(c)
return ( ( aux.IsCodeListed(c,101204051) and ( c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP) ) ) or (c:IsCode(101204051)) ) and c:IsAbleToHand()
end
function c101204004.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(c101204004.thfilter,tp,LOCATION_DECK,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101204004.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101204004.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 c101204004.stfilter(c)
return c:IsCode(101204071) and c:IsSSetable()
end
function c101204004.stcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c101204004.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101204004.stfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c101204004.stop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c101204004.stfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end
\ No newline at end of file
--光之黄金柜
--code by lightup37
function c101204051.initial_effect(c)
--cannot be destroyed
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_SZONE)
e1:SetValue(c101204051.efilter)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101204051)
e2:SetTarget(c101204051.thtg)
e2:SetOperation(c101204051.thop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,101204051+100)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c101204051.tgcon)
e3:SetCost(c101204051.tgcost)
e3:SetTarget(c101204051.tgtg)
e3:SetOperation(c101204051.tgop)
c:RegisterEffect(e3)
--Activate
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e4)
end
function c101204051.efilter(e,re)
return re:IsActiveType(TYPE_EFFECT)
end
function c101204051.filter(c)
return (aux.IsCodeListed(c,101204051)) and (c:IsAbleToHand()) and (not c:IsCode(101204051))
end
function c101204051.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101204051.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101204051.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101204051.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c101204051.tgfilter(c)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:IsAbleToGrave() and c:IsOnField()
end
function c101204051.tgffilter(c,eg)
return c:IsPreviousLocation(LOCATION_GRAVE) and eg:IsContains(c) and c:IsAbleToGrave() and c:IsOnField()
end
function c101204051.disfilter(c)
return c:IsDiscardable() and c:IsType(TYPE_SPELL)
end
function c101204051.tgcon(e,tp,eg,ep,ev,re,r,rp)
return (rp == 1-tp) and eg:IsExists(c101204051.tgfilter,1,nil)
end
function c101204051.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then return Duel.IsExistingMatchingCard(c101204051.disfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c101204051.disfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c101204051.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c101204051.tgffilter(chkc,eg) end
if chk == 0 then return Duel.IsExistingMatchingCard(c101204051.tgffilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,eg) end
local g = Duel.SelectMatchingCard(tp,c101204051.tgffilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,eg)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c101204051.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
--光の黄金櫃
--永续魔法
--这个卡名的②③的效果1回合各能使用1次。
--①:这张卡只要在魔法与陷阱区域存在,不会被怪兽的效果破坏。
--②:自己主要阶段才能发动。从卡组把,除「光の黄金櫃」外的,1张有「光の黄金櫃」的卡名记述的卡加入手卡。
--③:对方从墓地把怪兽特殊召唤的场合,从手卡丢弃1张魔法卡,以那之内的1只为对象才能发动。那只怪兽送去墓地。
\ No newline at end of file
--未来への沈黙
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,101204051)
--Activate without draw
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:SetCondition(s.ndcon)
e1:SetTarget(s.ndtarget)
e1:SetOperation(s.ndactivate)
c:RegisterEffect(e1)
--Activate without draw
local e2=e1:Clone()
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e2:SetCondition(s.dcon)
e2:SetTarget(s.dtarget)
e2:SetOperation(s.dactivate)
c:RegisterEffect(e2)
end
function s.sfilter(c)
return c:IsFaceup() and c:IsCode(101204051)
end
function s.mfilter(c)
return c:IsFaceup() and aux.IsCodeListed(c,101204051) and c:IsType(TYPE_MONSTER)
end
function s.ndcon(e,tp,eg,ep,ev,re,r,rp)
return not s.dcon(e,tp,eg,ep,ev,re,r,rp)
end
function s.dcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(s.mfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.filter(c)
return aux.IsCodeListed(c,101204051) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.ndtarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.dtarget(e,tp,eg,ep,ev,re,r,rp,chk)
local ct1=5-Duel.GetMatchingGroupCount(nil,tp,LOCATION_HAND,0,e:GetHandler())
local ct2=6-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)
and ct1>0 and Duel.IsPlayerCanDraw(tp,ct1+1)
and ct2>0 and Duel.IsPlayerCanDraw(1-tp,ct2)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,ct2)
end
function s.ndactivate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.dactivate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local th=Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if th>0 then
local ct1=6-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local ct2=6-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ct1>0 then
Duel.ShuffleDeck(tp)
Duel.Draw(tp,ct1,REASON_EFFECT)
end
if ct2>0 then
Duel.Draw(1-tp,ct2,REASON_EFFECT)
end
end
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