Commit f7d73b1b authored by mercury233's avatar mercury233

new cards FLOD-EN

parent ba49cffb
--F.A. Overheat
function c32036866.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c32036866.condition)
e1:SetTarget(c32036866.target)
e1:SetOperation(c32036866.activate)
c:RegisterEffect(e1)
--activate Spell
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c32036866.condition2)
e2:SetCost(aux.bfgcost)
e2:SetOperation(c32036866.activate2)
c:RegisterEffect(e2)
end
function c32036866.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c32036866.filter(c,e,tp)
return c:IsSetCard(0x107) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c32036866.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c32036866.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c32036866.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,c32036866.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(3)
tc:RegisterEffect(e1)
end
end
function c32036866.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldCard(tp,LOCATION_SZONE,5)==nil
end
function c32036866.filter2(c,e,tp)
return c:IsSetCard(0x107) and c:IsType(TYPE_FIELD)
end
function c32036866.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c32036866.filter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c32036866.filter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.RaiseEvent(tc,4179255,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
end
end
end
--F.A. Dawn Dragster
function c33158448.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c33158448.atkval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(aux.chainreg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33158448,0))
e3:SetCategory(CATEGORY_LVCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c33158448.lvcon)
e3:SetOperation(c33158448.lvop)
c:RegisterEffect(e3)
--pierce
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e4)
--negate
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(33158448,1))
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetCountLimit(1)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c33158448.negcon)
e5:SetTarget(c33158448.negtg)
e5:SetOperation(c33158448.negop)
c:RegisterEffect(e5)
end
function c33158448.atkval(e,c)
return c:GetLevel()*300
end
function c33158448.lvcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107) and e:GetHandler():GetFlagEffect(1)>0
end
function c33158448.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(1)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e4)
end
end
function c33158448.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c33158448.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLevelAbove(3) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c33158448.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or c:IsLevelBelow(2) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-2)
c:RegisterEffect(e1)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--Vendread Nightmare
function c33971095.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--increase lv
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c33971095.lvcost)
e2:SetTarget(c33971095.lvtg)
e2:SetOperation(c33971095.lvop)
c:RegisterEffect(e2)
--increase atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,33971095)
e3:SetCondition(c33971095.atkcon)
e3:SetOperation(c33971095.atkop)
c:RegisterEffect(e3)
end
function c33971095.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c33971095.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x106)
end
function c33971095.filter(c,tp)
return c:IsFaceup() and c:IsLevelAbove(1) and Duel.CheckReleaseGroup(tp,c33971095.cfilter,1,c,c)
end
function c33971095.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c33971095.filter(chkc) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.IsExistingTarget(c33971095.filter,tp,LOCATION_MZONE,0,1,nil,tp)
else
return false
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectTarget(tp,c33971095.filter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
local sg=Duel.SelectReleaseGroup(tp,c33971095.cfilter,1,1,tc,tc)
Duel.Release(sg,REASON_COST)
e:SetLabel(sg:GetCount())
end
function c33971095.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c33971095.atkcon(e,tp,eg,ep,ev,re,r,rp)
local rc=eg:GetFirst()
return rc==Duel.GetAttacker() and rc:IsStatus(STATUS_OPPO_BATTLE) and rc:IsFaceup()
and bit.band(rc:GetType(),0x81)==0x81 and rc:IsSetCard(0x106) and rc:IsControler(tp)
end
function c33971095.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetAttacker()
if tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
--Revendread Executor
function c34093683.initial_effect(c)
c:EnableReviveLimit()
--change name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(4388680)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetCondition(c34093683.tgcon)
e2:SetTarget(c34093683.tgtg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(34093683,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,34093683)
e3:SetCondition(c34093683.thcon)
e3:SetTarget(c34093683.thtg)
e3:SetOperation(c34093683.thop)
c:RegisterEffect(e3)
end
function c34093683.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c34093683.tgtg(e,c)
return c~=e:GetHandler()
end
function c34093683.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp))
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c34093683.thfilter(c)
return c:IsSetCard(0x106) and c:IsAbleToHand()
end
function c34093683.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c34093683.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c34093683.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c34093683.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--F.A. Dead Heat
function c5641251.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_ATTACK)
e1:SetTarget(c5641251.acttg)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(5641251,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,5641251)
e2:SetCondition(c5641251.spcon)
e2:SetCost(c5641251.spcost)
e2:SetTarget(c5641251.sptg)
e2:SetOperation(c5641251.spop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(5641251,1))
e3:SetCategory(CATEGORY_LVCHANGE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_CONFIRM)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c5641251.lvlcon)
e3:SetOperation(c5641251.lvlop)
c:RegisterEffect(e3)
end
function c5641251.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) then
if c5641251.spcon(e,tp,eg,ep,ev,re,r,rp)
and c5641251.spcost(e,tp,eg,ep,ev,re,r,rp,0)
and c5641251.sptg(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(0)
e:SetOperation(c5641251.spop)
c5641251.spcost(e,tp,eg,ep,ev,re,r,rp,1)
c5641251.sptg(e,tp,eg,ep,ev,re,r,rp,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,65)
return
end
end
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
function c5641251.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c5641251.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,5641251)==0 end
Duel.RegisterFlagEffect(tp,5641251,RESET_PHASE+PHASE_END,0,1)
end
function c5641251.spfilter(c,e,tp)
return c:IsSetCard(0x107) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c5641251.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c5641251.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c5641251.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c5641251.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c5641251.lvlcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
if not bc then return false end
if tc:IsControler(1-tp) then bc,tc=tc,bc end
return bc:IsFaceup() and tc:IsFaceup() and tc:IsSetCard(0x107)
end
function c5641251.lvlop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
if not bc then return false end
if tc:IsControler(1-tp) then bc,tc=tc,bc end
local d1=0
local d2=0
while d1==d2 do
d1,d2=Duel.TossDice(tp,1,1)
end
if d1>d2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(4)
tc:RegisterEffect(e1)
else
Duel.Destroy(tc,REASON_EFFECT)
end
end
--Vendread Daybreak
function c60375194.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,60375194+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c60375194.condition)
e1:SetTarget(c60375194.target)
e1:SetOperation(c60375194.activate)
c:RegisterEffect(e1)
end
function c60375194.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
end
function c60375194.filter(c)
return c:IsFaceup() and c:IsSetCard(0x106) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c60375194.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60375194.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount()-1,0,0)
end
function c60375194.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,c60375194.filter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if not tc then return end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tc)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
--F.A. Dark Dragster
function c6764709.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c6764709.spcon)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c6764709.atkval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(aux.chainreg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(6764709,0))
e4:SetCategory(CATEGORY_LVCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c6764709.lvcon)
e4:SetOperation(c6764709.lvop)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(6764709,1))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetCountLimit(1)
e5:SetRange(LOCATION_MZONE)
e5:SetTarget(c6764709.rdtg)
e5:SetOperation(c6764709.rdop)
c:RegisterEffect(e5)
end
function c6764709.spfilter1(c)
return c:IsFaceup() and c:IsCode(6764709)
end
function c6764709.spfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x107) and c:IsLevelAbove(7)
end
function c6764709.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or Duel.IsExistingMatchingCard(c6764709.spfilter1,tp,LOCATION_MZONE,0,1,nil) then return false end
return Duel.IsExistingMatchingCard(c6764709.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c6764709.atkval(e,c)
return c:GetLevel()*300
end
function c6764709.lvcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107) and e:GetHandler():GetFlagEffect(1)>0
end
function c6764709.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(1)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e4)
end
end
function c6764709.rdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():IsLevelAbove(4) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c6764709.rdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsLevelBelow(3) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-3)
c:RegisterEffect(e1)
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--F.A. Winners
function c69553552.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c69553552.indcon)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--banish
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,69553552)
e3:SetCondition(c69553552.rmcon)
e3:SetTarget(c69553552.rmtg)
e3:SetOperation(c69553552.rmop)
c:RegisterEffect(e3)
--win
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_REMOVE)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(c69553552.winop)
c:RegisterEffect(e4)
end
function c69553552.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x107)
end
function c69553552.indcon(e)
return Duel.IsExistingMatchingCard(c69553552.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c69553552.rmcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=a:GetBattleTarget()
if not d then return false end
if not a:IsControler(tp) then a,d=d,a end
return a:IsControler(tp) and a:IsSetCard(0x107)
and a:GetLevel()-a:GetOriginalLevel()>=5
and ep~=tp
end
function c69553552.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c69553552.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0
and tc:IsSetCard(0x107) and tc:IsType(TYPE_FIELD) then
tc:RegisterFlagEffect(69553552,RESET_EVENT+RESETS_STANDARD,0,0)
end
end
function c69553552.winfilter(c)
return c:IsSetCard(0x107) and c:IsType(TYPE_FIELD) and c:GetFlagEffect(69553552)~=0
end
function c69553552.winop(e,tp,eg,ep,ev,re,r,rp)
local WIN_REASON_FA_WINNERS=0x1d
local g=Duel.GetMatchingGroup(c69553552.winfilter,tp,LOCATION_REMOVED,0,nil)
if g:GetClassCount(Card.GetCode)==3 then
Duel.Win(tp,WIN_REASON_FA_WINNERS)
end
end
--Vendread Anima
function c70491682.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(70491682,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,70491682)
e1:SetCost(aux.bfgcost)
e1:SetTarget(c70491682.sptg)
e1:SetOperation(c70491682.spop)
c:RegisterEffect(e1)
--gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c70491682.mtcon)
e2:SetOperation(c70491682.mtop)
c:RegisterEffect(e2)
end
function c70491682.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x106) and not c:IsCode(70491682) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c70491682.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c70491682.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c70491682.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c70491682.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c70491682.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c70491682.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c70491682.splimit(e,c)
return c:GetRace()~=RACE_ZOMBIE
end
function c70491682.mtcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_RITUAL and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c70491682.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,70491682)~=0 then return end
local c=e:GetHandler()
local g=eg:Filter(Card.IsSetCard,nil,0x106)
local rc=g:GetFirst()
if not rc then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(70491682,1))
Duel.RegisterFlagEffect(tp,70491682,RESET_PHASE+PHASE_END,0,1)
end
--Kai-Den Kendo Spirit
function c71614230.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spirit return
aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c71614230.thcon)
e1:SetTarget(c71614230.thtg)
e1:SetOperation(c71614230.thop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c71614230.gytg)
e2:SetOperation(c71614230.gyop)
c:RegisterEffect(e2)
end
function c71614230.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_PENDULUM)
end
function c71614230.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c71614230.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
function c71614230.tgfilter(c,tp)
return Duel.IsExistingMatchingCard(c71614230.gyfilter,tp,0,LOCATION_ONFIELD,1,nil,c:GetColumnGroup())
end
function c71614230.gyfilter(c,g)
return g:IsContains(c)
end
function c71614230.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71614230.tgfilter,tp,LOCATION_PZONE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,LOCATION_ONFIELD)
end
function c71614230.gyop(e,tp,eg,ep,ev,re,r,rp)
local pg=Duel.SelectMatchingCard(tp,c71614230.tgfilter,tp,LOCATION_PZONE,0,1,1,nil,tp)
if pg:GetCount()==0 then return end
local g=Duel.GetMatchingGroup(c71614230.gyfilter,tp,0,LOCATION_ONFIELD,nil,pg:GetFirst():GetColumnGroup())
Duel.SendtoGrave(g,REASON_EFFECT)
end
--Revendread Evolution
function c7986397.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,7986397+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c7986397.target)
e1:SetOperation(c7986397.activate)
c:RegisterEffect(e1)
end
function c7986397.dfilter(c)
return c:IsSetCard(0x106) and c:IsLevelAbove(1) and c:IsAbleToGrave()
end
function c7986397.filter(c,e,tp,m,ft)
if not c:IsSetCard(0x106) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil)
end
local dg=Duel.GetMatchingGroup(c7986397.dfilter,tp,LOCATION_DECK,0,nil)
if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
or dg:IsExists(c7986397.dlvfilter,1,nil,tp,mg,c,c:GetLevel())
else
return ft>-1 and mg:IsExists(c7986397.mfilterf,1,nil,tp,mg,dg,c)
end
end
function c7986397.mfilterf(c,tp,mg,dg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
or dg:IsExists(c7986397.dlvfilter,1,nil,tp,mg,rc,rc:GetLevel()-c:GetRitualLevel(rc))
else return false end
end
function c7986397.dlvfilter(c,tp,mg,rc,lv)
local lv2=lv-c:GetRitualLevel(rc)
return mg:CheckWithSumEqual(Card.GetRitualLevel,lv2,0,99,rc)
end
function c7986397.selcheck(c,mg1,dg,mat1,rc)
local mat=mat1:Clone()
local mg=mg1:Clone()
mat:AddCard(c)
if c:IsLocation(LOCATION_DECK) then
mg:Sub(dg)
end
local sum=mat:GetSum(Card.GetRitualLevel,rc)
local lv=rc:GetLevel()-sum
return rc:IsLevelAbove(sum) and mg:CheckWithSumEqual(Card.GetRitualLevel,lv,0,99,rc)
end
function c7986397.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.IsExistingMatchingCard(c7986397.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c7986397.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c7986397.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
local dg=Duel.GetMatchingGroup(c7986397.dfilter,tp,LOCATION_DECK,0,nil)
mg:Merge(dg)
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,nil)
end
local mat=Group.CreateGroup()
local lv=tc:GetLevel()
if ft<=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:FilterSelect(tp,c7986397.mfilterf,1,1,nil,tp,mg,dg,tc)
lv=lv-mat2:GetFirst():GetRitualLevel(tc)
mat:Merge(mat2)
end
while lv~=0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tg=mg:FilterSelect(tp,c7986397.selcheck,1,1,nil,mg,dg,mat,tc):GetFirst()
mat:AddCard(tg)
if tg:IsLocation(LOCATION_DECK) then
mg:Sub(dg)
else
mg:RemoveCard(tg)
end
lv=lv-tg:GetRitualLevel(tc)
end
tc:SetMaterial(mat)
local mat3=mat:Filter(Card.IsLocation,nil,LOCATION_DECK)
if mat3 then
mat:Sub(mat3)
Duel.SendtoGrave(mat3,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
end
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
tc:RegisterFlagEffect(7986397,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCondition(c7986397.descon)
e1:SetOperation(c7986397.desop)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp)
end
end
function c7986397.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(7986397)~=0
end
function c7986397.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--Super Team Buddy Force Unite!
function c8608979.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c8608979.target)
e1:SetOperation(c8608979.operation)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8608979,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c8608979.setcon)
e2:SetTarget(c8608979.settg)
e2:SetOperation(c8608979.setop)
c:RegisterEffect(e2)
end
function c8608979.filter1(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c8608979.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,c,e,tp)
end
function c8608979.filter2(c,tc,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:GetOriginalRace()==tc:GetOriginalRace()
and c:GetOriginalCode()~=tc:GetOriginalCode()
end
function c8608979.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) and c8608979.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c8608979.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c8608979.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c8608979.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c8608979.filter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tc,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c8608979.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:IsReason(REASON_EFFECT)
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_SZONE)
end
function c8608979.setfilter(c)
return c:IsCode(8608979) and c:IsSSetable()
end
function c8608979.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c8608979.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c8608979.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c8608979.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
Duel.ConfirmCards(1-tp,g)
end
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