Commit 1a8fab0f authored by POLYMER's avatar POLYMER

fix

parent acf17349
No preview for this file type
--抵抗巨炮 沃克
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
--SpOrToGraveFromHand
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--ToGraveAndAtkUpAndDraw
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
end
--e1
function s.e1actfilter(c,tp)
return c:IsSetCard(zd) and c:IsType(TYPE_CONTINUOUS) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function s.e1con(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE,c,1,tp,LOCATION_HAND)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and (c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then
local op = 0
if c:IsAbleToGrave() and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
op = Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif c:IsAbleToGrave() then
Duel.SelectOption(tp,aux.Stringid(id,3))
op = 1
else
Duel.SelectOption(tp,aux.Stringid(id,2))
op = 0
end
if op == 0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoGrave(c,nil,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.e1actfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ACTIVATE)
local tc = Duel.SelectMatchingCard(tp,s.e1actfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te = tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep = tc:GetControler()
local cost = te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,id,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
local e1 = Effect.CreateEffect(c)
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,2)
Duel.RegisterEffect(e1,tp)
local e2 = e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(zd)
end
--e2
function s.e2togfilter(c)
return c:IsSetCard(zd) and c:IsFaceup() and c:IsAbleToGrave()
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk == 0 then return c:IsAbleToGrave() and Duel.IsExistingMatchingCard(s.e2togfilter,tp,LOCATION_ONFIELD,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,nil,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,nil,tp,0)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,nil,nil,tp,LOCATION_MZONE)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if not (c:IsRelateToEffect(e) and (c:IsAbleToGrave() and Duel.IsExistingMatchingCard(s.e2togfilter,tp,LOCATION_ONFIELD,0,1,c)))then return end
--ToGrave
local max = Duel.GetMatchingGroup(s.e2togfilter,tp,LOCATION_ONFIELD,0,c):GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g = Duel.SelectMatchingCard(tp,s.e2togfilter,tp,LOCATION_ONFIELD,0,1,max,c)
Duel.SendtoGrave(c+g,nil,REASON_EFFECT)
--UpAtk
local upg = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc = upg:GetFirst()
local upn = g:GetCount()+1
while tc do
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1000*upn)
tc:RegisterEffect(e1)
tc = upg:GetNext()
end
--Draw
local ct = 1
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
ct=ct+1
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
ct=ct+1
end
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(ct)
e2:SetCondition(s.e2dracon)
e2:SetOperation(s.e2draop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.e2dracon(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
return Duel.IsPlayerCanDraw(tp,draN)
end
function s.e2draop(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
if Duel.IsPlayerCanDraw(tp,draN) and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.Draw(tp,draN,REASON_EFFECT)
end
end
--抵抗巨炮 美太那
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
--SpOrToGraveFromHand
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--HandToDeckAndAtkUpAndDraw
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_ATKCHANGE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
end
--e1
function s.e1tohfilter(c)
return c:IsSetCard(zd) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function s.e1con(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE,c,1,tp,LOCATION_HAND)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and (c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then
local op = 0
if c:IsAbleToGrave() and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
op = Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif c:IsAbleToGrave() then
Duel.SelectOption(tp,aux.Stringid(id,3))
op = 1
else
Duel.SelectOption(tp,aux.Stringid(id,2))
op = 0
end
if op == 0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoGrave(c,nil,REASON_EFFECT)
if Duel.IsExistingMatchingCard(s.e1tohfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOHAND)
local tc = Duel.SelectMatchingCard(tp,s.e1tohfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
local e1 = Effect.CreateEffect(c)
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,2)
Duel.RegisterEffect(e1,tp)
local e2 = e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(zd)
end
--e2
function s.e2todfilter(c)
return c:IsAbleToDeck()
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(s.e2todfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,nil,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,nil,tp,0)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,nil,nil,tp,LOCATION_MZONE)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if not (Duel.IsExistingMatchingCard(s.e2todfilter,tp,LOCATION_HAND,0,1,nil)) then return end
--ToDeck
local max = Duel.GetMatchingGroup(s.e2todfilter,tp,LOCATION_HAND,0,nil):GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g = Duel.SelectMatchingCard(tp,s.e2todfilter,tp,LOCATION_HAND,0,1,max,nil)
Duel.SendtoDeck(g,nil,3,REASON_EFFECT)
--UpAtk
local upg = Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc = upg:GetFirst()
local upn = g:GetCount()
while tc do
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1000*upn)
tc:RegisterEffect(e1)
tc = upg:GetNext()
end
--Draw
local ct = 0
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
ct=ct+1
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
ct=ct+1
end
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
ct=ct+1
end
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(ct)
e2:SetCondition(s.e2dracon)
e2:SetOperation(s.e2draop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.e2dracon(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
return Duel.IsPlayerCanDraw(tp,draN)
end
function s.e2draop(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
if Duel.IsPlayerCanDraw(tp,draN) and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.Draw(tp,draN,REASON_EFFECT)
end
end
--抵抗巨炮 范德
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
--SpOrToGraveFromHand
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--FieldToGraOpAndDraw
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
end
--e1
function s.e1tohfilter(c)
return c:IsSetCard(zd) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER) and not c:IsCode(id)
end
function s.e1spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id)
end
function s.e1con(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE,c,1,tp,LOCATION_HAND)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and (c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then
local op = 0
if c:IsAbleToGrave() and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
op = Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif c:IsAbleToGrave() then
Duel.SelectOption(tp,aux.Stringid(id,3))
op = 1
else
Duel.SelectOption(tp,aux.Stringid(id,2))
op = 0
end
if op == 0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoGrave(c,nil,REASON_EFFECT)
local op2=-1
if Duel.IsExistingMatchingCard(s.e1tohfilter,tp,LOCATION_GRAVE,0,2,nil) and Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_GRAVE,0,2,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 1 and Duel.SelectYesNo(tp,aux.Stringid(id,4))
then
op2 = Duel.SelectOption(tp,aux.Stringid(id,5),aux.Stringid(id,6))
elseif Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_GRAVE,0,2,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 1 and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
op2=0
elseif Duel.IsExistingMatchingCard(s.e1tohfilter,tp,LOCATION_GRAVE,0,2,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,6)) then
op2=1
end
if op2==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g = Duel.SelectMatchingCard(tp,s.e1spfilter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
elseif op2==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOHAND)
local g = Duel.SelectMatchingCard(tp,s.e1tohfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
local e1 = Effect.CreateEffect(c)
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,2)
Duel.RegisterEffect(e1,tp)
local e2 = e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(zd)
end
--e2
function s.e2togfilter(c)
return c:IsAbleToGrave() and c:IsFaceup()
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk == 0 then return
Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(s.e2togfilter,tp,0,LOCATION_ONFIELD,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,nil,tp,LOCATION_OMFIELD)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,nil,tp,0)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if not (Duel.IsExistingMatchingCard(s.e2togfilter,tp,LOCATION_ONFIELD,0,1,nil)) then return end
--ToGrave
local max = Duel.GetMatchingGroup(s.e2togfilter,tp,LOCATION_ONFIELD,0,nil):GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g = Duel.SelectMatchingCard(tp,s.e2togfilter,tp,LOCATION_ONFIELD,0,1,max,nil)
Duel.SendtoGrave(g,nil,REASON_EFFECT)
--ToGraveOpAndDraw
local ct = 0
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
ct=ct+1
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
ct=ct+1
end
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
ct=ct+1
end
if (Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,nil)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local og = Duel.SelectMatchingCard(tp,s.e2togfilter,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SendtoGrave(og,nil,REASON_EFFECT)
end
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(ct)
e2:SetCondition(s.e2dracon)
e2:SetOperation(s.e2draop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.e2dracon(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
return Duel.IsPlayerCanDraw(tp,draN)
end
function s.e2draop(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
if Duel.IsPlayerCanDraw(tp,draN) and Duel.SelectYesNo(tp,aux.Stringid(id,7)) then
Duel.Draw(tp,draN,REASON_EFFECT)
end
end
--抵抗巨炮 里德
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
--SpOrToGraveFromHand
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--ToGraveSelfOpAndDraw
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
end
--e1
function s.e1actfilter(c)
return c:IsSetCard(zd) and c:IsType(TYPE_CONTINUOUS) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function s.e1con(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE,c,1,tp,LOCATION_HAND)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and (c:IsAbleToGrave() or Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then
local op = 0
if c:IsAbleToGrave() and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
op = Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif c:IsAbleToGrave() then
Duel.SelectOption(tp,aux.Stringid(id,3))
op = 1
else
Duel.SelectOption(tp,aux.Stringid(id,2))
op = 0
end
if op == 0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoGrave(c,nil,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_SZONE) > 1 and Duel.IsExistingMatchingCard(s.e1actfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,2,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ACTIVATE)
local g = Duel.SelectMatchingCard(tp,s.e1actfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,2,2,nil)
tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te = tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep = tc:GetControler()
local cost = te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,id,te,0,tp,tp,Duel.GetCurrentChain())
tc=g:GetNext()
end
end
end
local e1 = Effect.CreateEffect(c)
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,2)
Duel.RegisterEffect(e1,tp)
local e2 = e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
end
function s.splimit(e,c)
return not c:IsSetCard(zd)
end
--e2
function s.e2togfilter(c)
return c:IsAbleToGrave() and c:IsFaceup()
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(s.e2togfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,nil,tp,LOCATION_OMFIELD)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,nil,tp,0)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if not (Duel.IsExistingMatchingCard(s.e2togfilter,tp,LOCATION_ONFIELD,0,1,nil))
then return end
--ToGrave
local max = Duel.GetMatchingGroup(s.e2togfilter,tp,LOCATION_ONFIELD,0,nil):GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g = Duel.SelectMatchingCard(tp,s.e2togfilter,tp,LOCATION_ONFIELD,0,1,max,nil)
Duel.SendtoGrave(g,nil,REASON_EFFECT)
--ToGraveOpAndDraw
local ct = 0
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
ct=ct+1
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
ct=ct+1
end
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
ct=ct+1
end
if (Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,nil)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local og = Duel.SelectMatchingCard(tp,s.e2togfilter,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SendtoGrave(og,nil,REASON_EFFECT)
end
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabel(ct)
e2:SetCondition(s.e2dracon)
e2:SetOperation(s.e2draop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function s.e2dracon(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
return Duel.IsPlayerCanDraw(tp,draN)
end
function s.e2draop(e,tp,eg,ep,ev,re,r,rp)
local draN = e:GetLabel()
if Duel.IsPlayerCanDraw(tp,draN) and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Draw(tp,draN,REASON_EFFECT)
end
end
--抵抗巨炮 安那米
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
--SpOnOpFromHand
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--OrigOwnerDrawWhenSpSum
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
end
--e1
function s.e1con(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_HAND)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP)
local e1 = Effect.CreateEffect(c)
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,2)
Duel.RegisterEffect(e1,c:GetOwner())
local e2 = e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,c:GetOwner())
end
end
function s.splimit(e,c)
return not c:IsSetCard(zd)
end
--e2
function s.e2tohfilter(c)
return c:IsSetCard(zd) and c:IsAbleToHand()
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(s.e2tohfilter,c:GetOwner() ,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,nil,c:GetOwner(),LOCATION_DECK)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if not (Duel.IsExistingMatchingCard(s.e2tohfilter,c:GetOwner() ,LOCATION_DECK,0,1,nil))
then return end
Duel.Hint(HINT_SELECTMSG,c:GetOwner(),HINTMSG_TOHAND)
local g = Duel.SelectMatchingCard(c:GetOwner(),s.e2tohfilter,c:GetOwner(),LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
--抵抗巨炮 地表之上
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,zd),3)
c:EnableReviveLimit()
--SSpSumonh
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--SetSpellAndTrapWhenTurnEnd
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetCost(s.e2cost)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--cannot be destroyed
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(s.e3filter)
c:RegisterEffect(e3)
end
--e1
function s.e1con(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) and ep~=tp
end
function s.e1destfilter(c)
return c:IsSetCard(zd) and c:IsDestructable()
end
function s.e1spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsType(TYPE_LINK)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_MZONE)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e1spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
if not (Duel.IsExistingMatchingCard(s.e1desfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,HINTMSG_DISABLE)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectMatchingCard(tp,s.e1desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Destroy(g2,nil,REASON_EFFECT)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--e2
function s.e2setfilter(c)
return c:IsSetCard(zd) and c:IsType(TYPE_CONTINUOUS)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil) end
end
function s.e2cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return (Duel.GetLocationCount(tp,LOCATION_SZONE) == 0 and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp ,LOCATION_SZONE,0,1,nil)) or (Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp ,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil))
end
local g=nil
if Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp ,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil)
then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g = Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g = Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_SZONE,0,1,1,nil)
end
Duel.SendtoGrave(g,nil,REASON_EFFECT+REASON_COST)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SSET)
local tc = Duel.SelectMatchingCard(tp,e2setfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
Duel.SSet(tp,tc)
end
--e3
function s.e3filter(e,re)
local tc=re:GetHandler()
local c=e:GetHandler()
return re:IsActiveType(TYPE_EFFECT) and tc:IsAttackBlow(c:GetAttack()) and not re:IsControler(tp)
end
--抵抗巨炮 聚合冲击
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,zd),2)
c:EnableReviveLimit()
--SpSumWhenEffectLeave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--SetSpellAndTrapWhenTurnEnd
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetCost(s.e2cost)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(s.e3filter)
c:RegisterEffect(e3)
end
--e1
function s.e1leavfilter(c)
return c:IsReason(REASON_EFFECT)
end
function s.e1con(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(s.e1leavfilter,1,nil)
end
function s.e1destfilter(c)
return c:IsSetCard(zd) and c:IsDestructable()
end
function s.e1spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsType(TYPE_LINK)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_ONFIELD)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
if not (Duel.IsExistingMatchingCard(s.e1desfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,HINTMSG_TOGRAVE)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectMatchingCard(tp,s.e1desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Destroy(g2,nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoGrave(g3,nil,REASON_EFFECT)
end
--e2
function s.e2setfilter(c)
return c:IsSetCard(zd) and c:IsType(TYPE_CONTINUOUS)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil) end
end
function s.e2cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp ,LOCATION_SZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g = Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCos,tp,LOCATION_SZONE,0,2,2,nil)
Duel.SendtoGrave(g,nil,REASON_EFFECT+REASON_COST)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SSET)
local tc = Duel.SelectMatchingCard(tp,e2setfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
Duel.SSet(tp,tc)
end
--e3
function s.e3filter(e,re)
local tc=re:GetHandler()
local c=e:GetHandler()
return re:IsActiveType(TYPE_EFFECT) and tc:IsAttackBlow(c:GetAttack()) and not re:IsControler(e:GetControler())
end
--抵抗巨炮 机炮连发
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,zd),2)
c:EnableReviveLimit()
--SpSumWhenAdToHand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--SetSpellAndTrapWhenTurnEnd
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetCost(s.e2cost)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--cimmue neagea and disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE)
e3:SetValue(s.e3filter)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISEFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(s.e4filter)
c:RegisterEffect(e4)
end
--e1
function s.e1destfilter(c)
return c:IsSetCard(zd) and c:IsDestructable()
end
function s.e1spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsType(TYPE_LINK)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_HAND)
end
function s.e1con(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_DECK) and r==REASON_EFFECT
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
if not (Duel.IsExistingMatchingCard(s.e1desfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil) and Duel.SelectYesNo(tp,HINTMSG_TODECK)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectMatchingCard(tp,s.e1desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Destroy(g2,nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g3=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local g4=Duel.SelectMatchingCard(1-tp,Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,1,nil)
Duel.SendtoDeck(g3+g4,nil,3,REASON_EFFECT)
end
--e2
function s.e2setfilter(c)
return c:IsSetCard(zd) and c:IsType(TYPE_CONTINUOUS)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil) end
end
function s.e2cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp ,LOCATION_MZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g = Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCos,tp,LOCATION_MZONE,0,2,2,nil)
Duel.SendtoGrave(g,nil,REASON_EFFECT+REASON_COST)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SSET)
local tc = Duel.SelectMatchingCard(tp,e2setfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
Duel.SSet(tp,tc)
end
--e3
function s.e3filter(e,re)
local tc=re:GetHandler()
local c=e:GetHandler()
return re:IsActiveType(TYPE_EFFECT) and tc:IsAttackBlow(c:GetAttack()) and not re:IsControler(tp)
end
function s.e4filter(e,ct)
local c=e:GetHandler()
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler()==e:GetHandler() and te:IsActiveType(TYPE_EFFECT) and te:GetHandler():IsAttackBelow(c:GetAttack()) and not te:GetHandler():IsControler(c:GetOwner())
end
\ No newline at end of file
--抵抗巨炮 定点压制
local s,id,o = GetID()
local zd = 0x3d4
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,zd),2,2)
c:EnableReviveLimit()
--SpSumWhenActOnField
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.e1con)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--SetSpellAndTrapWhenTurnEnd
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.e2tg)
e2:SetCost(s.e2cost)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--cimmue neagea and disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE)
e3:SetValue(s.e3filter)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISEFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(s.e4filter)
c:RegisterEffect(e4)
end
--e1
function s.e1spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsType(TYPE_LINK)
end
function s.e1actfilter(c,tp)
return c:IsCode(32000718) and c:GetActivateEffect():IsActivatable(tp,true,true) and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
end
function s.e1con(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD)
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_HAND)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e1spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
if not (Duel.IsExistingMatchingCard(s.e1actfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3))) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ACTIVATE)
local tc = Duel.SelectMatchingCard(tp,s.e1actfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,tp):GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te = tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep = tc:GetControler()
local cost = te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,id,te,0,tp,tp,Duel.GetCurrentChain())
end
--e2
function s.e2setfilter(c)
return c:IsSetCard(zd) and c:IsType(TYPE_CONTINUOUS)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil) end
end
function s.e2cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
if chk == 0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp ,LOCATION_HAND,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g = Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCos,tp,LOCATION_HAND,0,2,2,nil)
Duel.SendtoGrave(g,nil,REASON_EFFECT+REASON_COST)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetLocationCount(tp,LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.e2setfilter,tp ,LOCATION_GRAVE,0,1,nil)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SSET)
local tc = Duel.SelectMatchingCard(tp,e2setfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
Duel.SSet(tp,tc)
end
--e3
function s.e3filter(e,re)
local tc=re:GetHandler()
local c=e:GetHandler()
return re:IsActiveType(TYPE_EFFECT) and tc:IsAttackBlow(c:GetAttack()) and not re:IsControler(tp)
end
function s.e4filter(e,ct)
local c=e:GetHandler()
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler()==e:GetHandler() and te:IsActiveType(TYPE_EFFECT) and te:GetHandler():IsAttackBelow(c:GetAttack()) and not te:GetHandler():IsControler(c:GetOwner())
end
\ No newline at end of file
--世界最后的工厂
local s,id,o=GetID()
local zd=0x3d4
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.e1tg)
e1:SetOperation(s.e1op)
c:RegisterEffect(e1)
--atSpSumon and Link when chaining
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,id+1)
e2:SetCondition(s.e2con)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--RGReturnToDeckAndDrawWhenLinkSpumm9m
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,id+2)
e3:SetCondition(s.e3con)
e3:SetTarget(s.e3tg)
e3:SetOperation(s.e3op)
c:RegisterEffect(e3)
end
--e1
function s.e1tohfilter(c)
return c:IsSetCard(zd) and c:IsAbleToHand()
end
function s.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e1tohfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SEARCH+CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end
function s.e1op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e1tohfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,HINTMSG_ATOHAND)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.e1tohfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
--e2
function s.e2con(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function s.e2spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.e2lkfilter(c,lc)
return c:IsSetCard(zd) and c:IsLinkSummonable(nil,lc)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e2spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local lmc=g:GetFirst()
if not (Duel.IsExistingMatchingCard(s.e2lkfilter,tp,LOCATION_EXTRA,0,1,nil,lmc) and Duel.SelectYesNo(tp,aux.Stringid(id,3))) then return end
local g=Duel.GetMatchingGroup(s.e2lkfilter,tp,LOCATION_EXTRA,0,nil,lmc)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.LinkSummon(tp,sg:GetFirst(),nil,lmc)
end
end
--e3
function s.e3cfilter(c,tp,sumt)
return c:IsFaceup() and c:IsSetCard(zd) and c:IsSummonType(sumt) and c:IsSummonPlayer(tp)
end
function s.e3con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.e3cfilter,1,nil,tp,SUMMON_TYPE_LINK)
end
function s.e3todfilter(c)
return c:IsAbleToDeck() and c:IsSetCard(zd) and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
end
function s.e3tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e3todfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,1,tp,0)
end
function s.e3op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e3todfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,s.e3todfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,3,nil)
Duel.SendtoDeck(g2,nil,3,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
--抵抗巨炮 修理站
local s,id,o=GetID()
local zd=0x3d4
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--SpSumWhebnAdToHand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.e2con)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--OpFGReturnToDeckWhenLinkSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+1)
e3:SetCondition(s.e3con)
e3:SetTarget(s.e3tg)
e3:SetOperation(s.e3op)
c:RegisterEffect(e3)
end
--e2
function s.e2con(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_DECK) and r==REASON_EFFECT
end
function s.e2spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.e2lkfilter(c,lc)
return c:IsSetCard(zd) and c:IsLinkSummonable(nil,lc)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e2spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local lmc=g:GetFirst()
if not (Duel.IsExistingMatchingCard(s.e2lkfilter,tp,LOCATION_EXTRA,0,1,nil,lmc) and Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
local g=Duel.GetMatchingGroup(s.e2lkfilter,tp,LOCATION_EXTRA,0,nil,lmc)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.LinkSummon(tp,sg:GetFirst(),nil,lmc)
end
end
--e3
function s.e3cfilter(c,tp,sumt)
return c:IsFaceup() and c:IsSetCard(zd) and c:IsSummonType(sumt) and c:IsSummonPlayer(tp)
end
function s.e3con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.e3cfilter,1,nil,tp,SUMMON_TYPE_LINK)
end
function s.e3tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
local g=nil
if eg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMESG_TARGET)
g=eg:Select(tp,1,1,nil)
else
g=eg:GetFirst()
end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_ONFIELD)
end
function s.e3op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil)) then return end
local todn=Duel.Get
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if not(c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e))
then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,s.e3todfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,tc:GetLink(),nil)
Duel.SendtoDeck(g2,nil,3,REASON_EFFECT)
end
--抵抗巨炮 回收站
local s,id,o=GetID()
local zd=0x3d4
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--SpSumWhebnMonsterLevae
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.e2con)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--SelfFGReturnToDeckAndDrawWhenLinkSpumm
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+1)
e3:SetCondition(s.e3con)
e3:SetTarget(s.e3tg)
e3:SetOperation(s.e3op)
c:RegisterEffect(e3)
end
--e2
function s.e2confilter(c)
return c:IsType(TYPE_MONSTER) and c:IsReason(REASON_EFFECT)
end
function s.e2con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.e2confilter,1,nil)
end
function s.e2spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.e2lkfilter(c,lc)
return c:IsSetCard(zd) and c:IsLinkSummonable(nil,lc)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e2spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local lmc=g:GetFirst()
if not (Duel.IsExistingMatchingCard(s.e2lkfilter,tp,LOCATION_EXTRA,0,1,nil,lmc) and Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
local g=Duel.GetMatchingGroup(s.e2lkfilter,tp,LOCATION_EXTRA,0,nil,lmc)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.LinkSummon(tp,sg:GetFirst(),nil,lmc)
end
end
--e3
function s.e3cfilter(c,tp,sumt)
return c:IsFaceup() and c:IsSetCard(zd) and c:IsSummonType(sumt) and c:IsSummonPlayer(tp)
end
function s.e3con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.e3cfilter,1,nil,tp,SUMMON_TYPE_LINK)
end
function s.e3todfilter(c)
return c:IsAbleToDeck() and c:IsSetCard(zd) and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
end
function s.e3tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e3todfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,1,tp,0)
end
function s.e3op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e3todfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,s.e3todfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,3,nil)
Duel.SendtoDeck(g2,nil,3,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
--抵抗巨炮 替换站
local s,id,o=GetID()
local zd=0x3d4
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--SpSumWhenActOnField
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
--e2:SetCondition(s.e2con)
e2:SetTarget(s.e2tg)
e2:SetOperation(s.e2op)
c:RegisterEffect(e2)
--SelfFGReturnToDeckAndDrawWhenLinkSpumm
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+1)
e3:SetCondition(s.e3con)
e3:SetTarget(s.e3tg)
e3:SetOperation(s.e3op)
c:RegisterEffect(e3)
end
--e2
function s.e2con(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD)
end
function s.e2spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.e2lkfilter(c,lc)
return c:IsSetCard(zd) and c:IsLinkSummonable(nil,lc)
end
function s.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function s.e2op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e2spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE) > 0) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.e2spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local lmc=g:GetFirst()
if not (Duel.IsExistingMatchingCard(s.e2lkfilter,tp,LOCATION_EXTRA,0,1,nil,lmc) and Duel.SelectYesNo(tp,aux.Stringid(id,2))) then return end
local g=Duel.GetMatchingGroup(s.e2lkfilter,tp,LOCATION_EXTRA,0,nil,lmc)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.LinkSummon(tp,sg:GetFirst(),nil,lmc)
end
end
--e3
function s.e3cfilter(c,tp,sumt)
return c:IsFaceup() and c:IsSetCard(zd) and c:IsSummonType(sumt) and c:IsSummonPlayer(tp)
end
function s.e3spfilter(c,e,tp)
return c:IsSetCard(zd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.e3con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.e3cfilter,1,nil,tp,SUMMON_TYPE_LINK)
end
function s.e3togfilter(c)
return c:IsAbleToGrave() and c:IsSetCard(zd)
end
function s.e3tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.e3togfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.e3spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function s.e3op(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(s.e3togfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.e3spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.e3togfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,s.e3spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,g,e,tp)
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -2,7 +2,7 @@
local m=98941050
local cm=_G["c"..m]
cm.name="Ritual"
cm.list={66069967,19516687,90027012,80701178,53180020,67503139,16312943,34358408,66399675,77153811,39905966,52738610,27796375,84388461,23401839,95492061,29888389,56827051,82128978,32013448,50155385,46123974,4141820,90307777,82085295,93506862,47106439,38356857,22420202,33543890,60037599,96026108,97148796,46485778,34334692,30492798,59913418,96915510,78316184,13518809,88926295,39618799,91668401,25726386,63233638,99628747,88106656,47963370,3909436,65877963,12266229,3629090,95825679,52495649,99427357,50139096,86124104,63056220,52707042,15001940,10925955,13048472,64442155,65450690,72386290,96729612,99426088,7986397,8428836,9236985,11398951,13386407,14094090,14166715,14735698,16310544,16494704,17888577,21082832,23459650,28429121,31002402,34767865,36350300,36982581,37626500,38784726,39996157,41085464,44221928,45948430,46052429,46159582,47435107,51124303,52913738,59820352,60234913,60921537,69035382,80566312,85327820,86758915,87778106,94666032,97211663,27331568,57970721,59514116,69003792,95612049,14220547,15590355,25796442,33971095,35569555,84121302,88301833,91946859,93754402,48206762,54351224,55976207,13482262,15306543,15388353,18890039,40089744,69217334,84504242,95658967,90444325,36849933,34072799,89016236,8454126,53618197,78990927,26223582,2266498,9145181,20417688,38844957,42158279,44889144,51510279,53174748,64437633,88083109,14478717,40551410,81306186,84965420,87955518,98904974,29904964,42600274,31772684,6628343,33145233,8903700,67267333,49477180,33245030,20560620,49394035,70491682,51522296,69815951,95209656,48546368,21105106,39468724,88240999,52068432,42932862,55410871,52900000,70551291,20654247,34093683,98287529,25857246,16313112,25415052,45877457,72566043,66425726,61757117,74122412,30646525,37061511,35330871,56350972,11877465,71406430,45222299,4388680,26674724,13482075,52846880,89463537,19489718,60823690,33325951,48654323,45001322,99185129,88176533,8198712,8955148,9786492,18803791,20071842,27383110,30392583,32828635,34834619,41426869,45410988,55761792,58827995,62835876,73055622,78577570,79306385,80811661,94377247,96420087,21862633,44182827,23160024,32354768,22888900,54094821,60375194,76552147,45675980,69120785,4335427,64202399,90583279,72656408,18474999,15397015,35618486,63942761,57617178,31118030,53303460,57357130,20228463,76103404,28053106,41306080,66729231,94997874,54484652,57272170,98941050,71203602,24731391,77235086,30334522,86401517,64631466,65037172,1969506,12470447,41850466,83308376,99162753,83533296,98850929,9553721,48784854,96239878,56787189,58793369,2287848,36809777,46337945,83326048,94423983,14005031,17722185,56863746,22435424,24166324,61773610,10804018,39114494,10774240,25801745,51296484,88284599,52472775,98477480,86310763}
cm.list={66069967,19516687,90027012,80701178,53180020,67503139,16312943,34358408,66399675,77153811,39905966,52738610,27796375,84388461,23401839,95492061,29888389,56827051,82128978,32013448,50155385,46123974,4141820,90307777,82085295,93506862,47106439,38356857,22420202,33543890,60037599,96026108,97148796,46485778,34334692,30492798,59913418,96915510,78316184,13518809,88926295,39618799,91668401,25726386,63233638,99628747,88106656,47963370,3909436,65877963,12266229,3629090,95825679,52495649,99427357,50139096,86124104,63056220,52707042,15001940,10925955,13048472,64442155,65450690,72386290,96729612,99426088,7986397,8428836,9236985,11398951,13386407,14094090,14166715,14735698,16310544,16494704,17888577,21082832,23459650,28429121,31002402,34767865,36350300,36982581,37626500,38784726,39996157,41085464,44221928,45948430,46052429,46159582,47435107,51124303,52913738,59820352,60234913,60921537,69035382,80566312,85327820,86758915,87778106,94666032,97211663,27331568,57970721,59514116,69003792,95612049,14220547,15590355,25796442,33971095,35569555,84121302,88301833,91946859,93754402,48206762,54351224,55976207,13482262,15306543,15388353,18890039,40089744,69217334,84504242,95658967,90444325,36849933,34072799,89016236,8454126,53618197,78990927,26223582,2266498,9145181,20417688,38844957,42158279,44889144,51510279,53174748,64437633,88083109,14478717,40551410,81306186,84965420,87955518,98904974,29904964,42600274,31772684,6628343,33145233,8903700,67267333,49477180,33245030,20560620,49394035,70491682,51522296,69815951,95209656,48546368,21105106,39468724,88240999,52068432,42932862,55410871,52900000,70551291,20654247,34093683,98287529,25857246,16313112,25415052,45877457,72566043,66425726,61757117,74122412,30646525,37061511,35330871,56350972,11877465,71406430,45222299,4388680,26674724,13482075,52846880,89463537,19489718,60823690,33325951,48654323,45001322,99185129,88176533,8198712,8955148,9786492,18803791,20071842,27383110,30392583,32828635,34834619,41426869,45410988,55761792,58827995,62835876,73055622,78577570,79306385,80811661,94377247,96420087,21862633,44182827,23160024,32354768,22888900,54094821,60375194,76552147,45675980,69120785,4335427,64202399,90583279,72656408,18474999,15397015,35618486,63942761,57617178,31118030,53303460,57357130,20228463,76103404,28053106,41306080,66729231,94997874,54484652,57272170,98941049,71203602,24731391,77235086,30334522,86401517,64631466,65037172,1969506,12470447,41850466,83308376,99162753,83533296,98850929,9553721,48784854,96239878,56787189,58793369,2287848,36809777,46337945,83326048,94423983,14005031,17722185,56863746,22435424,24166324,61773610,10804018,39114494,10774240,25801745,51296484,88284599,52472775,98477480,86310763,100227072,100227073,100227075,92487128,100227074,43219114,87003671,51618973,13408726,50596425}
function c98941050.initial_effect(c)
--c:EnableReviveLimit()
aux.AddCodeList(c,98941050)
......@@ -191,7 +191,6 @@ function c98941050.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c98941050.fcfilter,tp,LOCATION_MZONE,0,1,ct,nil)
if Duel.Remove(rg,0,REASON_COST+REASON_TEMPORARY)~=0 then
rg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment