Commit 0846afbc authored by root's avatar root

Refresh on 2025-06-24 08:51:42

parent 8b17b828
--纸上台本「红宝石的天作之合」
function c10970017.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,109700001+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c10970017.condition)
e2:SetCost(c10970017.cost)
e2:SetTarget(c10970017.target)
e2:SetOperation(c10970017.operation)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c10970017.condition0)
e4:SetOperation(c10970017.operation2)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_PUBLIC)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
c:RegisterEffect(e3)
local e5=e3:Clone()
e5:SetCondition(c10970017.condition2)
e5:SetRange(LOCATION_MZONE)
c:RegisterEffect(e5)
end
function c10970017.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>=1
end
function c10970017.condition0(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,10970008) and Duel.GetCurrentChain()>=1
end
function c10970017.filter1(c)
return c:IsDiscardable()
end
function c10970017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10970017.filter1,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c10970017.filter1,1,1,REASON_COST+REASON_DISCARD)
end
function c10970017.tgfilter(c,tp)
return c:IsSetCard(0x233) and c:IsAbleToGrave()
and Duel.IsExistingMatchingCard(c10970017.thfilter,tp,LOCATION_DECK,0,1,c,c:GetCode())
end
function c10970017.thfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function c10970017.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10970017.tgfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c10970017.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c10970017.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c10970017.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c10970017.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c10970017.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c10970017.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c10970017.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,10970008)
end
\ No newline at end of file
--陰の光
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost1)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+100)
e2:SetCondition(s.sumcon)
e2:SetCost(s.cost2)
e2:SetTarget(s.sumtg)
e2:SetOperation(s.sumop)
c:RegisterEffect(e2)
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.filter(c,e,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:GetOriginalLevel()>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function s.spfilter(c,e,tp,tc)
local b1=c:IsLocation(LOCATION_DECK) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
return c:IsAttribute(ATTRIBUTE_DARK)
and c:GetOriginalRace()==tc:GetOriginalRace()
and c:GetOriginalLevel()==tc:GetOriginalLevel()
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (b1 or b2)
end
function s.target(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,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)==0
end
function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return s.cost1(e,tp,eg,ep,ev,re,r,rp,0) and c:IsAbleToRemove() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
s.cost1(e,tp,eg,ep,ev,re,r,rp,1)
end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK+ATTRIBUTE_LIGHT))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
--トロイメア・ゴブリン --召命の神弓-アポロウーサ
function c114514037.initial_effect(c) function c114514037.initial_effect(c)
c:SetUniqueOnField(1,0,114514037)
--link summon --link summon
aux.AddLinkProcedure(c,nil,2,2,c114514037.lcheck) aux.AddLinkProcedure(c,aux.NOT(aux.FilterBoolFunction(Card.IsLinkType,TYPE_TOKEN)),2,99,c114514037.lcheck)
c:EnableReviveLimit() c:EnableReviveLimit()
--extra summon --atk
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(114514037,0)) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetValue(c114514037.matcheck)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,114514037)
e1:SetCondition(c114514037.sumcon)
e1:SetCost(c114514037.sumcost)
e1:SetTarget(c114514037.sumtg)
e1:SetOperation(c114514037.sumop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot target --negate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetDescription(aux.Stringid(114514037,0))
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCategory(CATEGORY_NEGATE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0) e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetTarget(c114514037.tgtg) e2:SetCondition(c114514037.condition)
e2:SetValue(1) e2:SetTarget(c114514037.target)
e2:SetOperation(c114514037.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c114514037.lcheck(g,lc) function c114514037.lcheck(g,lc)
return g:GetClassCount(Card.GetLinkCode)==g:GetCount() return g:GetClassCount(Card.GetLinkCode)==g:GetCount() and g:GetClassCount(Card.GetLinkRace)>=2
end end
function c114514037.sumcon(e,tp,eg,ep,ev,re,r,rp) function c114514037.matcheck(e,c)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and Duel.GetTurnPlayer()==tp local ct=c:GetMaterialCount()
end local e1=Effect.CreateEffect(c)
function c114514037.sumcost(e,tp,eg,ep,ev,re,r,rp,chk) e1:SetType(EFFECT_TYPE_SINGLE)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end e1:SetCode(EFFECT_SET_BASE_ATTACK)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) e1:SetValue(ct*800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_DISABLE)
c:RegisterEffect(e1)
end end
function c114514037.filter(c,e,tp,zone) function c114514037.condition(e,tp,eg,ep,ev,re,r,rp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) return ep==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end end
function c114514037.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function c114514037.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then local c=e:GetHandler()
local zone=e:GetHandler():GetLinkedZone(tp) if chk==0 then return c:IsAttackAbove(1600) end
return Duel.IsExistingMatchingCard(c114514037.filter,tp,LOCATION_HAND,0,1,nil,e,tp,zone) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,114514037)==0 end
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetLabel(0)
end
end end
function c114514037.sumop(e,tp,eg,ep,ev,re,r,rp) function c114514037.operation(e,tp,eg,ep,ev,re,r,rp)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f) local c=e:GetHandler()
if zone==0 then return end if c:IsFacedown() or not c:IsRelateToEffect(e) or c:GetAttack()<1600
if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 then or Duel.GetCurrentChain()~=ev+1 or c:IsStatus(STATUS_BATTLE_DESTROYED) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) return
local g=Duel.SelectMatchingCard(tp,c114514037.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone)
local tc=g:GetFirst()
if tc and 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_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
end
Duel.SpecialSummonComplete()
end end
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1) local e1=Effect.CreateEffect(c)
and Duel.SelectYesNo(tp,aux.Stringid(114514037,1)) then e1:SetType(EFFECT_TYPE_SINGLE)
Duel.Draw(tp,1,REASON_EFFECT) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-1600)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.NegateActivation(ev)
end end
end end
function c114514037.sumcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFieldID()==e:GetLabel()
end
function c114514037.sumval(e,c)
local c=e:GetHandler()
local sumzone=c:GetLinkedZone()
local relzone=-bit.lshift(1,c:GetSequence())
return 0,sumzone,relzone
end
function c114514037.tgtg(e,c)
return c:GetMutualLinkedGroupCount()>0
end
...@@ -23,19 +23,19 @@ end ...@@ -23,19 +23,19 @@ end
function s.costfilter1(c) function s.costfilter1(c)
return c:IsCode(78371393) and c:IsAbleToGraveAsCost() return c:IsCode(78371393) and c:IsAbleToGraveAsCost()
end end
function s.costfilter2(c) function s.costfilter2(c,e,tp)
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp)
end end
function s.pcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.pcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter1,tp,LOCATION_DECK,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(s.costfilter2,tp,LOCATION_DECK,0,1,nil) and c:IsDiscardable() end and Duel.IsExistingMatchingCard(s.costfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) and c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,s.costfilter1,tp,LOCATION_DECK,0,1,1,nil) local g1=Duel.SelectMatchingCard(tp,s.costfilter1,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g1,REASON_COST) Duel.SendtoGrave(g1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,s.costfilter2,tp,LOCATION_DECK,0,1,1,nil) local g2=Duel.SelectMatchingCard(tp,s.costfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SendtoGrave(g2,REASON_COST) Duel.SendtoGrave(g2,REASON_COST)
end end
function s.pcon(e,tp,eg,ep,ev,re,r,rp) function s.pcon(e,tp,eg,ep,ev,re,r,rp)
...@@ -45,16 +45,16 @@ function s.pfilter(c,tp) ...@@ -45,16 +45,16 @@ function s.pfilter(c,tp)
return c:IsCode(12644061) and not c:IsForbidden() and c:CheckUniqueOnField(tp) return c:IsCode(12644061) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end end
function s.ptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_DECK,0,1,nil,tp) if chk==0 then return Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,tp)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x5034) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x5034) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.pop(e,tp,eg,ep,ev,re,r,rp) function s.pop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,s.pfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,s.pfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,tp):GetFirst()
if tc then if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then if fc then
...@@ -63,7 +63,7 @@ function s.pop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,7 +63,7 @@ function s.pop(e,tp,eg,ep,ev,re,r,rp)
end end
if Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=0 then if Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if sc then if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end end
......
...@@ -51,7 +51,7 @@ function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,7 +51,7 @@ function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveCounter(tp,0x1019,ct,REASON_COST) e:GetHandler():RemoveCounter(tp,0x1019,ct,REASON_COST)
end end
function s.sumfilter(c) function s.sumfilter(c)
return c:IsSetCard(0x18) and c:IsSummonable(true,nil) and c:IsAttackBelow(1000) return c:IsSetCard(0x18) and c:IsSummonable(true,nil)
end end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
......
...@@ -79,11 +79,11 @@ end ...@@ -79,11 +79,11 @@ end
function s.splimit(e,c) function s.splimit(e,c)
return not (c:IsSetCard(0x18) or c:IsRace(RACE_SPELLCASTER+RACE_AQUA)) return not (c:IsSetCard(0x18) or c:IsRace(RACE_SPELLCASTER+RACE_AQUA))
end end
function s.nifilter(c,lv) function s.nifilter(c,atk)
return c:IsSetCard(0x18) and c:IsLevelAbove(lv+1) return c:IsSetCard(0x18) and c:IsAttackAbove(atk)
end end
function s.indtg(e,c) function s.indtg(e,c)
return c:IsSetCard(0x18) and Duel.IsExistingMatchingCard(s.nifilter,c:GetOwner(),LOCATION_MZONE,0,1,nil,c:GetLevel()) return c:IsSetCard(0x18) and Duel.IsExistingMatchingCard(s.nifilter,c:GetOwner(),LOCATION_MZONE,0,1,nil,c:GetAttack())
end end
function s.efilter(e,re) function s.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated() return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
......
--未被选择者
function c114515036.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c114515036.condition)
e1:SetOperation(c114515036.activate)
c:RegisterEffect(e1)
end
function c114515036.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1
end
function c114515036.dfilter(c)
return c:IsType(TYPE_MONSTER)
end
function c114515036.sfilter(c)
return c:IsType(TYPE_MONSTER)
end
function c114515036.tfilter(c)
return true
end
function c114515036.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c114515036.dfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
-- Debug.Message(g:GetCount())
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SELECT)
local sg=g:Select(1-tp,1,1,nil)
local desg=Duel.GetMatchingGroup(c114515036.tfilter,tp,0,LOCATION_ONFIELD,nil)
desg:RemoveCard(sg:GetFirst())
Duel.Destroy(desg,REASON_EFFECT)
Duel.BreakEffect()
local dg = Duel.GetOperatedGroup():Filter(c114515036.sfilter,nil)
-- Debug.Message(dg:GetCount())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local dsg=dg:Select(tp,1,1,nil)
Duel.SpecialSummon(dsg,REASON_EFFECT,tp,tp,0,0,POS_FACEUP)
end
end
\ No newline at end of file
--冥界之花
function c114516001.initial_effect(c)
--summon and destory
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c114516001.target)
e1:SetOperation(c114516001.activate)
c:RegisterEffect(e1)
end
function c114516001.spfilter(c,e,tp)
return c:IsLevelBelow(1) and c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c114516001.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
-- Debug.Message(Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
-- Debug.Message(Duel.IsExistingMatchingCard(c114516001.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) )
return
Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(c114516001.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c114516001.dfilter(c)
return c:IsDestructable()
end
function c114516001.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c114516001.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local rg=Duel.SelectMatchingCard(tp,c114516001.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
if rg:GetCount()>0 then
Duel.HintSelection(rg)
Duel.Destroy(rg,REASON_EFFECT)
end
end
end
\ No newline at end of file
--简易同调
-- code by lightup37 contact at tyq11186192@outlook.com
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,70902743)
--spsum
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(s.stcost)
e2:SetTarget(s.sttg)
e2:SetOperation(s.stop)
c:RegisterEffect(e2)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function s.syncsumfliter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsSynchroSummonable(nil)
end
function s.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) then
local token=Duel.CreateToken(tp,id+1)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(s.syncsumfliter,tp,LOCATION_EXTRA,0,nil)
-- Debug.Message(g:GetCount())
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.confliter(c)
return aux.IsCodeOrListed(c, 70902743) and c:IsType(TYPE_SYNCHRO)
end
function s.bfgfliter(c)
return (c:IsRace(RACE_DRAGON)) and (c:IsAttribute(ATTRIBUTE_DARK)) and (c:IsType(TYPE_SYNCHRO)) and (c:IsAbleToRemoveAsCost())
end
function s.setfliter(c)
return aux.IsCodeListed(c, 70902743) and ( c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP) )
end
function s.stcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.confliter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.bfgfliter,tp,LOCATION_GRAVE,0,1,nil)
end
function s.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return
(e:GetHandler():IsAbleToRemoveAsCost()) and
(Duel.IsExistingMatchingCard(s.confliter,tp,LOCATION_MZONE,0,1,nil)) and
(Duel.IsExistingMatchingCard(s.bfgfliter,tp,LOCATION_GRAVE,0,1,e:GetHandler())) and
(Duel.IsExistingMatchingCard(s.setfliter,tp,LOCATION_GRAVE,0,1,e:GetHandler()))
end
local g=Group.CreateGroup()
g:AddCard(e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Group.Merge(g,Duel.SelectMatchingCard(tp,s.bfgfliter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()))
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
-- Debug.Message("s.sttg")
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.setfliter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(s.setfliter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.setfliter,tp,LOCATION_GRAVE,0,1,1,nil)
end
function s.stop(e,tp,eg,ep,ev,re,r,rp)
-- Debug.Message("s.spop")
local tc=Duel.GetFirstTarget()
if (tc ~= nil) and (tc:IsLocation(LOCATION_GRAVE)) then
Duel.SSet(tp, tc)
end
end
\ No newline at end of file
-- 岩融冰结 -- 岩融冰结
local s,id,o=GetID() local s,id,o=GetID()
local factor=1000
function s.initial_effect(c) function s.initial_effect(c)
-- disable -- disable
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -34,17 +35,13 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -34,17 +35,13 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local count=s.count(tp) local count=s.count(tp)
local maxc=math.floor(Duel.GetLP(tp)/1500)-count local maxc=math.floor(Duel.GetLP(tp)/factor)-count
if chk==0 then return maxc>0 and e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return maxc>0 and e:GetHandler():IsAbleToGraveAsCost() end
if maxc<=0 then return end if maxc<=0 then return end
--Duel.PayLPCost(1-tp, Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)+1)
--Duel.PayLPCost(1-tp, Duel.GetTurnCount())
--Duel.PayLPCost(1-tp, Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)+1)
--Duel.PayLPCost(1-tp, Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)+1)
local t={} local t={}
for i=1,maxc do t[i]=i end for i=1,maxc do t[i]=i end
local a1=Duel.AnnounceNumber(tp,table.unpack(t)) local a1=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,(a1+count)*1500) Duel.PayLPCost(tp,(a1+count)*factor)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
e:SetLabel(a1) e:SetLabel(a1)
end end
......
--往日犹追
local s,id=GetID()
s.banlist={}
s.operationlist={}
s.activitate=false
function s.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23434538,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
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_CHAINING)
ge1:SetOperation(s.counter)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PREDRAW)
ge2:SetOperation(s.reset)
Duel.RegisterEffect(ge2,0)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsSummonType,tp,LOCATION_MZONE,0,nil,SUMMON_TYPE_SPECIAL)==0
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
for k,_ in pairs(s.operationlist) do
s.banlist[k] = 1
end
if not s.activitated then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(s.aclimit)
Duel.RegisterEffect(e1,tp)
s.activitate=true
end
--Tell listener to ban
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(id)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
Duel.RegisterEffect(e2,tp)
end
function s.aclimit(e,re,tp)
return s.banlist[re:GetCode()]~=nil
end
function s.counter(e,tp,eg,ep,ev,re,r,rp)
s.operationlist[re:GetHandler():GetCode()]=1
if Duel.IsPlayerAffectedByEffect(tp,id) then
s.banlist[re:GetHandler():GetCode()]=1
end
end
function s.reset(e,tp,eg,ep,ev,re,r,rp)
s.operationlist={}
end
--格物究礼
local s,id=GetID()
local tid=172016110
function s.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.discon)
e1:SetCost(s.discost)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
--not influenced
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(aux.TRUE)
c:RegisterEffect(e2)
end
function s.efilter(e,te)
return true
--return not te:GetHandler():IsSpecialSummonableCard()
end
function s.cfilter(c,tp)
if not c:IsPreviousLocation(LOCATION_EXTRA) then return false end
if c:GetControler()==tp then return false end
local g=c:GetMaterial()
if g==nil then return true end
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_ONFIELD)<=1
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and Duel.GetMatchingGroupCount(Card.IsSummonLocation,tp,LOCATION_MZONE,0,nil,LOCATION_EXTRA)==0
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
local tg=eg:Filter(s.cfilter,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,#tg,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local tg=eg:Filter(s.cfilter,nil,tp)
local tg2=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_EXTRA,LOCATION_EXTRA,nil)
Duel.SendtoDeck(tg2,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp)
tg:Merge(tg2)
Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY,tp)
rg=Duel.GetOperatedGroup()
local tg=Group.CreateGroup()
for rc in aux.Next(rg) do
local tc=Duel.CreateToken(rc:GetControler(),tid)
getmetatable(tc).register(tc,rc)
tg:AddCard(tc)
end
Duel.SendtoHand(tg,nil,REASON_EFFECT,tp)
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp)
for rc in aux.Next(tg) do
getmetatable(rc).register2(rc)
end
--cannot activitate spell/trap
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(1,0)
e3:SetCondition(s.accon)
e3:SetValue(s.aclimit)
Duel.RegisterEffect(e3,tp)
end
function s.accon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tid)>0
end
function s.aclimit(e,re,tp)
local c=re:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
--- 这张卡能且只能从手卡发动。 --- 这张卡能且只能从手卡发动。
--- ①:自己场上没有怪兽存在,对方场上这回合特殊召唤且攻击表示的怪兽把效果发动时才能发动。 --- ①:自己场上没有怪兽存在,对方场上这回合特殊召唤且攻击表示的怪兽把效果发动时才能发动。
--- 从卡组选1张「健忘」除外,那张卡的效果适用。那之后,这张卡返回手卡。 --- 从卡组选1张「健忘」除外,那张卡的效果适用。那之后,这张卡返回手卡。
-- ②:这张卡送去墓地时才能发动。自己除外的「健忘」尽可能在场上盖放。
-- 这个效果盖放的卡从场上离开时返回卡组。
----------------------------------------------------------------------------------- -----------------------------------------------------------------------------------
local s,id,o=GetID() local s,id,o=GetID()
...@@ -22,6 +24,13 @@ function s.initial_effect(c) ...@@ -22,6 +24,13 @@ function s.initial_effect(c)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
local tgp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION) local tgp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION)
...@@ -52,3 +61,25 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,3 +61,25 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function s.tgfilter(c,tp)
return Duel.IsPlayerCanSSet(tp,c) and c:IsCode(71098407) and c:IsFaceup()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_REMOVED,0,1,nil,tp) end
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_REMOVED,0,nil,tp)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
Duel.SSet(tp,g)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECK)
tc:RegisterEffect(e1)
end
end
end
--团团圆圆欢聚友伴
local s,id,o=GetID()
function s.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.thcon)
e1:SetCost(s.thcost)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0 and Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)<2
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(1,0)
e3:SetCondition(s.actcon)
e3:SetValue(s.aclimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function s.chainfilter(re,tp,cid)
return not (re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x1b2))
end
function s.actcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)>1
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x1b2)
end
function s.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x1b2) and c:IsType(TYPE_MONSTER) and not c:IsCode(id)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local h1=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local h2=Duel.GetMatchingGroup(s.thfilter,tp,0,LOCATION_DECK,nil)
aux.GCheckAdditional=aux.dncheck
local g1=h1:SelectSubGroup(tp,aux.TRUE,false,1,h1:GetClassCount(Card.GetCode))
Duel.SendtoHand(g1,nil,REASON_EFFECT)
local g2=h2:SelectSubGroup(1-tp,aux.TRUE,false,1,h2:GetClassCount(Card.GetCode))
Duel.SendtoHand(g2,nil,REASON_EFFECT)
local e6=Effect.CreateEffect(e:GetHandler())
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_PHASE+PHASE_END)
e6:SetCountLimit(1)
e6:SetCondition(s.tdcon)
e6:SetOperation(s.tdop)
e6:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e6,tp)
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetOwnerPlayer(),LOCATION_HAND,0)>Duel.GetFieldGroupCount(e:GetOwnerPlayer(),0,LOCATION_ONFIELD)+6
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(e:GetOwnerPlayer(),LOCATION_HAND,0)
local d=Duel.GetFieldGroupCount(e:GetOwnerPlayer(),LOCATION_HAND,0)-(Duel.GetFieldGroupCount(e:GetOwnerPlayer(),0,LOCATION_ONFIELD)+6)
local sg=g:RandomSelect(e:GetOwnerPlayer(),d)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
--突变的G
local s,id=GetID()
function s.initial_effect(c)
--cosplay
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.disfilter(c)
return c:IsType(TYPE_SPELL) and not c:IsType(TYPE_CONTINUOUS+TYPE_EQUIP+TYPE_QUICKPLAY+TYPE_RITUAL+TYPE_FIELD) and c:IsAbleToGraveAsCost()
end
function s.confilter(c)
return c:GetSummonType()==SUMMON_TYPE_SPECIAL
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.disfilter,tp,LOCATION_HAND,0,1,c) end
local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.coscon)
e1:SetTarget(s.costg)
e1:SetOperation(s.cosop)
e1:SetLabelObject(c)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.filter(c,sp)
return c:IsSummonPlayer(sp)
end
function s.coscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local te=c:GetActivateEffect()
return eg:IsExists(s.filter,1,nil,1-tp) and te:IsActivatable(tp,true,false)
end
function s.costg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetLabelObject()
local te=c:GetActivateEffect()
if not te then return false end
return te:GetTarget()(te,tp,eg,ep,ev,re,r,rp,chk)
end
function s.cosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local te=c:GetActivateEffect()
if not te then return end
return te:GetOperation()(te,tp,eg,ep,ev,re,r,rp)
end
--禁采令地巨魔
local s,id,o=GetID()
function s.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge=Effect.CreateEffect(c)
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_CHAINING)
ge:SetCondition(s.gecon)
ge:SetOperation(s.geop)
Duel.RegisterEffect(ge,0)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) and Duel.GetLocationCount(tp,LOCATION_ONFIELD)==0
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTarget(s.bantg)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(s.fuslimit)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
Duel.RegisterEffect(e4,tp)
local e5=e1:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
Duel.RegisterEffect(e5,tp)
local e6=e1:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
Duel.RegisterEffect(e6,tp)
end
function s.bantg(e,c)
return c:GetFlagEffect(id)>0
end
function s.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
function s.gecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER)
end
function s.geop(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(eg) do
if c:IsType(TYPE_MONSTER) and c:GetFlagEffect(id)==0 then
c:RegisterFlagEffect(id,RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
--持戒僧 道昭
local s,id=GetID()
function s.initial_effect(c)
--to field
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter1(c)
return c:IsCode(66100045)
end
function s.filter2(c)
return c:IsCode(95472621)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.OR(s.filter1,s.filter2),tp,LOCATION_DECK,0,1,nil) end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_DECK,0,nil)
local g=Group.CreateGroup()
if #g1>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g1:Select(tp,1,1,nil)
g:Merge(sg)
Duel.MoveToField(sg:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
--remove trigger
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_REMOVE)
e2:SetOperation(s.removeop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
if #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g2:Select(tp,1,1,nil)
g:Merge(sg)
Duel.SSet(tp,sg)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if #g>0 then
for tc in aux.Next(g) do
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
end
function s.removeop(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(eg) do
if c:GetReason()&REASON_REDIRECT==REASON_REDIRECT and c:GetFlagEffect(66100045)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
break
end
end
end
-- magic is always dirty
s.originRegisterEffect = Card.RegisterEffect
function Card.RegisterEffect(c,e,...)
if c:IsCode(95472621) then
e:SetOperation(s.wrap_op(e:GetOperation()))
end
if c:IsCode(66100045) and e:GetType()&EFFECT_TYPE_FIELD==EFFECT_TYPE_FIELD then
e:SetTarget(s.extra_tg)
end
return s.originRegisterEffect(c,e,...)
end
function s.wrap_op(f)
return function(e,tp,eg,ep,ev,re,r,rp)
f(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(id)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function s.extra_tg(e,c)
if e:GetHandler():GetFlagEffect(id)>0 and c:GetFlagEffect(66100045)==0 then
c:RegisterFlagEffect(66100045,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END-RESET_REMOVE,0,1)
end
return true
end
--异次元吸引者
--所有 REASON_REDIRECT 的卡都会返回墓地,不论它是因为何种原因除外的。
local s,id=GetID()
function s.initial_effect(c)
--redirect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.redcon)
e1:SetCost(s.redcost)
e1:SetTarget(s.redtg)
e1:SetOperation(s.redop)
c:RegisterEffect(e1)
end
function s.redcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)==0
end
function s.rmfilter(c)
return c:IsAbleToRemove()
end
function s.redcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and Duel.GetMatchingGroupCount(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,nil)>0 end
local tg=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
end
function s.redtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
function s.redop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_REMOVE)
e2:SetOperation(s.removeop)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetOperation(s.retop)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
end
function s.removeop(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(eg) do
if c:GetReason()&REASON_REDIRECT==REASON_REDIRECT then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
end
function s.retfilter(c)
return c:GetFlagEffect(id)>0 and c:IsAbleToGrave()
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.retfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #g==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT)
end
--变换防护罩 -梦幻之力-
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_DAMAGE+CATEGORY_POSITION+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function s.filter(c)
return c:IsAttackPos()
end
function s.costfilter(c)
local te=c:GetActivateEffect()
return c:GetType()==TYPE_TRAP and c:IsAbleToGraveAsCost()
end
function s.costfilter2(c)
return c:IsAbleToGraveAsCost() and c:IsType(TYPE_MONSTER)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local c1=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local g=Duel.GetMatchingGroup(s.costfilter2,tp,LOCATION_DECK,0,nil)
aux.GCheckAdditional=aux.dabcheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,g:GetClassCount(Card.GetAttribute))
aux.GCheckAdditional=nil
sg:AddCard(c1)
Duel.SendtoGrave(sg,REASON_COST)
sg:KeepAlive()
e:SetLabelObject(sg)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local attr=s.getattr(e)
-- if attr&ATTRIBUTE_LIGHT>0 then
-- Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_DARK>0 then
-- Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_WIND>0 then
-- Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_WATER>0 then
-- Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_FIRE>0 then
-- Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_EARTH>0 then
-- Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_DIVINE>0 then
-- Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
-- end
if Duel.GetAttacker():GetAttribute()&attr>0 then
Duel.SetChainLimit(aux.FALSE)
-- Prevent activation of any card effects in the Battle Start Step
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_BATTLE_START)
Duel.RegisterEffect(e1,tp)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local attr=s.getattr(e)
if attr&ATTRIBUTE_LIGHT>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
if attr&ATTRIBUTE_DARK>0 then Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_DEFENSE)
Duel.HintSelection(dg)
Duel.Remove(dg,POS_FACEUP,REASON_EFFECT)
end
if attr&ATTRIBUTE_WIND>0 then Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.SendtoHand(dg,REASON_EFFECT)
end
if attr&ATTRIBUTE_WATER>0 then Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.SendtoDeck(dg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
if attr&ATTRIBUTE_FIRE>0 then Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVECARD)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
local atk=dg:GetSum(Card.GetAttack)
Duel.Damage(tp,atk,REASON_EFFECT,true)
Duel.Damage(1-tp,atk,REASON_EFFECT,true)
Duel.RDComplete()
end
if attr&ATTRIBUTE_EARTH>0 then Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
if Duel.ChangePosition(dg,POS_FACEDOWN_DEFENSE)~=0 then
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=og:GetNext()
end
end
end
if attr&ATTRIBUTE_DIVINE>0 then Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.Release(dg,REASON_RULE,1-tp)
end
end
function s.getattr(e)
local g=e:GetLabelObject()
local attr=0
for tc in aux.Next(g) do
attr=attr|tc:GetAttribute()
end
return attr
end
s.setc={
[44095762]=1, --圣防
[20522190]=1, --暗防
[5650082]=1, --风防
[75249652]=1, --火防
[40838625]=1, --沙防
[47475363]=1, --水防
--妖艳贱货们
[21481146]=1, --光防
[89563150]=1, --银防
[52607696]=1, --幻防
[59016454]=1, --黑魔防
--更妖艳的贱货们
[53239672]=1, --灵魂障壁
[88789641]=1, --神圣生命防护罩
[37053871]=1, --星光体障壁
[44676200]=1, --英雄障壁
[34351849]=1, --蛙类防护罩
[22201234]=1, --光道防护罩
[77229910]=1, --变形斗士防护罩
[21879581]=1, --同调障壁
[5609226]=1, --调整防护罩
[78621186]=1, --野蛮人之吼
[95081386]=1, --三振障壁
[96004535]=1 --超量不破障壁
}
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.setfilter(c)
return s.setc[c:GetCode()]~=nil
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,g:GetClassCount(Card.GetCode))
aux.GCheckAdditional=nil
if sg:GetCount()>0 then
if Duel.SSet(tp,sg,tp)>0 then
sg=Duel.GetOperatedGroup()
for c in aux.Next(sg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
end
end
--連鎖归还
--测试
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsFaceup() and c:GetAttack()>=1000 and c:GetAttack()<=2000 and c:IsAbleToRemove()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.filter,1,nil) end
local g=eg:Filter(s.filter,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function s.efilter(c,e)
return c:IsFaceup() and c:GetAttack()>=1000 and c:GetAttack()<=2000 and c:IsRelateToEffect(e)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(s.efilter,nil,e)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local rg=Group.CreateGroup()
local tc=sg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_DECK) then
local tpe=tc:GetType()
if bit.band(tpe,TYPE_TOKEN)==0 then
local g1=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,nil,tc:GetCode())
rg:Merge(g1)
end
end
tc=sg:GetNext()
end
if rg:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.rfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function s.stfilter(c)
return c:IsCode(1248895,57139487,id) and not c:IsForbidden() and c:IsSSetable()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.rfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.rfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.rfilter,tp,LOCATION_GRAVE,0,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 rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.SendtoDeck(rc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and rc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(s.stfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,g:GetClassCount(Card.GetCode))
aux.GCheckAdditional=nil
Duel.SSet(tp,sg)
end
end
end
--次元禁闭
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCost(s.cost)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function s.filter(c,atk)
return c:IsAbleToRemove() and c:IsAttackBelow(atk)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,Duel.GetAttacker():GetAttack())>0 end
local tg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,Duel.GetAttacker():GetAttack())
Duel.Remove(tg,POS_FACEUP,REASON_COST)
local cg=Duel.GetOperatedGroup()
cg:KeepAlive()
e:SetLabelObject(cg)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(e:GetLabelObject()) do
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_FIELD)
e:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e:SetCode(EFFECT_FORBIDDEN)
e:SetRange(LOCATION_SZONE)
e:SetTargetRange(0xff,0xff)
e:SetTarget(function(e,c) return Card.IsOriginalCodeRule(c,e:GetLabel()) end)
e:SetLabel(c:GetCode())
e:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e,tp)
end
-- override effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_FZONE)
e2:SetReset(RESET_CHAIN)
e2:SetOperation(s.chop)
Duel.RegisterEffect(e2,tp)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_END,RESET_PHASE+PHASE_END,1)
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeChainOperation(ev,s.realop)
end
function s.realop()
end
--诱饵人形
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--negated
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetOperation(s.flagop)
c:RegisterEffect(e2)
--disabled
local e3=e2:Clone()
e3:SetCode(EVENT_CHAIN_DISABLED)
c:RegisterEffect(e3)
--destroyed
local e4=e2:Clone()
e4:SetCode(EVENT_DESTROYED)
c:RegisterEffect(e4)
--redirect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetOperation(s.retop)
c:RegisterEffect(e5)
end
function s.filter(c)
return c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
local tc=Duel.GetFirstTarget()
local label=tc:GetFlagEffectLabel(id)
if label==nil then
--print("No quick effects registered for this card.")
return
end
local tep=tc:GetControler()
local options={}
local tes=s.register[label]
if #tes==0 then return end
for _,te in ipairs(tes) do
table.insert(options,{s.can_trigger(te,tep,eg,ep,ev,e,r,rp),te:GetDescription(),te})
end
local te=aux.SelectFromOptions(1-tp,table.unpack(options))
if te~=nil then
s.force_effect(te,tep)
Duel.Readjust()
end
end
function s.can_trigger(te,tep,eg,ep,ev,re,r,rp)
local condition=te:GetCondition()
local cost=te:GetCost()
local target=te:GetTarget()
return (condition==nil or condition(te,tep,eg,ep,ev,re,r,rp))
and (cost==nil or cost(te,tep,eg,ep,ev,re,r,rp,0))
and (target==nil or target(te,tep,eg,ep,ev,re,r,rp,0))
end
function s.force_effect(e,tp)
local te=e:Clone()
local tet=e:GetType()
if tet&EFFECT_TYPE_QUICK_O>0 then
tet=tet&~EFFECT_TYPE_QUICK_O|EFFECT_TYPE_QUICK_F
end
if tet&EFFECT_TYPE_TRIGGER_O>0 then
tet=tet&~EFFECT_TYPE_TRIGGER_O|EFFECT_TYPE_TRIGGER_F
end
te:SetType(tet)
local target=te:GetTarget()
te:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 or chkc then
if target==nil then return true else return target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
end
if target~=nil then
target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
e:UseCountLimit(tp,1)
te:Reset()
end)
s.originRegisterEffect(e:GetHandler(),te,true)
Duel.SetChainLimit(function(e,ep,tp) return e==te end)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp,true)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.flagop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESET_CHAIN,0,1)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(id)==0 then return end
Duel.SendtoHand(e:GetHandler(),tp,REASON_REDIRECT)
end
s.originRegisterEffect = Card.RegisterEffect
s.register={}
s.register_counter=0
function Card.RegisterEffect(c,e)
if e:GetType()&EFFECT_TYPE_QUICK_O>0 or e:GetType()&EFFECT_TYPE_TRIGGER_O>0 then
local label=c:GetFlagEffectLabel(id)
if label==nil then
s.register_counter=s.register_counter+1
label=s.register_counter
c:RegisterFlagEffect(id,0,0,0,label)
s.register[label]={}
end
table.insert(s.register[label],e)
--print("Effect registered for card " .. c:GetCode() .. " with label: " .. label)
end
return s.originRegisterEffect(c,e)
end
s.originIsActiveType = Effect.IsActiveType
function Effect.IsActiveType(e,typ)
if e:GetTarget()==s.target and typ&(TYPE_TRAP+TYPE_SPELL+TYPE_MONSTER)>0 then
return true
end
return s.originIsActiveType(e,typ)
end
--斯克兰顿稳定锚
--补测伤害变0
local s,id=GetID()
function s.initial_effect(c)
--record
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_LEAVE_DECK)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.recordcon)
e1:SetCost(s.recordcost)
e1:SetTarget(s.recordtg)
e1:SetOperation(s.recordop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_DRAW)
c:RegisterEffect(e2)
end
function s.recordcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
and Duel.GetTurnPlayer()==1-tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and eg:IsExists(function(c) return c:GetOwner()==1-tp end,1,nil)
end
function s.recordcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.recordtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
end
function s.recordop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK+LOCATION_EXTRA,0)
e:SetLabel(ct)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetOperation(s.resolveop)
e2:SetLabel(ct)
e2:SetLabelObject(c)
Duel.RegisterEffect(e2,tp)
end
function s.resolveop(e,tp,eg,ep,ev,re,r,rp)
local ct1=e:GetLabel()
local ct2=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK+LOCATION_EXTRA,0)
if ct2>=ct1 then return end
local ct=ct1-ct2
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g1==0 then return end
if ct<#g1 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
Duel.SendtoGrave(g1:Select(1-tp,ct,ct,nil),REASON_EFFECT,1-tp)
return
end
Duel.SendtoGrave(g1,REASON_EFFECT,1-tp)
ct=ct-#g1
if ct<=0 then return end
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil)
if #g2==0 then return end
if ct>=#g2 then ct=#g2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(g2:Select(tp,ct,ct,nil),POS_FACEUP,REASON_EFFECT)
if Duel.GetOperatedGroup():GetCount()>0 then
local c=e:GetLabelObject()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetValue(1)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
if Duel.SelectYesNo(1-tp,aux.Stringid(id,0)) and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) then
Duel.SendtoHand(c,1-tp,REASON_EFFECT)
end
end
end
--幽世歌
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--double
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_F)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--神之预告
local s,id=GetID()
function s.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCost(s.cost1)
e1:SetTarget(s.target1)
e1:SetOperation(s.activate1)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(s.handcon)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lp=math.floor(Duel.GetLP(tp)/2)
Duel.PayLPCost(tp,lp)
e:SetLabel(lp)
end
function s.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,2,0,0)
end
function s.activate1(e,tp,eg,ep,ev,re,r,rp)
local c1=Duel.AnnounceCard(tp)
local c2=Duel.AnnounceCard(1-tp)
if c1~=c2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(s.ngcon)
e1:SetOperation(s.ngop)
e1:SetLabel(c1)
e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp)
end
end
function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
return aux.NegateSummonCondition(e,tp,eg,ep,ev,re,r,rp) and eg:IsExists(Card.IsCode,1,nil,e:GetLabel())
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
Duel.Remove(Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_EXTRA,nil,e:GetLabel()),POS_FACEDOWN,REASON_EFFECT)
Duel.Recover(tp,e:GetLabelObject():GetLabel(),REASON_EFFECT)
local c=e:GetLabelObject():GetHandler()
if c:IsLocation(LOCATION_GRAVE) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function s.handcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,e:GetHandlerPlayer(),ACTIVITY_CHAIN)==0 --and ep~=tp
end
function s.chainfilter(re,tp,cid)
local rc=re:GetHandler()
if rc==nil then return true end
return not rc:IsType(TYPE_MONSTER+TYPE_SPELL)
end
--强制捕获装置
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(TIMING_ATTACK,0x11e0)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.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
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
end
end
--看到这张卡在卡池里应该反省的是你不是我
local s,id=GetID()
s.enabled={0,0}
function s.initial_effect(c)
--reflect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.reflectcon)
e1:SetOperation(s.reflectop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(s.rmcon)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_DELAY)
e4:SetCondition(s.drawcon)
e4:SetTarget(s.drawtg)
e4:SetOperation(s.drawop)
c:RegisterEffect(e4)
local e4p=e4:Clone()
e4p:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4p)
local e4q=e4:Clone()
e4q:SetCode(EVENT_REMOVE)
c:RegisterEffect(e4q)
--Choose
if not s.global_check then
local ge=Effect.CreateEffect(c)
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_PREDRAW)
ge:SetReset(RESET_PHASE+PHASE_END)
ge:SetOperation(s.selectop)
Duel.RegisterEffect(ge,0)
s.global_check=true
end
end
function s.reflectcon(e,tp,eg,ep,ev,re,r,rp)
if s.enabled[tp]&1==0 then return false end
if re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if ex and (cp==tp or cp==PLAYER_ALL) then return true end
ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
return ex and (cp==tp or cp==PLAYER_ALL) and Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_RECOVER)
end
function s.reflectop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
else
return
end
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetLabel(cid)
e1:SetValue(s.refcon)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_DAMAGE)
e2:SetTargetRange(0,1)
e2:SetValue(s.damval)
Duel.RegisterEffect(e2,tp)
end
function s.refcon(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel()
end
function s.damval(e,re,val,r,rp,rc)
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return val end
local v=val*math.max(0,13-Duel.GetTurnCount()*3)
return v
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
--print("rmcon",s.enabled[tp],rp,r)
return s.enabled[tp]&2>0 and rp~=tp and r&REASON_EFFECT>0
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_REMOVED,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,1-tp,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct*3,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_REMOVED,0,nil)
if #g==0 then return end
Duel.SendtoDeck(g,tp,SEQ_DECKSHUFFLE,REASON_EFFECT)
local tg=Duel.GetDecktopGroup(tp,#g*3)
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
local fc=Duel.GetFieldCard(1-tp,LOCATION_FZONE,0)
if fc~=nil and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.Remove(fc,POS_FACEUP,REASON_EFFECT)
end
end
function s.drawcon(e,tp,eg,ep,ev,re,r,rp)
return s.enabled[tp]&8>0 and rp~=tp and e:GetHandler():IsPreviousLocation(LOCATION_HAND) and r&REASON_EFFECT>0
end
function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function s.drawop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct==0 then return end
if Duel.Draw(p,ct,REASON_EFFECT)>0 then
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.selectop(e,tp)
e:Reset()
for tp=0,1 do
if Duel.IsExistingMatchingCard(Card.IsCode,tp,~0,0,1,nil,id) then
Duel.Hint(HINT_CARD,0,id)
local option1=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3))
local option2=aux.SelectFromOptions(tp,{option1~=0,aux.Stringid(id,0),0},{option1~=1,aux.Stringid(id,1),1},{option1~=2,aux.Stringid(id,2),2},{option1~=3,aux.Stringid(id,3),3})
s.enabled[tp]=(1<<option1)+(1<<option2)
--print("Enabled options: " .. s.enabled[tp])
if Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
local c=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,id):GetFirst()
if c then
local h=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1):GetFirst()
Duel.SendtoDeck(h,tp,SEQ_DECKSHUFFLE,REASON_RULE)
Duel.SendtoHand(c,nil,REASON_RULE)
end
end
end
end
end
--竹子
local s,id=GetID()
function s.initial_effect(c)
end
function s.register(c,rc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(~LOCATION_REMOVED)
e1:SetValue(rc:GetOriginalCodeRule())
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(rc:GetAttribute())
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_RACE)
e3:SetValue(rc:GetRace())
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e4:SetValue(rc:GetBaseAttack())
c:RegisterEffect(e4)
local e4p=e4:Clone()
e4p:SetCode(EFFECT_SET_ATTACK_FINAL)
c:RegisterEffect(e4p)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE_FINAL)
e5:SetValue(rc:GetBaseDefense())
c:RegisterEffect(e5)
local e5p=e5:Clone()
e5p:SetCode(EFFECT_SET_DEFENSE_FINAL)
c:RegisterEffect(e5p)
local e6=e1:Clone()
e6:SetCode(EFFECT_CHANGE_LEVEL)
e6:SetValue(rc:GetLevel())
c:RegisterEffect(e6)
if rc:IsType(TYPE_XYZ) then
local e6p=e1:Clone()
e6p:SetCode(EFFECT_CHANGE_RANK)
e6p:SetValue(rc:GetRank())
end
-- ocg don't have effects change link number.
-- if rc:IsType(TYPE_LINK) then
-- local e6p=e1:Clone()
-- e6p:SetCode(EFFECT_CHANGE_LINK)
-- e6p:SetValue(rc:GetLink())
-- c:RegisterEffect(e6p)
-- end
local e7=e1:Clone()
e7:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e7)
local e8=e1:Clone()
e8:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e8)
local e9=e1:Clone()
e9:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e9)
c:RegisterFlagEffect(id,RESET_EVENT+RESET_REMOVE,0,1,rc:GetOriginalCodeRule())
end
function s.register2(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_HAND)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tid=c:GetFlagEffectLabel(id)
Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
local g=Duel.GetMatchingGroup(s.refilter,tp,LOCATION_REMOVED,0,nil,tid)
if #g==1 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_RULE)
elseif #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_RULE)
end
end
function s.refilter(c,tid)
return not c:IsFaceup() and c:IsOriginalCodeRule(tid)
end
...@@ -33,7 +33,6 @@ function s.initial_effect(c) ...@@ -33,7 +33,6 @@ function s.initial_effect(c)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetTarget(s.dolltg) e4:SetTarget(s.dolltg)
e4:SetOperation(s.dollop) e4:SetOperation(s.dollop)
e4:SetCountLimit(1,id)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--defusion --defusion
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
...@@ -45,7 +44,7 @@ function s.initial_effect(c) ...@@ -45,7 +44,7 @@ function s.initial_effect(c)
e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e5:SetCondition(s.decon) e5:SetCondition(s.decon)
e5:SetOperation(s.deop) e5:SetOperation(s.deop)
e5:SetCountLimit(1,id) e5:SetCountLimit(1)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
...@@ -75,7 +74,7 @@ function s.dollfilter(c) ...@@ -75,7 +74,7 @@ function s.dollfilter(c)
end end
function s.dolltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.dolltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsControler(1-tp) and s.dollfilter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsControler(1-tp) and s.dollfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.dollfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.dollfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_HAND,0,1,nil,0x9d) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.dollfilter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,s.dollfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
...@@ -135,6 +134,11 @@ function s.dollop(e,tp,eg,ep,ev,re,r,rp) ...@@ -135,6 +134,11 @@ function s.dollop(e,tp,eg,ep,ev,re,r,rp)
e9:SetOperation(s.disop(e7)) e9:SetOperation(s.disop(e7))
token:RegisterEffect(e9) token:RegisterEffect(e9)
end end
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_HAND,0,1,1,nil,0x9d)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end end
function s.disop(te) function s.disop(te)
......
local s,id,o=GetID()
function s.initial_effect(c)
-- ①效果:弹卡特召
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
-- ②效果:降攻800
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
-- ③效果:无效+禁止攻击
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,id)
e4:SetCondition(s.discon)
e4:SetTarget(s.distg)
e4:SetOperation(s.disop)
c:RegisterEffect(e4)
-- ④效果:降攻+防破+弹卡特召
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1,id)
e5:SetTarget(s.efftg)
e5:SetOperation(s.effop)
c:RegisterEffect(e5)
end
-- ①效果条件
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil)
end
-- ①效果目标处理
function s.filter(c)
return c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(id)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
-- ①效果操作
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
-- ②效果操作
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
-- ③效果条件
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(id)~=0 and c:GetFlagEffect(id+100)==0
end
-- ③效果目标
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
e:GetHandler():RegisterFlagEffect(id+100,RESET_EVENT+RESETS_STANDARD,0,1)
end
-- ③效果操作
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
-- ④效果处理
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
-- 降攻800
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
-- 防破保护
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(s.indval)
e2:SetLabelObject(tc)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
-- 弹卡特召
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and e:GetHandler():IsRelateToEffect(e) and Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id)
end
-- ④效果保护条件
function s.indval(e,te,rp)
local tc=e:GetLabelObject()
return te:IsActivated() and te:GetHandler()==tc
end
[LocalizedFileNames]
c19980109.lua=@c19980109.lua,0
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