Commit 959fe9b1 authored by tsubaki's avatar tsubaki

1.999zyua offset

parent da83ee3e
--玄武盾
function c10075.initial_effect(c)
--Equip limit
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetValue(1)
c:RegisterEffect(e0)
--act
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c10075.target)
e1:SetOperation(c10075.operation)
c:RegisterEffect(e1)
--up up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(c10075.con)
e3:SetValue(c10075.val)
c:RegisterEffect(e3)
--ngpcy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10075,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,10075)
e2:SetHintTiming(0,0x1c0+TIMING_MAIN_END)
e2:SetRange(LOCATION_SZONE+LOCATION_GRAVE)
e2:SetTarget(c10075.gptg)
e2:SetOperation(c10075.gpop)
c:RegisterEffect(e2)
end
function c10075.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c10075.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c10075.qfilter(c)
return (c:IsSetCard(0x6208) or c:IsSetCard(0x5208)) and c:IsFaceup()
end
function c10075.con(e, tp, eg, ep, ev, re, r, rp)
return Duel.IsExistingMatchingCard(c10075.qfilter, tp, 0, LOCATION_MZONE, 1, nil)
end
function c10075.val(e,c)
return c:GetDefense()
end
function c10075.filter(c)
return (c:IsSetCard(0x6208) or c:IsSetCard(0x5208)) and c:IsFaceup() and c:GetFlagEffect(10075)==0
end
function c10075.gptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c10075.filter,tp,0,LOCATION_MZONE,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c10075.filter,tp,0,LOCATION_MZONE,2,7,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0)
end
function c10075.cfilter(c,e,tp)
return c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(1-tp)
end
function c10075.gpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoHand(c, nil, REASON_EFFECT)>0 then
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(c10075.cfilter,nil,e,tp)
local tc=tg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e4)
tc:RegisterFlagEffect(10075,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
tc=tg:GetNext()
end
end
end
--斩月刀
function c10076.initial_effect(c)
--Equip limit
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetValue(1)
c:RegisterEffect(e0)
--act
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c10076.target)
e1:SetOperation(c10076.operation)
c:RegisterEffect(e1)
--up up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(c10076.con)
e3:SetValue(1000)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_PIERCE)
e4:SetCondition(c10076.con)
c:RegisterEffect(e4)
--ngpcy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10076,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_POSITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,10076)
e2:SetHintTiming(0,0x1c0+TIMING_MAIN_END)
e2:SetRange(LOCATION_SZONE+LOCATION_GRAVE)
e2:SetTarget(c10076.gptg)
e2:SetOperation(c10076.gpop)
c:RegisterEffect(e2)
end
function c10076.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c10076.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c10076.qfilter(c)
return (c:IsSetCard(0x161) or c:IsSetCard(0x258)) and c:IsFaceup()
end
function c10076.con(e, tp, eg, ep, ev, re, r, rp)
return Duel.IsExistingMatchingCard(c10076.qfilter, tp, 0, LOCATION_MZONE, 1, nil)
end
function c10076.filter(c)
return (c:IsSetCard(0x161) or c:IsSetCard(0x258)) and c:IsFaceup() and c:IsCanChangePosition()
end
function c10076.gptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c10076.filter,tp,0,LOCATION_MZONE,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c10076.filter,tp,0,LOCATION_MZONE,2,7,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c10076.cfilter(c,e,tp)
return c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(1-tp)
end
function c10076.gpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoHand(c, nil, REASON_EFFECT)>0 then
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(c10076.cfilter,nil,e,tp)
Duel.ChangePosition(tg,POS_FACEDOWN_DEFENSE)
end
end
--龙鳞剑
function c10077.initial_effect(c)
--Equip limit
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetValue(1)
c:RegisterEffect(e0)
--act
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c10077.target)
e1:SetOperation(c10077.operation)
c:RegisterEffect(e1)
--up up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(c10077.con)
e3:SetValue(1000)
c:RegisterEffect(e3)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_EQUIP)
e0:SetCode(EFFECT_PIERCE)
e0:SetCondition(c10077.con)
c:RegisterEffect(e0)
--ngpcy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10077,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,10077)
e2:SetHintTiming(0,0x1c0+TIMING_MAIN_END)
e2:SetRange(LOCATION_SZONE+LOCATION_GRAVE)
e2:SetTarget(c10077.gptg)
e2:SetOperation(c10077.gpop)
c:RegisterEffect(e2)
end
function c10077.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c10077.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c10077.qfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsFaceup() and not c:IsType(TYPE_PENDULUM)
end
function c10077.con(e, tp, eg, ep, ev, re, r, rp)
return Duel.IsExistingMatchingCard(c10077.qfilter, tp, 0, LOCATION_ONFIELD, 1, nil)
end
function c10077.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsFaceup() and not c:IsType(TYPE_PENDULUM) and c:IsAbleToRemove()
end
function c10077.gptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c10077.filter,tp,0,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c10077.filter,tp,0,LOCATION_ONFIELD,2,7,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c10077.cfilter(c,e,tp)
return c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(1-tp)
end
function c10077.gpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoHand(c, nil, REASON_EFFECT)>0 then
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(c10077.cfilter,nil,e,tp)
Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)
end
end
--火☪水的交锋
function c50511.initial_effect(c)
--act
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetValue(-1)
c:RegisterEffect(e2)
--element
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(c50511.discon)
e5:SetOperation(c50511.disop)
c:RegisterEffect(e5)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCountLimit(1)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c50511.ficon)
e4:SetTarget(c50511.eltg)
e4:SetOperation(c50511.elop)
c:RegisterEffect(e4)
local e3=e4:Clone()
e3:SetCondition(c50511.wacon)
c:RegisterEffect(e3)
end
function c50511.discon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and re:GetHandler():IsLocation(LOCATION_MZONE)
and not re:GetHandler():IsAttribute(ATTRIBUTE_FIRE) and not re:GetHandler():IsAttribute(ATTRIBUTE_WATER)
end
function c50511.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
function c50511.ficon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and re:GetHandler():IsAttribute(ATTRIBUTE_FIRE) and re:GetHandler():IsLocation(LOCATION_MZONE)
end
function c50511.wacon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and re:GetHandler():IsAttribute(ATTRIBUTE_WATER) and re:GetHandler():IsLocation(LOCATION_MZONE)
end
function c50511.discfilter(c,att)
return c:GetAttribute()~=att and c:IsSetCard(0x250) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function c50511.cfilter(c)
return c:GetPreviousLocation()==LOCATION_EXTRA
end
function c50511.eltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local att=re:GetHandler():GetAttribute()
return Duel.IsExistingMatchingCard(c50511.discfilter, tp, LOCATION_DECK, 0, 1, nil, att) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if not Duel.IsExistingMatchingCard(c50511.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND)
end
end
function c50511.elop(e,tp,eg,ep,ev,re,r,rp)
local att=re:GetHandler():GetAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50511.discfilter,tp,LOCATION_DECK,0,1,1,nil,att)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if not Duel.IsExistingMatchingCard(c50511.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp, aux.Stringid(50511,0)) then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--雷☪冰的清远
function c50512.initial_effect(c)
--act
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Pos Change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SET_POSITION)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c50512.target)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(POS_FACEUP_DEFENSE)
c:RegisterEffect(e2)
--element
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(c50512.discon)
e5:SetOperation(c50512.disop)
c:RegisterEffect(e5)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCountLimit(1)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c50512.licon)
e4:SetTarget(c50512.eltg)
e4:SetOperation(c50512.elop)
c:RegisterEffect(e4)
local e3=e4:Clone()
e3:SetCondition(c50512.dacon)
c:RegisterEffect(e3)
end
function c50512.target(e,c)
return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c50512.discon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and re:GetHandler():IsLocation(LOCATION_MZONE)
and not re:GetHandler():IsAttribute(ATTRIBUTE_LIGHT) and not re:GetHandler():IsAttribute(ATTRIBUTE_DARK)
end
function c50512.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
function c50512.licon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and re:GetHandler():IsAttribute(ATTRIBUTE_LIGHT) and re:GetHandler():IsLocation(LOCATION_MZONE)
end
function c50512.dacon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and re:GetHandler():IsAttribute(ATTRIBUTE_DARK) and re:GetHandler():IsLocation(LOCATION_MZONE)
end
function c50512.discfilter(c,att)
return c:GetAttribute()~=att and c:IsSetCard(0x250) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function c50512.cfilter(c)
return c:IsType(TYPE_LINK)
end
function c50512.filter(c)
return c:IsType(TYPE_XYZ)
end
function c50512.eltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local att=re:GetHandler():GetAttribute()
return Duel.IsExistingMatchingCard(c50512.discfilter, tp, LOCATION_DECK, 0, 1, nil, att) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c50512.elop(e,tp,eg,ep,ev,re,r,rp)
local att=re:GetHandler():GetAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50512.discfilter,tp,LOCATION_DECK,0,1,1,nil,att)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if not Duel.IsExistingMatchingCard(c50512.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
and Duel.IsExistingMatchingCard(c50512.filter, tp, LOCATION_MZONE, 0, 1, nil)
and Duel.SelectYesNo(tp, aux.Stringid(50512,0)) then
local tg=Duel.SelectMatchingCard(tp, c50512.filter, tp, LOCATION_MZONE, 0, 1, 1, nil):GetFirst()
Duel.Overlay(tg,g)
end
end
end
--听凭风引
function c50517.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50517,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c50517.condition)
e1:SetOperation(c50517.activate)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50517,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCountLimit(1,50517)
e2:SetCondition(c50517.discon)
e2:SetTarget(c50517.distg)
e2:SetOperation(c50517.disop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c50517.discon2)
e3:SetOperation(c50517.disop2)
c:RegisterEffect(e3)
--act in hand
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e5:SetCondition(c50517.handcon)
c:RegisterEffect(e5)
end
function c50517.handcon(e)
local genso,count=TET.ELCounter.Get(1-e:GetHandlerPlayer())
return genso~=50234 and count>0
end
function c50517.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50517.filter,tp,0x11,0,1,nil)
end
function c50517.filter(c)
return c:IsAbleToHand() and c:IsCode(50503)
end
function c50517.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c50517.filter,tp,0x11,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c50517.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==1-tp and re:IsActiveType(TYPE_MONSTER+TYPE_SPELL) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(c50517.discfilter,tp,0x94,0,1,c)
end
function c50517.discfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsSetCard(0x250) and c:IsAbleToDeck() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c50517.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true 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)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0x94)
end
end
function c50517.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c50517.filter,tp,0x11,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c50517.discfilter,tp,0x94,0,1,1,c)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>0 and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c50517.discon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==1-tp and re:IsActiveType(TYPE_MONSTER+TYPE_SPELL) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(c50517.discfilter,tp,0x90,0,1,c)
and Duel.IsExistingMatchingCard(c50517.filter,tp,0x11,0,1,nil)
end
function c50517.disop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c50517.discfilter,tp,0x94,0,1,1,c)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)>0 and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--安如磐石
function c50518.initial_effect(c)
--act
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50518,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--petrifaction
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c50518.sumsuc)
c:RegisterEffect(e4)
local e6=e4:Clone()
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e6)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50518,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCountLimit(1,50518)
e2:SetCondition(c50518.discon)
e2:SetTarget(c50518.distg)
e2:SetOperation(c50518.disop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
--act in hand
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e5:SetCondition(c50518.handcon)
c:RegisterEffect(e5)
end
function c50518.handcon(e)
local genso,count=TET.ELCounter.Get(1-e:GetHandlerPlayer())
return genso==50234 and count>0
end
function c50518.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
function c50518.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==1-tp and re:IsActiveType(TYPE_MONSTER+TYPE_TRAP) and Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(c50518.discfilter,tp,LOCATION_HAND,0,1,c,e,tp)
end
function c50518.discfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsSetCard(0x250) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50518.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 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)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND)
end
end
function c50518.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c50518.discfilter,tp,LOCATION_HAND,0,1,1,c,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
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