Commit cc5a51f9 authored by VanillaSalt's avatar VanillaSalt

new

parent d8984590
--仕込み爆弾
function c18252559.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c18252559.target)
e1:SetOperation(c18252559.activate)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c18252559.damcon)
e2:SetTarget(c18252559.damtg)
e2:SetOperation(c18252559.damop)
c:RegisterEffect(e2)
end
function c18252559.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)>0 end
Duel.SetTargetPlayer(1-tp)
local dam=Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)*300
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c18252559.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)*300
Duel.Damage(p,dam,REASON_EFFECT)
end
function c18252559.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
function c18252559.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c18252559.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--マンドラゴン
function c19474136.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
end
--星墜つる地に立つ閃珖
function c20590784.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCountLimit(1,20590784+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c20590784.condition)
e1:SetTarget(c20590784.target)
e1:SetOperation(c20590784.activate)
c:RegisterEffect(e1)
end
function c20590784.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function c20590784.target(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.GetAttacker()
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and at:IsOnField() and at:GetAttack()>=Duel.GetLP(tp)
and bit.band(at:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL end
end
function c20590784.filter(c,e,tp)
return c:IsSetCard(0xa3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c20590784.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() and Duel.Draw(tp,1,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(c20590784.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(20590784,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--No.14 強欲のサラメーヤ
function c21313376.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,5,2)
c:EnableReviveLimit()
--reflect damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c21313376.refcon)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c21313376.descon)
e2:SetCost(c21313376.descost)
e2:SetTarget(c21313376.destg)
e2:SetOperation(c21313376.desop)
c:RegisterEffect(e2)
end
c21313376.xyz_number=14
function c21313376.refcon(e,re,val,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandlerPlayer()
end
function c21313376.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c21313376.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c21313376.filter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:IsDestructable()
end
function c21313376.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local atk=e:GetHandler():GetBattleTarget():GetBaseAttack()
if chk==0 then return Duel.IsExistingMatchingCard(c21313376.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,atk) end
local g=Duel.GetMatchingGroup(c21313376.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,atk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c21313376.desop(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetHandler():GetBattleTarget():GetBaseAttack()
local g=Duel.GetMatchingGroup(c21313376.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,atk)
Duel.Destroy(g,REASON_EFFECT)
end
--冥界濁龍 ドラゴキュートス
function c21435914.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure2(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsRace,RACE_DRAGON))
c:EnableReviveLimit()
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--chain attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c21435914.atcon)
e2:SetOperation(c21435914.atop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1)
e3:SetCondition(c21435914.damcon)
e3:SetTarget(c21435914.damtg)
e3:SetOperation(c21435914.damop)
c:RegisterEffect(e3)
end
function c21435914.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:IsReason(REASON_BATTLE) and bc:IsLocation(LOCATION_GRAVE) and c:IsChainAttackable(2,true) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
end
function c21435914.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c21435914.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c21435914.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
local atk=g:GetFirst():GetAttack()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk/2)
end
function c21435914.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(atk/2)
tc:RegisterEffect(e1)
Duel.Damage(1-tp,atk/2,REASON_EFFECT)
end
end
--冥界の麗人イゾルデ
function c22657402.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c22657402.spcon)
c:RegisterEffect(e2)
--lv change
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,22657402)
e3:SetTarget(c22657402.target)
e3:SetOperation(c22657402.operation)
c:RegisterEffect(e3)
end
function c22657402.spfilter(c)
return c:IsFaceup() and c:IsCode(5522)
end
function c22657402.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22657402.spfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c22657402.filter(c)
return c:IsFaceup() and c:GetLevel()>0 and c:IsRace(RACE_ZOMBIE)
end
function c22657402.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c22657402.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22657402.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c22657402.filter,tp,LOCATION_MZONE,0,1,2,nil)
local t={}
local p=1
local lv1=g:GetFirst():GetLevel()
local lv2=0
local tc2=g:GetNext()
if tc2 then lv2=tc2:GetLevel() end
for i=5,8 do
if lv1~=i and lv2~=i then t[p]=i p=p+1 end
end
Duel.Hint(HINT_SELECTMSG,tp,567)
local lv=Duel.AnnounceNumber(tp,table.unpack(t))
e:SetLabel(lv)
end
function c22657402.lvfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function c22657402.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c22657402.lvfilter,nil,e)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c22657402.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c22657402.splimit(e,c)
return c:GetRace()~=RACE_ZOMBIE
end
--劫火の舟守 ゴースト・カロン
function c23379054.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,23379054)
e1:SetCondition(c23379054.condition)
e1:SetCost(c23379054.cost)
e1:SetTarget(c23379054.target)
e1:SetOperation(c23379054.operation)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(23379054,ACTIVITY_SPSUMMON,c23379054.counterfilter)
end
function c23379054.counterfilter(c)
return c:IsRace(RACE_DRAGON)
end
function c23379054.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
end
function c23379054.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(23379054,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c23379054.splimit)
Duel.RegisterEffect(e1,tp)
end
function c23379054.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:GetRace()~=RACE_DRAGON
end
function c23379054.filter1(c,e,tp,lv)
return c:IsType(TYPE_FUSION) and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(c23379054.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv+c:GetLevel())
end
function c23379054.filter2(c,e,tp,lv)
return c:GetLevel()==lv and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23379054.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c23379054.filter1(chkc,e,tp,e:GetHandler():GetLevel()) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and e:GetHandler():IsAbleToRemove()
and Duel.IsExistingTarget(c23379054.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp,e:GetHandler():GetLevel()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c23379054.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,e:GetHandler():GetLevel())
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c23379054.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local lv=c:GetLevel()+tc:GetLevel()
local g=Group.FromCards(c,tc)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)==2 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c23379054.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--ジャンク・ジャイアント
function c34492631.initial_effect(c)
--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(c34492631.spcon)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c34492631.effcon)
e2:SetOperation(c34492631.effop1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_PRE_MATERIAL)
e3:SetCondition(c34492631.effcon)
e3:SetOperation(c34492631.effop2)
c:RegisterEffect(e3)
end
function c34492631.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5)
end
function c34492631.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c34492631.filter,tp,0,LOCATION_MZONE,1,nil)
end
function c34492631.effcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
function c34492631.effop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetOperation(c34492631.sumop)
rc:RegisterEffect(e1)
end
function c34492631.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c34492631.chainlm)
end
function c34492631.chainlm(e,rp,tp)
return tp==rp
end
function c34492631.effop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
--BF-上弦のピナーカ
function c55610595.initial_effect(c)
--synchro limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(c55610595.synlimit)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c55610595.regop)
c:RegisterEffect(e2)
end
function c55610595.synlimit(e,c)
if not c then return false end
return not c:IsSetCard(0x33)
end
function c55610595.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPreviousLocation(LOCATION_ONFIELD) then
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,55610595)
e1:SetTarget(c55610595.thtg)
e1:SetOperation(c55610595.thop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c55610595.filter(c)
return c:IsSetCard(0x33) and c:IsType(TYPE_MONSTER) and not c:IsCode(55610595) and c:IsAbleToHand()
end
function c55610595.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c55610595.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c55610595.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c55610595.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--たつのこ
function c55863245.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--synchro custom
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(c55863245.syncon)
e1:SetTarget(c55863245.syntg)
e1:SetValue(1)
e1:SetOperation(c55863245.synop)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(c55863245.efilter)
c:RegisterEffect(e2)
end
function c55863245.synfilter1(c,syncard,tuner,f)
return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c))
end
function c55863245.synfilter2(c,syncard,tuner,f,g,lv,minc,maxc)
if c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c)) then
lv=lv-c:GetLevel()
if lv<0 then return false end
if lv==0 then return minc==1 end
return g:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc-1,maxc-1,syncard)
else return false end
end
function c55863245.syncon(e)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c55863245.syntg(e,syncard,f,minc,maxc)
local c=e:GetHandler()
local tp=syncard:GetControler()
local lv=syncard:GetLevel()-c:GetLevel()
if lv<=0 then return false end
local g1=Duel.GetMatchingGroup(c55863245.synfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
return g1:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
or Duel.IsExistingMatchingCard(c55863245.synfilter2,tp,LOCATION_HAND,0,1,nil,syncard,c,f,g1,lv,minc,maxc)
end
function c55863245.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g1=Duel.GetMatchingGroup(c55863245.synfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
local g2=Duel.GetMatchingGroup(c55863245.synfilter2,tp,LOCATION_HAND,0,nil,syncard,c,f,g1,lv,minc,maxc)
if not g1:CheckWithSumEqual(Card.GetSynchroLevel,lv,minc,maxc,syncard)
or (g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(55863245,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g2:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if lv>tc:GetLevel() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=g1:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv-tc:GetLevel(),minc-1,maxc-1,syncard)
sg:Merge(tg)
end
Duel.SetSynchroMaterial(sg)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g1:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard)
Duel.SetSynchroMaterial(sg)
end
end
function c55863245.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner()
end
--No.21 氷結のレディ・ジャスティス
function c57707471.initial_effect(c)
c:EnableReviveLimit()
--xyz summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c57707471.xyzcon)
e1:SetOperation(c57707471.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
--atk
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(c57707471.atkval)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c57707471.descost)
e3:SetTarget(c57707471.destg)
e3:SetOperation(c57707471.desop)
c:RegisterEffect(e3)
if c57707471.xyz_filter then
c57707471.xyz_filter=function(mc) return mc:IsXyzLevel(c,lv) end
end
end
c57707471.xyz_number=21
c57707471.xyz_count=2
function c57707471.ovfilter(c,tp,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetRank()==5 and c:IsCanBeXyzMaterial(xyzc,true)
and c:CheckRemoveOverlayCard(tp,1,REASON_COST)
end
function c57707471.xyzcon(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
if 2<=ct then return false end
if ct<1 and Duel.IsExistingMatchingCard(c57707471.ovfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) then
return true
end
return Duel.CheckXyzMaterial(c,nil,6,2,2,og)
end
function c57707471.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og)
if og then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
local b1=Duel.CheckXyzMaterial(c,nil,6,2,2,og)
local b2=ct<1 and Duel.IsExistingMatchingCard(c57707471.ovfilter,tp,LOCATION_MZONE,0,1,nil,tp,c)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(57707471,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.SelectMatchingCard(tp,c57707471.ovfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
mg:GetFirst():RemoveOverlayCard(tp,1,1,REASON_COST)
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
else
local mg=Duel.SelectXyzMaterial(tp,c,nil,6,2,2)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
end
end
function c57707471.atkval(e,c)
return c:GetOverlayCount()*1000
end
function c57707471.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c57707471.desfilter(c)
return c:IsDefencePos() and c:IsDestructable()
end
function c57707471.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c57707471.desfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c57707471.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c57707471.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c57707471.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--No.95 ギャラクシーアイズ・ダークマター・ドラゴン
function c58820923.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,9,3,c58820923.ovfilter,aux.Stringid(58820923,0))
c:EnableReviveLimit()
--xyzlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c58820923.rmcon)
e2:SetCost(c58820923.rmcost)
e2:SetTarget(c58820923.rmtg)
e2:SetOperation(c58820923.rmop)
c:RegisterEffect(e2)
--multi attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c58820923.atkcon)
e3:SetCost(c58820923.atkcost)
e3:SetTarget(c58820923.atktg)
e3:SetOperation(c58820923.atkop)
c:RegisterEffect(e3)
end
c58820923.xyz_number=95
function c58820923.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x107b) and c:IsType(TYPE_XYZ)
end
function c58820923.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ
end
function c58820923.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end
function c58820923.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c58820923.cfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>2 end
local tg=Group.CreateGroup()
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg:GetFirst():GetCode())
tg:Merge(sg)
end
Duel.SendtoGrave(tg,REASON_COST)
end
function c58820923.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2
and not Duel.IsPlayerAffectedByEffect(1-tp,30459350) end
end
function c58820923.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c58820923.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c58820923.rmfilter,1-tp,LOCATION_DECK,0,nil)
if g:GetCount()>2 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local sg=g:Select(1-tp,3,3,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
function c58820923.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c58820923.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c58820923.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK)==0 end
end
function c58820923.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetCondition(c58820923.dircon)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetCondition(c58820923.atkcon2)
c:RegisterEffect(e3)
end
end
function c58820923.dircon(e)
return e:GetHandler():GetAttackAnnouncedCount()>0
end
function c58820923.atkcon2(e)
return e:GetHandler():IsDirectAttacked()
end
--M・HERO 闇鬼
function c59642500.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--direct attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e2)
--damage reduce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetCondition(c59642500.rdcon)
e3:SetOperation(c59642500.rdop)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetCountLimit(1,59642500)
e4:SetCondition(c59642500.thcon)
e4:SetTarget(c59642500.thtg)
e4:SetOperation(c59642500.thop)
c:RegisterEffect(e4)
end
function c59642500.rdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and Duel.GetAttackTarget()==nil
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c59642500.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
end
function c59642500.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c59642500.filter(c)
return c:IsSetCard(0xa5) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand()
end
function c59642500.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c59642500.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c59642500.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c59642500.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--絶対王 バック・ジャック
function c60990740.initial_effect(c)
--sset
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,60990740)
e1:SetCondition(c60990740.condition)
e1:SetCost(c60990740.cost)
e1:SetTarget(c60990740.target)
e1:SetOperation(c60990740.operation)
c:RegisterEffect(e1)
--sort
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,60990741)
e2:SetCondition(c60990740.sdcon)
e2:SetTarget(c60990740.sdtg)
e2:SetOperation(c60990740.sdop)
c:RegisterEffect(e2)
end
function c60990740.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c60990740.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c60990740.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SSET) end
end
function c60990740.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) then return end
Duel.ConfirmDecktop(tp,1)
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.DisableShuffleCheck()
if tc:GetType()==TYPE_TRAP and tc:IsSSetable() then
Duel.SSet(tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c60990740.sdcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c60990740.sdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2 end
end
function c60990740.sdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SortDecktop(tp,tp,3)
end
--ペロペロケルペロス
function c69764158.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c69764158.descon)
e1:SetCost(c69764158.descost)
e1:SetTarget(c69764158.destg)
e1:SetOperation(c69764158.desop)
c:RegisterEffect(e1)
end
function c69764158.descon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and (bit.band(r,REASON_BATTLE)~=0 or (bit.band(r,REASON_EFFECT)~=0 and rp~=tp))
end
function c69764158.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c69764158.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c69764158.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--BF-残夜のクリス
function c81105204.initial_effect(c)
--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:SetCountLimit(1,81105204)
e1:SetCondition(c81105204.spcon)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c81105204.valcon)
c:RegisterEffect(e2)
end
function c81105204.filter(c)
return c:IsFaceup() and c:IsSetCard(0x33) and not c:IsCode(81105204)
end
function c81105204.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c81105204.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c81105204.valcon(e,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
--BF T-漆黒のホーク・ジョー
function c81983656.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x33),aux.NonTuner(Card.IsSetCard,0x33),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81983656,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,81983656)
e1:SetTarget(c81983656.sptg)
e1:SetOperation(c81983656.spop)
c:RegisterEffect(e1)
--change battle target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,81983657)
e2:SetCondition(c81983656.cbcon)
e2:SetTarget(c81983656.cbtg)
e2:SetOperation(c81983656.cbop)
c:RegisterEffect(e2)
--change effect target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,81983657)
e3:SetCondition(c81983656.cecon)
e3:SetTarget(c81983656.cetg)
e3:SetOperation(c81983656.ceop)
c:RegisterEffect(e3)
end
function c81983656.spfilter(c,e,tp)
return c:IsLevelAbove(5) and c:IsRace(RACE_WINDBEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c81983656.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c81983656.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c81983656.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c81983656.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c81983656.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
end
function c81983656.cbcon(e,tp,eg,ep,ev,re,r,rp)
return r~=REASON_REPLACE
end
function c81983656.cbfilter(c)
return c:IsFaceup() and c:IsSetCard(0x33)
end
function c81983656.cbtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c81983656.cbfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c81983656.cbfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c81983656.cbfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
end
function c81983656.cbop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.ChangeAttackTarget(tc)
end
end
function c81983656.cecon(e,tp,eg,ep,ev,re,r,rp)
if e==re or rp==tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:GetCount()==1 and g:GetFirst()==e:GetHandler()
end
function c81983656.cefilter(c,re,rp,tf,ceg,cep,cev,cre,cr,crp)
return c:IsFaceup() and c:IsSetCard(0x33) and tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c)
end
function c81983656.cetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tf=re:GetTarget()
local res,ceg,cep,cev,cre,cr,crp=Duel.CheckEvent(re:GetCode(),true)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c81983656.cefilter(chkc,re,rp,tf,ceg,cep,cev,cre,cr,crp) end
if chk==0 then return Duel.IsExistingTarget(c81983656.cefilter,tp,LOCATION_MZONE,0,1,e:GetHandler(),re,rp,tf,ceg,cep,cev,cre,cr,crp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c81983656.cefilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),re,rp,tf,ceg,cep,cev,cre,cr,crp)
end
function c81983656.ceop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.ChangeTargetCard(ev,Group.FromCards(tc))
end
end
--プレゼント交換
function c82257940.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c82257940.target)
e1:SetOperation(c82257940.activate)
c:RegisterEffect(e1)
end
function c82257940.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_DECK,1,nil) end
end
function c82257940.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,nil)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg1=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local rg2=g2:Select(1-tp,1,1,nil)
rg1:Merge(rg2)
local c=e:GetHandler()
local fid=c:GetFieldID()
Duel.Remove(rg1,POS_FACEDOWN,REASON_EFFECT)
rg1:GetFirst():RegisterFlagEffect(82257940,RESET_EVENT+0x1fe0000,0,0,fid)
rg1:GetNext():RegisterFlagEffect(82257940,RESET_EVENT+0x1fe0000,0,0,fid)
rg1:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(rg1)
e1:SetCondition(c82257940.thcon)
e1:SetOperation(c82257940.thop)
Duel.RegisterEffect(e1,tp)
end
function c82257940.thfilter(c,fid)
return c:GetFlagEffectLabel(82257940)==fid
end
function c82257940.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if g:Filter(c82257940.thfilter,nil,e:GetLabel()):GetCount()<2 then
g:DeleteGroup()
return false
else return true end
end
function c82257940.thop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tc1=g:GetFirst()
local tc2=g:GetNext()
g:DeleteGroup()
Duel.SendtoHand(tc1,1-tc1:GetControler(),REASON_EFFECT)
Duel.SendtoHand(tc2,1-tc2:GetControler(),REASON_EFFECT)
end
--パラレル・ツイスター
function c83102080.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c83102080.cost)
e1:SetTarget(c83102080.target)
e1:SetOperation(c83102080.activate)
c:RegisterEffect(e1)
end
function c83102080.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c83102080.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c83102080.filter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c83102080.filter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c83102080.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c83102080.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--銅鑼ドラゴン
function c83980492.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
end
--キャット・シャーク
function c84224627.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,2,2)
c:EnableReviveLimit()
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c84224627.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--double
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1)
e2:SetCondition(c84224627.condition)
e2:SetCost(c84224627.cost)
e2:SetTarget(c84224627.target)
e2:SetOperation(c84224627.operation)
c:RegisterEffect(e2)
end
function c84224627.indcon(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER)
end
function c84224627.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c84224627.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c84224627.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsRankBelow(4)
end
function c84224627.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c84224627.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c84224627.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c84224627.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c84224627.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(tc:GetBaseAttack()*2)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetValue(tc:GetBaseDefence()*2)
tc:RegisterEffect(e2)
end
end
--薔薇恋人
function c89252157.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,89252157)
e1:SetCost(c89252157.spcost)
e1:SetTarget(c89252157.sptg)
e1:SetOperation(c89252157.spop)
c:RegisterEffect(e1)
end
function c89252157.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c89252157.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c89252157.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c89252157.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c89252157.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c89252157.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c89252157.efilter)
e1:SetOwnerPlayer(tp)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
tc:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
end
function c89252157.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() and re:IsActiveType(TYPE_TRAP)
end
--BF-星影のノートゥング
function c95040215.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,95040215)
e1:SetTarget(c95040215.target)
e1:SetOperation(c95040215.operation)
c:RegisterEffect(e1)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x33))
c:RegisterEffect(e2)
end
function c95040215.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c95040215.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Damage(p,d,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-800)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e2)
end
end
end
--冥界騎士トリスタン
function c96163807.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c96163807.thtg)
e1:SetOperation(c96163807.thop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(c96163807.atkcon)
e2:SetValue(300)
c:RegisterEffect(e2)
end
function c96163807.thfilter(c)
return c:GetDefence()==0 and c:IsRace(RACE_ZOMBIE) and c:IsAbleToHand()
end
function c96163807.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c96163807.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c96163807.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c96163807.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c96163807.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c96163807.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE)
end
function c96163807.atkcon(e)
return Duel.IsExistingMatchingCard(c96163807.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
--薔薇の聖騎士
function c96385345.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c96385345.spcon)
e1:SetCost(c96385345.spcost)
e1:SetTarget(c96385345.sptg)
e1:SetOperation(c96385345.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,96385345)
e2:SetCost(c96385345.thcost)
e2:SetTarget(c96385345.thtg)
e2:SetOperation(c96385345.thop)
c:RegisterEffect(e2)
end
function c96385345.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) and bc:IsLocation(LOCATION_GRAVE)
end
function c96385345.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c96385345.spfilter(c,e,tp)
return c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96385345.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c96385345.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c96385345.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c96385345.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
function c96385345.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c96385345.thfilter(c)
return c:IsLevelAbove(7) and c:IsRace(RACE_PLANT) and c:IsAbleToHand()
end
function c96385345.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96385345.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c96385345.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c96385345.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
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