Commit e633de0f authored by VanillaSalt's avatar VanillaSalt

new

parent ba1ad280
--タックルセイダー
function c12467005.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12467005,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c12467005.condition)
e1:SetTarget(c12467005.target)
e1:SetOperation(c12467005.operation)
c:RegisterEffect(e1)
end
function c12467005.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c12467005.filter1(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c12467005.filter2(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c12467005.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local b1=Duel.IsExistingTarget(c12467005.filter1,tp,0,LOCATION_MZONE,1,nil)
local b2=Duel.IsExistingTarget(c12467005.filter2,tp,0,LOCATION_ONFIELD,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(12467005,1),aux.Stringid(12467005,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(12467005,1))
else op=Duel.SelectOption(tp,aux.Stringid(12467005,2))+1 end
e:SetLabel(op)
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c12467005.filter1,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c12467005.filter2,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
end
function c12467005.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if e:GetLabel()==0 then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENCE)
else
local code=tc:GetCode()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c12467005.aclimit)
e1:SetLabel(code)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c12467005.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
--ディープ・スペース・クルーザー・ナイン
function c1586457.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(c1586457.spcon)
e1:SetOperation(c1586457.spop)
c:RegisterEffect(e1)
end
function c1586457.filter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost()
end
function c1586457.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1586457.filter,tp,LOCATION_HAND,0,1,c)
end
function c1586457.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c1586457.filter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
end
--武神器-オキツ
function c23857661.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23857661,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c23857661.cost)
e1:SetOperation(c23857661.operation)
c:RegisterEffect(e1)
end
function c23857661.cfilter(c)
return c:IsSetCard(0x88) and c:IsAbleToGraveAsCost()
end
function c23857661.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c23857661.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.DiscardHand(tp,c23857661.cfilter,1,1,REASON_COST)
end
function c23857661.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--武神-アラスダ
function c23979249.initial_effect(c)
c:SetUniqueOnField(1,0,23979249)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23979249,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_REMOVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c23979249.spcon)
e1:SetTarget(c23979249.sptg)
e1:SetOperation(c23979249.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c23979249.regcon)
e2:SetOperation(c23979249.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(23979249,1))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c23979249.drcon)
e3:SetTarget(c23979249.drtg)
e3:SetOperation(c23979249.drop)
c:RegisterEffect(e3)
end
function c23979249.cfilter(c,tp)
return c:IsSetCard(0x88) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_MZONE+LOCATION_GRAVE)
end
function c23979249.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23979249.cfilter,1,nil,tp)
end
function c23979249.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c23979249.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
function c23979249.regfilter(c,tp)
return c:IsSetCard(0x88) and c:IsControler(tp) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_DECK) and not c:IsReason(REASON_DRAW)
end
function c23979249.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23979249.regfilter,1,nil,tp)
end
function c23979249.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(23979249,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c23979249.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(23979249)>0
end
function c23979249.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
e:GetHandler():ResetNegateEffect(25789292,97268402)
end
function c23979249.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
--エクシーズ・オーバーライド
function c32999573.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--remove overlay replace
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32999573,0))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c32999573.rcon)
e2:SetOperation(c32999573.rop)
c:RegisterEffect(e2)
end
function c32999573.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(32999573+ep)==0
and bit.band(r,REASON_COST)~=0 and re:GetHandler():IsType(TYPE_XYZ)
and re:GetHandler():GetOverlayCount()>=ev-1
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil)
end
function c32999573.rop(e,tp,eg,ep,ev,re,r,rp)
local ct=bit.band(ev,0xffff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
if ct>1 then
re:GetHandler():RemoveOverlayCard(tp,ct-1,ct-1,REASON_COST)
end
e:GetHandler():RegisterFlagEffect(32999573+ep,RESET_PHASE+PHASE_END,0,1)
end
--武神集結
function c33611061.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c33611061.condition)
e1:SetCost(c33611061.cost)
e1:SetTarget(c33611061.target)
e1:SetOperation(c33611061.activate)
c:RegisterEffect(e1)
end
function c33611061.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function c33611061.filter(c)
return c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR) and c:IsAbleToDeck()
end
function c33611061.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,33611061)==0 end
Duel.RegisterFlagEffect(tp,33611061,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c33611061.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33611061.filter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(c33611061.filter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c33611061.thfilter(c)
return c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR) and c:IsAbleToHand()
end
function c33611061.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(c33611061.filter,tp,LOCATION_GRAVE,0,nil)
if tg:GetCount()>0 then
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.SendtoGrave(hg,REASON_EFFECT)
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(c33611061.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(33611061,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g2:GetFirst():GetCode())
g1:Merge(g2)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(33611061,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g3=g:Select(tp,1,1,nil)
g1:Merge(g3)
end
end
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
end
--リリース・リバース・バースト
function c38777931.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c38777931.cost)
e1:SetTarget(c38777931.target)
e1:SetOperation(c38777931.activate)
c:RegisterEffect(e1)
end
function c38777931.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x7f) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x7f)
Duel.Release(g,REASON_COST)
end
function c38777931.filter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c38777931.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c38777931.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c38777931.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c38777931.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c38777931.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--霊水鳥シレーヌ・オルカ
function c50074392.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(c50074392.spcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--lv
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50074392,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c50074392.lvcon)
e2:SetTarget(c50074392.lvtg)
e2:SetOperation(c50074392.lvop)
c:RegisterEffect(e2)
end
function c50074392.cfilter(c,rc)
return c:IsFaceup() and c:IsRace(rc)
end
function c50074392.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c50074392.cfilter,tp,LOCATION_MZONE,0,1,nil,RACE_FISH)
and Duel.IsExistingMatchingCard(c50074392.cfilter,tp,LOCATION_MZONE,0,1,nil,RACE_WINDBEAST)
end
function c50074392.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c50074392.filter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c50074392.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50074392.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,567)
local lv=Duel.AnnounceNumber(tp,3,4,5)
e:SetLabel(lv)
end
function c50074392.lvop(e,tp,eg,ep,ev,re,r,rp)
local lv=e:GetLabel()
local g=Duel.GetMatchingGroup(c50074392.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
e2:SetTarget(c50074392.actfilter)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c50074392.actfilter(e,c)
return c:GetControler()==e:GetHandlerPlayer() and not c:IsAttribute(ATTRIBUTE_WATER)
end
--武神器-ヤサカニ
function c50474354.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50474354,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c50474354.condition)
e1:SetCost(c50474354.cost)
e1:SetTarget(c50474354.target)
e1:SetOperation(c50474354.operation)
c:RegisterEffect(e1)
if not c50474354.global_check then
c50474354.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVED)
ge1:SetOperation(c50474354.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c50474354.checkop(e,tp,eg,ep,ev,re,r,rp)
if not re:GetHandler():IsSetCard(0x88) then
Duel.RegisterFlagEffect(rp,50474354,RESET_PHASE+PHASE_END,0,1)
end
end
function c50474354.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c50474354.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,50474354)==0 and c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c50474354.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,50474354,RESET_PHASE+PHASE_END,0,1)
end
function c50474354.aclimit(e,re,tp)
return not re:GetHandler():IsSetCard(0x88)
end
function c50474354.filter(c)
return c:IsSetCard(0x88) and c:IsAbleToHand()
end
function c50474354.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50474354.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c50474354.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50474354.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
......@@ -34,7 +34,7 @@ function c58139128.initial_effect(c)
e4:SetCondition(c58139128.econ)
e4:SetTarget(c58139128.etarget)
e4:SetValue(c58139128.efilter2)
c:RegisterEffect(e4,true)
c:RegisterEffect(e4)
end
function c58139128.filter(c)
return c:IsSetCard(0x2e) and c:IsType(TYPE_MONSTER)
......
--武神器-サグサ
function c59251766.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59251766,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c59251766.cost)
e1:SetTarget(c59251766.target)
e1:SetOperation(c59251766.operation)
c:RegisterEffect(e1)
end
function c59251766.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,59251766)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,59251766,RESET_PHASE+PHASE_END,0,1)
end
function c59251766.filter(c)
return c:IsFaceup() and c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR)
end
function c59251766.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c59251766.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c59251766.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c59251766.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c59251766.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_INDESTRUCTABLE_COUNT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCountLimit(1)
e1:SetValue(c59251766.valcon)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c59251766.valcon(e,re,r,rp)
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
--璽律する武神
function c63049052.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c63049052.condition)
e1:SetTarget(c63049052.target)
e1:SetOperation(c63049052.operation)
c:RegisterEffect(e1)
end
function c63049052.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c63049052.filter(c)
return c:IsFaceup() and c:GetRank()==4
end
function c63049052.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c63049052.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c63049052.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c63049052.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c63049052.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) then
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--Atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c63049052.atkval)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(63049052,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(c63049052.mattg)
e2:SetOperation(c63049052.matop)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c63049052.eqlimit)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
end
end
function c63049052.atkval(e,c)
return c:GetOverlayCount()*300
end
function c63049052.eqlimit(e,c)
return c:GetControler()==e:GetOwnerPlayer() and c:IsType(TYPE_XYZ)
end
function c63049052.mfilter(c)
return c:IsSetCard(0x88) and c:IsType(TYPE_MONSTER)
end
function c63049052.mattg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c63049052.mfilter,tp,LOCATION_HAND,0,1,nil) end
end
function c63049052.matop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ec=e:GetHandler():GetEquipTarget()
if not ec then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,c63049052.mfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(ec,g)
end
end
--パージ・レイ
function c64161630.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:SetCost(c64161630.cost)
e1:SetTarget(c64161630.target)
e1:SetOperation(c64161630.activate)
c:RegisterEffect(e1)
end
function c64161630.cfilter(c,e,tp)
local rk=c:GetRank()
return rk>1 and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c64161630.filter,tp,LOCATION_EXTRA,0,1,nil,rk-1,c:GetRace(),e,tp)
end
function c64161630.filter(c,rk,rc,e,tp)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x48)
and c:GetRank()==rk and c:IsRace(rc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c64161630.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.CheckReleaseGroup(tp,c64161630.cfilter,1,nil,e,tp) end
local g=Duel.SelectReleaseGroup(tp,c64161630.cfilter,1,1,nil,e,tp)
Duel.Release(g,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function c64161630.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
end
e:SetLabel(0)
end
function c64161630.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(64161630,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetTarget(c64161630.sptg)
e1:SetOperation(c64161630.spop)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
tc:CreateEffectRelation(e1)
end
function c64161630.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c64161630.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=e:GetLabelObject()
if not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c64161630.filter,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetRace()-1,tc:GetRace(),e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -40,6 +40,7 @@ function c70222318.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x90) end
end
function c70222318.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(70222318,0))
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x90)
local tc=g:GetFirst()
......@@ -56,6 +57,7 @@ function c70222318.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c70222318.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
......
--オーバーレイ・ブースター
function c75214390.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+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_DEFENCE,0)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c75214390.spcon)
e1:SetOperation(c75214390.spop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75214390,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c75214390.atkcon)
e2:SetCost(c75214390.atkcost)
e2:SetTarget(c75214390.atktg)
e2:SetOperation(c75214390.atkop)
c:RegisterEffect(e2)
end
function c75214390.cfilter(c)
return c:IsFaceup() and c:IsAttackAbove(2000)
end
function c75214390.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetFlagEffect(tp,75214390)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c75214390.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c75214390.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.RegisterFlagEffect(tp,75214390,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c75214390.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetTurnID()~=Duel.GetTurnCount()
end
function c75214390.atkcost(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 c75214390.filter(c)
return c:IsFaceup() and c:GetOverlayCount()>0
end
function c75214390.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c75214390.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75214390.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c75214390.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c75214390.atkop(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_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(tc:GetOverlayCount()*500)
tc:RegisterEffect(e1)
end
end
......@@ -57,6 +57,7 @@ function c7617062.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsRelateToBattle() end
end
function c7617062.posop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENCE)
......
--ギラギランサー
function c76436988.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(c76436988.spcon)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(76436988,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_REPEAT)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c76436988.damtg)
e2:SetOperation(c76436988.damop)
c:RegisterEffect(e2)
end
function c76436988.spcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)>0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c76436988.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,500)
end
function c76436988.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
end
--武神器-ヤツカ
function c86868952.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86868952,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(c86868952.condition)
e1:SetCost(c86868952.cost)
e1:SetTarget(c86868952.target)
e1:SetOperation(c86868952.operation)
c:RegisterEffect(e1)
end
function c86868952.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c86868952.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c86868952.filter(c)
return c:IsFaceup() and c:IsSetCard(0x88) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
end
function c86868952.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c86868952.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c86868952.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c86868952.filter,tp,LOCATION_MZONE,0,1,1,nil)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c86868952.ftarget)
e1:SetLabel(g:GetFirst():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c86868952.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c86868952.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
--紋章獣アンフィスバエナ
function c87255382.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87255382,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c87255382.cost)
e1:SetTarget(c87255382.sptg)
e1:SetOperation(c87255382.spop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87255382,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c87255382.cost)
e2:SetOperation(c87255382.atkop)
c:RegisterEffect(e2)
end
function c87255382.cfilter(c)
return c:IsSetCard(0x76) and c:IsDiscardable()
end
function c87255382.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87255382.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c87255382.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c87255382.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c87255382.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c87255382.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:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetValue(800)
c:RegisterEffect(e1)
end
end
--森の聖獣 カラントーサ
function c97317530.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(97317530,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCondition(c97317530.descon)
e1:SetTarget(c97317530.destg)
e1:SetOperation(c97317530.desop)
c:RegisterEffect(e1)
end
function c97317530.descon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetOwner():IsRace(RACE_BEAST)
end
function c97317530.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 c97317530.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
--戦友の誓い
function c99311109.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c99311109.condition)
e1:SetCost(c99311109.cost)
e1:SetTarget(c99311109.target)
e1:SetOperation(c99311109.activate)
c:RegisterEffect(e1)
end
function c99311109.cfilter(c)
return c:IsPreviousLocation(LOCATION_EXTRA)
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c99311109.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c99311109.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c99311109.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.CheckSpecialSummonActivity(tp) 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)
Duel.RegisterEffect(e1,tp)
end
function c99311109.filter(c)
return c:IsFaceup() and c:IsPreviousLocation(LOCATION_EXTRA) and c:IsControlerCanBeChanged()
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c99311109.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c99311109.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c99311109.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c99311109.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c99311109.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not Duel.GetControl(tc,tp,PHASE_END,1) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
end
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