Commit f61cc036 authored by mercury233's avatar mercury233

rm

parent af6bf512
#created by ...
#main
101004001
101004002
101004003
101004004
101004005
101004006
101004007
101004008
101004009
101004010
101004011
101004012
101004013
101004014
101004015
101004016
101004017
101004018
101004019
101004020
101004021
101004022
101004023
101004024
101004025
101004026
101004027
101004028
101004029
101004030
101004031
101004032
101004033
101004034
101004035
101004053
101004054
101004055
101004056
101004057
101004058
101004059
101004060
101004061
101004062
101004063
101004064
101004065
101004066
101004067
101004068
101004069
101004070
101004071
101004072
101004073
101004074
101004075
101004076
101004077
#extra
101004036
101004037
101004038
101004039
101004040
101004041
101004042
101004043
101004044
101004045
101004046
101004047
101004048
101004049
101004100
!side
101004051
101004052
101004078
101004079
101004080
......@@ -11,7 +11,6 @@
100408023
100408024
100408026
100200142
#extra
100408007
100226001
......
#The first line is used for comment
!counter 0x47 指示物(限制代码)
!setname 0x400d 元素灵剑士
!setname 0x112 幻崩
!setname 0x113 灵神
!setname 0x214 空牙团
--E・HERO ソリッドマン
--Elemental HERO Solidman
--Script by nekrozar
function c100200142.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200142,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c100200142.sptg1)
e1:SetOperation(c100200142.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100200142,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,100200142)
e2:SetCondition(c100200142.spcon2)
e2:SetTarget(c100200142.sptg2)
e2:SetOperation(c100200142.spop2)
c:RegisterEffect(e2)
end
function c100200142.spfilter1(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100200142.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100200142.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100200142.spop1(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,c100200142.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100200142.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return re and re:GetHandler():IsType(TYPE_SPELL) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c100200142.spfilter2(c,e,tp)
return c:IsSetCard(0x8) and not c:IsCode(100200142) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100200142.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100200142.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100200142.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100200142.spfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100200142.spop2(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_DEFENSE)
end
end
--Yoko-Zuna Sumo Spirit
--Scripted by Eerie Code
function c101003000.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spirit return
aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c101003000.thcon)
e1:SetTarget(c101003000.thtg)
e1:SetOperation(c101003000.thop)
c:RegisterEffect(e1)
--gy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c101003000.gytg)
e2:SetOperation(c101003000.gyop)
c:RegisterEffect(e2)
end
function c101003000.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_PENDULUM)
end
function c101003000.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c101003000.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
function c101003000.tgfilter(c,tp)
return Duel.IsExistingMatchingCard(c101003000.gyfilter,tp,0,LOCATION_MZONE,1,nil,c:GetColumnGroup())
end
function c101003000.gyfilter(c,g)
return g:IsContains(c)
end
function c101003000.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003000.tgfilter,tp,LOCATION_PZONE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,LOCATION_MZONE)
end
function c101003000.gyop(e,tp,eg,ep,ev,re,r,rp)
local pg=Duel.GetMatchingGroup(c101003000.tgfilter,tp,LOCATION_PZONE,0,nil,tp)
if pg:GetCount()==0 then return end
local g=Group.CreateGroup()
for pc in aux.Next(pg) do
g:Merge(Duel.GetMatchingGroup(c101003000.gyfilter,tp,0,LOCATION_MZONE,nil,pc:GetColumnGroup()))
end
Duel.SendtoGrave(g,REASON_EFFECT)
end
--Kuro-Obi Karate Spirit
--Scripted by Eerie Code & mercury233
function c101003081.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spirit return
aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c101003081.thcon)
e1:SetTarget(c101003081.thtg)
e1:SetOperation(c101003081.thop)
c:RegisterEffect(e1)
--gy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c101003081.gytg)
e2:SetOperation(c101003081.gyop)
c:RegisterEffect(e2)
end
function c101003081.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_PENDULUM)
end
function c101003081.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c101003081.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
function c101003081.tgfilter(c,tp)
return Duel.IsExistingMatchingCard(c101003081.gyfilter,tp,0,LOCATION_ONFIELD,1,nil,c:GetColumnGroup())
end
function c101003081.gyfilter(c,g)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and g:IsContains(c)
end
function c101003081.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003081.tgfilter,tp,LOCATION_PZONE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,LOCATION_ONFIELD)
end
function c101003081.gyop(e,tp,eg,ep,ev,re,r,rp)
local pg=Duel.GetMatchingGroup(c101003081.tgfilter,tp,LOCATION_PZONE,0,nil,tp)
if pg:GetCount()==0 then return end
local g=Group.CreateGroup()
for pc in aux.Next(pg) do
g:Merge(Duel.GetMatchingGroup(c101003081.gyfilter,tp,0,LOCATION_ONFIELD,nil,pc:GetColumnGroup()))
end
Duel.SendtoGrave(g,REASON_EFFECT)
end
--Vendread Battlelord
--Scripted by Eerie Code
function c101003082.initial_effect(c)
c:EnableReviveLimit()
--act limit
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003082,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,101003082)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c101003082.cost)
e1:SetTarget(c101003082.target)
e1:SetOperation(c101003082.operation)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003082,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101003082+100)
e2:SetCondition(c101003082.thcon)
e2:SetTarget(c101003082.thtg)
e2:SetOperation(c101003082.thop)
c:RegisterEffect(e2)
end
function c101003082.cfilter(c)
return c:IsSetCard(0x106) and c:IsAbleToRemoveAsCost()
end
function c101003082.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003082.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101003082.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101003082.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.AnnounceType(tp))
end
function c101003082.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
if e:GetLabel()==0 then
e1:SetDescription(aux.Stringid(101003082,2))
e1:SetValue(c101003082.aclimit1)
elseif e:GetLabel()==1 then
e1:SetDescription(aux.Stringid(101003082,3))
e1:SetValue(c101003082.aclimit2)
else
e1:SetDescription(aux.Stringid(101003082,4))
e1:SetValue(c101003082.aclimit3)
end
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101003082.aclimit1(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
end
function c101003082.aclimit2(e,re,tp)
return re:IsActiveType(TYPE_SPELL) and not re:GetHandler():IsImmuneToEffect(e)
end
function c101003082.aclimit3(e,re,tp)
return re:IsActiveType(TYPE_TRAP) and not re:GetHandler():IsImmuneToEffect(e)
end
function c101003082.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101003082.thfilter(c,tp)
return bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c101003082.tgfilter,tp,LOCATION_DECK,0,1,c)
end
function c101003082.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x106) and c:IsAbleToGrave()
end
function c101003082.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003082.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101003082.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c101003082.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if hg:GetCount()>0 and Duel.SendtoHand(hg,tp,REASON_EFFECT)>0
and hg:GetFirst():IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101003082.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
--Vendread Core
--Scripted by Eerie Code
function c101003083.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003083,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,101003083)
e1:SetCost(c101003083.spcost)
e1:SetTarget(c101003083.sptg)
e1:SetOperation(c101003083.spop)
c:RegisterEffect(e1)
--gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c101003083.mtcon)
e2:SetOperation(c101003083.mtop)
c:RegisterEffect(e2)
end
function c101003083.cfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemoveAsCost()
end
function c101003083.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003083.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101003083.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101003083.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 c101003083.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
function c101003083.mtcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_RITUAL and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c101003083.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,101003083)~=0 then return end
local c=e:GetHandler()
local g=eg:Filter(Card.IsSetCard,nil,0x106)
local rc=g:GetFirst()
if not rc then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e3,true)
end
rc:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(101003083,1))
Duel.RegisterFlagEffect(tp,101003083,RESET_PHASE+PHASE_END,0,1)
end
--Vendread Charge
--Scripted by Eerie Code
function c101003084.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101003084+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101003084.cost)
e1:SetTarget(c101003084.target)
e1:SetOperation(c101003084.activate)
c:RegisterEffect(e1)
end
function c101003084.cfilter(c,tp)
return c:IsRace(RACE_ZOMBIE) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsAbleToGraveAsCost()
and Duel.GetMZoneCount(tp,c)>0
end
function c101003084.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003084.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101003084.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c101003084.filter(c,e,tp)
return c:IsSetCard(0x106) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101003084.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003084.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101003084.activate(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,c101003084.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--Vendread Revolution
--Scripted by Eerie Code
function c101003085.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101003085)
e1:SetCost(c101003085.cost)
e1:SetTarget(c101003085.target)
e1:SetOperation(c101003085.activate)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,101003085+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101003085.drtg)
e2:SetOperation(c101003085.drop)
c:RegisterEffect(e2)
end
function c101003085.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101003085.spfilter(c,e,tp)
return c:IsSetCard(0x106) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101003085.thfilter(c)
return c:GetType()==TYPE_SPELL+TYPE_RITUAL and c:IsAbleToHand()
end
function c101003085.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c101003085.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsExistingTarget(c101003085.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c101003085.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectTarget(tp,c101003085.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g2,1,0,0)
end
function c101003085.activate(e,tp,eg,ep,ev,re,r,rp)
local tc1,tc2=Duel.GetFirstTarget()
if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end
if tc1:IsRelateToEffect(e) and Duel.SpecialSummon(tc1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 and tc2:IsRelateToEffect(e) then
Duel.SendtoHand(tc2,REASON_EFFECT)
end
end
function c101003085.drfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck()
end
function c101003085.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101003085.drfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c101003085.drfilter,tp,LOCATION_REMOVED,0,5,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101003085.drfilter,tp,LOCATION_REMOVED,0,5,5,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101003085.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--F.A. Auto Navigator
--Scripted by Eerie Code
function c101003086.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003086,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101003086)
e1:SetTarget(c101003086.sptg)
e1:SetOperation(c101003086.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003086,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,101003086+100)
e2:SetTarget(c101003086.thtg)
e2:SetOperation(c101003086.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c101003086.filter(c)
return c:IsFaceup() and c:IsSetCard(0x107) and c:GetLevel()>c:GetOriginalLevel()
end
function c101003086.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101003086.filter(chkc) end
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101003086.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101003086.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101003086.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local lv=math.abs(tc:GetLevel()-tc:GetOriginalLevel())
if lv==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-lv)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(lv)
e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2)
end
end
end
function c101003086.thfilter(c)
return c:IsSetCard(0x107) and c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end
function c101003086.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003086.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101003086.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101003086.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--F.A. Motorhome Transport
function c101003087.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101003087.atkval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(aux.chainreg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101003087,0))
e3:SetCategory(CATEGORY_LVCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101003087.lvcon)
e3:SetOperation(c101003087.lvop)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetCondition(c101003087.indcon)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e5)
--special summon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(101003087,1))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetCountLimit(1)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c101003087.spcon)
e6:SetTarget(c101003087.sptg)
e6:SetOperation(c101003087.spop)
c:RegisterEffect(e6)
end
function c101003087.atkval(e,c)
return c:GetLevel()*300
end
function c101003087.lvcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107) and e:GetHandler():GetFlagEffect(1)>0
end
function c101003087.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(1)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e4)
end
end
function c101003087.indcon(e)
return e:GetHandler():IsLevelAbove(11)
end
function c101003087.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLevelAbove(13)
end
function c101003087.filter(c,e,tp)
return c:IsSetCard(0x107) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101003087.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101003087.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101003087.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101003087.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101003087.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
--F.A. City Grand Prix
--Scripted by ahtelel
function c101003088.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--lv up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x107))
e2:SetValue(2)
e2:SetCondition(c101003088.lvcon)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x107))
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,101003088)
e4:SetCondition(c101003088.thcon)
e4:SetTarget(c101003088.thtg)
e4:SetOperation(c101003088.thop)
c:RegisterEffect(e4)
end
function c101003088.lvcon(e)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function c101003088.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c101003088.thfilter(c)
return c:IsSetCard(0x107) and not c:IsCode(101003088) and c:IsAbleToHand()
end
function c101003088.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003088.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101003088.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101003088.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--F.A. Test Run
--Scripted by Eerie Code
function c101003089.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101003089)
e1:SetTarget(c101003089.target)
e1:SetOperation(c101003089.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,101003089+100)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101003089.sptg)
e2:SetOperation(c101003089.spop)
c:RegisterEffect(e2)
end
function c101003089.filter(c)
return c:IsFaceup() and c:IsSetCard(0x107) and c:IsCanChangePosition()
end
function c101003089.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101003089.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101003089.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c101003089.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD)
end
function c101003089.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 then
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function c101003089.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(c5133471.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c5133471.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101003089.desfilter(c,tp)
return c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0
end
function c101003089.spfilter(c,e,tp)
return c:IsSetCard(0x107) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101003089.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and c101003089.desfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101003089.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and Duel.IsExistingMatchingCard(c101003089.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101003089.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101003089.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101003089.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--プロンプトホーン
--Prompt Horn
--Script by nekrozar
function c101004002.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101004002)
e1:SetCost(c101004002.spcost)
e1:SetTarget(c101004002.sptg)
e1:SetOperation(c101004002.spop)
c:RegisterEffect(e1)
end
function c101004002.costfilter(c,e,tp,g,ft)
local lv=c:GetLevel()
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
and g:CheckWithSumEqual(Card.GetLevel,lv,1,ft)
end
function c101004002.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004002.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101004002.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c101004002.costfilter,1,nil,e,tp,g,ft) end
local sg=Duel.SelectReleaseGroup(tp,c101004002.costfilter,1,1,nil,e,tp,g,ft)
e:SetLabel(sg:GetFirst():GetLevel())
Duel.Release(sg,REASON_COST)
end
function c101004002.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_DECK)
end
function c101004002.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101004002.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if ft<=0 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectWithSumEqual(tp,Card.GetLevel,e:GetLabel(),1,ft)
if sg:GetCount()>0 then
local fid=e:GetHandler():GetFieldID()
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(101004002,RESET_EVENT+0x1fe0000,0,1,fid)
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
sg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(sg)
e1:SetCondition(c101004002.rmcon)
e1:SetOperation(c101004002.rmop)
Duel.RegisterEffect(e1,tp)
end
end
function c101004002.rmfilter(c,fid)
return c:GetFlagEffectLabel(101004002)==fid
end
function c101004002.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c101004002.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c101004002.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c101004002.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
--バックアップ・オペレーター
--Backup Operator
--Script by nekrozar
function c101004003.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101004003)
e1:SetTarget(c101004003.sptg)
e1:SetOperation(c101004003.spop)
c:RegisterEffect(e1)
end
function c101004003.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c101004003.thfilter(c,g)
return c:IsFaceup() and g:IsContains(c) and c:IsAbleToHand()
end
function c101004003.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Group.CreateGroup()
local lg=Duel.GetMatchingGroup(c101004003.lkfilter,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(lg) do
tg:Merge(tc:GetLinkedGroup())
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101004003.thfilter(chkc,tg) end
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101004003.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c101004003.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101004003.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
--リンク・ストリーマー
--Link Streamer
--Scripted by Eerie Code
function c101004004.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101004004)
e1:SetCondition(c101004004.tkcon)
e1:SetTarget(c101004004.tktg)
e1:SetOperation(c101004004.tkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c101004004.cfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsControler(tp)
end
function c101004004.tkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004004.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c101004004.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101004004+100,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c101004004.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,101004004+100,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) then
local token=Duel.CreateToken(tp,101004004+100)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
--デグレネード・バスター
--Degrenade Buster
--Script by nekrozar
function c101004005.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c101004005.sprcon)
e1:SetOperation(c101004005.sprop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004005,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,0x1e0)
e2:SetCountLimit(1,101004005)
e2:SetTarget(c101004005.rmtg)
e2:SetOperation(c101004005.rmop)
c:RegisterEffect(e2)
end
function c101004005.sprfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToRemoveAsCost()
end
function c101004005.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101004005.sprfilter,tp,LOCATION_GRAVE,0,2,nil)
end
function c101004005.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101004005.sprfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101004005.rmfilter(c,atk)
return c:IsFaceup() and c:GetAttack()>atk and c:IsAbleToRemove()
end
function c101004005.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local atk=e:GetHandler():GetAttack()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c101004005.rmfilter(chkc,atk) end
if chk==0 then return Duel.IsExistingTarget(c101004005.rmfilter,tp,0,LOCATION_MZONE,1,nil,atk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c101004005.rmfilter,tp,0,LOCATION_MZONE,1,1,nil,atk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c101004005.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
tc:RegisterFlagEffect(101004005,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetCondition(c101004005.retcon)
e1:SetOperation(c101004005.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c101004005.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(101004005)~=0
end
function c101004005.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
--トリックスター・ヒヨス
--Trickstar Nightshade
--Script by nekrozar
function c101004006.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004006,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCountLimit(1,101004006)
e1:SetCondition(c101004006.spcon)
e1:SetTarget(c101004006.sptg)
e1:SetOperation(c101004006.spop)
c:RegisterEffect(e1)
end
function c101004006.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfb)
end
function c101004006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101004006.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
--トリックスター・マンドレイク
--Trickstar Mandrake
--Script by nekrozar
function c101004007.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,101004007)
e1:SetCondition(c101004007.spcon)
e1:SetTarget(c101004007.sptg)
e1:SetOperation(c101004007.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004007,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,101004107)
e2:SetCondition(c101004007.descon)
e2:SetTarget(c101004007.destg)
e2:SetOperation(c101004007.desop)
c:RegisterEffect(e2)
end
function c101004007.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c101004007.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101004007.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
function c101004007.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfb)
end
function c101004007.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c101004007.desfilter(c,g)
return g:IsContains(c)
end
function c101004007.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Group.CreateGroup()
local lg=Duel.GetMatchingGroup(c101004007.lkfilter,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(lg) do
tg:Merge(tc:GetLinkedGroup())
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101004007.desfilter(chkc,tg) end
if chk==0 then return Duel.IsExistingTarget(c101004007.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101004007.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101004007.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
--トリックスター・シャクナージュ
--Trickstar Shakhnaj
function c101004008.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004008,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,101004008)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c101004008.spcost)
e1:SetTarget(c101004008.sptg)
e1:SetOperation(c101004008.spop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004008,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_REMOVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101004008.damcon)
e2:SetOperation(c101004008.damop)
c:RegisterEffect(e2)
end
function c101004008.cfilter(c)
return c:IsSetCard(0xfb) and c:IsDiscardable()
end
function c101004008.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004008.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c101004008.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c101004008.filter(c,e,tp)
return c:IsSetCard(0xfb) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004008.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c101004008.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004008.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004008.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 c101004008.damfilter(c,tp)
return c:IsPreviousLocation(LOCATION_GRAVE) and c:GetPreviousControler()==1-tp
end
function c101004008.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004008.damfilter,1,nil,tp)
end
function c101004008.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,101004008)
local ct=eg:FilterCount(c101004008.damfilter,nil,tp)
Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end
--剛鬼マンジロック
--Gouki Octostretch
function c101004009.initial_effect(c)
--half damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004009,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(c101004009.damcon)
e1:SetCost(c101004009.damcost)
e1:SetOperation(c101004009.damop)
c:RegisterEffect(e1)
--half damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004009,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(aux.damcon1)
e2:SetCost(c101004009.damcost)
e2:SetOperation(c101004009.operation)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004009,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,101004009)
e3:SetCondition(c101004009.thcon)
e3:SetTarget(c101004009.thtg)
e3:SetOperation(c101004009.thop)
c:RegisterEffect(e3)
end
function c101004009.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetBattleDamage(tp)>0 and Duel.GetAttacker()~=tp
end
function c101004009.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c101004009.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c101004009.dop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c101004009.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,math.ceil(ev/2))
end
function c101004009.operation(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
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:SetLabel(cid)
e1:SetValue(c101004009.damcon2)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c101004009.damcon2(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel() and math.ceil(val/2) or val
end
function c101004009.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101004009.thfilter(c)
return c:IsSetCard(0xfc) and not c:IsCode(101004009) and c:IsAbleToHand()
end
function c101004009.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004009.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101004009.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101004009.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
--剛鬼ハッグベア
-- Gouki Hugbear
function c101004010.initial_effect(c)
--atk down
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetDescription(aux.Stringid(101004010,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,101004010)
e1:SetTarget(c101004010.atktg)
e1:SetOperation(c101004010.atkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c101004010.atkcon)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004010,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,101004010+100)
e3:SetCondition(c101004010.thcon)
e3:SetTarget(c101004010.thtg)
e3:SetOperation(c101004010.thop)
c:RegisterEffect(e3)
end
function c101004010.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.nzatk(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil)
end
function c101004010.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(math.ceil(tc:GetBaseAttack()/2))
tc:RegisterEffect(e1)
end
end
function c101004010.atkcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0xfc)
end
function c101004010.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101004010.thfilter(c)
return c:IsSetCard(0xfc) and not c:IsCode(101004010) and c:IsAbleToHand()
end
function c101004010.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004010.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101004010.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101004010.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
--デフラドラグーン
--Defradragun
--Scripted by Eerie Code
function c101004011.initial_effect(c)
--special summon (hand)
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,101004011)
e1:SetCondition(c101004011.hspcon)
e1:SetOperation(c101004011.hspop)
c:RegisterEffect(e1)
--special summon (grave)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101004011+100)
e2:SetCost(c101004011.spcost)
e2:SetTarget(c101004011.sptg)
e2:SetOperation(c101004011.spop)
c:RegisterEffect(e2)
end
function c101004011.hspcfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c101004011.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c101004011.hspcfilter,tp,LOCATION_HAND,0,1,c)
end
function c101004011.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101004011.hspcfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
end
function c101004011.spcfilter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c101004011.spcfilter2,tp,LOCATION_GRAVE,0,2,c,c:GetCode())
end
function c101004011.spcfilter2(c,code)
return c:IsCode(code) and c:IsAbleToRemoveAsCost()
end
function c101004011.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c101004011.spcfilter1,tp,LOCATION_GRAVE,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101004011.spcfilter1,tp,LOCATION_GRAVE,0,1,1,c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c101004011.spcfilter2,tp,LOCATION_GRAVE,0,2,2,g:GetFirst(),g:GetFirst():GetCode())
g:Merge(g2)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101004011.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 c101004011.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
--バックグランド・ドラゴン
--Background Dragon
function c101004012.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004012,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,101004012)
e1:SetCondition(c101004012.spcon)
e1:SetTarget(c101004012.sptg)
e1:SetOperation(c101004012.spop)
c:RegisterEffect(e1)
end
function c101004012.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0
end
function c101004012.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c101004012.filter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
end
function c101004012.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101004012.filter,tp,LOCATION_HAND,0,1,1,c,e,tp)
if g:GetCount()>0 then
g:AddCard(c)
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x47e0000)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2,true)
end
end
end
--ティンダングル・トリニティ
--Tindangle Trinity
--Script by nekrozar
function c101004013.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004013,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c101004013.sptg)
e1:SetOperation(c101004013.spop)
c:RegisterEffect(e1)
--flip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FLIP)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c101004013.flipop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x10b))
e3:SetCondition(c101004013.indcon)
e3:SetValue(1)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101004013,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_BE_MATERIAL)
e4:SetCountLimit(1,101004013)
e4:SetCondition(c101004013.thcon)
e4:SetTarget(c101004013.thtg)
e4:SetOperation(c101004013.thop)
c:RegisterEffect(e4)
end
function c101004013.spfilter(c,e,tp)
return c:IsCode(94365540) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004013.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101004013.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101004013.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstMatchingCard(c101004013.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101004013.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(101004013,RESET_EVENT+0x1fe0000,0,1)
end
function c101004013.indcon(e)
return e:GetHandler():GetFlagEffect(101004013)~=0
end
function c101004013.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0x10b)
end
function c101004013.thfilter(c,tp)
return c:IsCode(101004069) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c101004013.tgfilter,tp,LOCATION_DECK,0,1,c)
end
function c101004013.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function c101004013.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004013.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101004013.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c101004013.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if hg:GetCount()>0 and Duel.SendtoHand(hg,tp,REASON_EFFECT)>0
and hg:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,hg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101004013.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
--オルターガイスト・マルチフェイカー
--Altergeist Multifaker
function c101004014.initial_effect(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004014,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCountLimit(1,101004014)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c101004014.spcon1)
e2:SetTarget(c101004014.sptg1)
e2:SetOperation(c101004014.spop1)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004014,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,101004014+100)
e3:SetCost(c101004014.spcost)
e3:SetTarget(c101004014.sptg2)
e3:SetOperation(c101004014.spop2)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(101004014,ACTIVITY_SPSUMMON,c101004014.counterfilter)
if not c101004014.global_check then
c101004014.global_check=true
local ex1=Effect.GlobalEffect()
ex1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex1:SetCode(EVENT_CHAINING)
ex1:SetCondition(c101004014.regcon)
ex1:SetOperation(c101004014.regop)
Duel.RegisterEffect(ex1,0)
local ex2=Effect.GlobalEffect()
ex2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex2:SetCode(EVENT_CHAIN_NEGATED)
ex2:SetCondition(c101004014.regcon)
ex2:SetOperation(c101004014.regop2)
Duel.RegisterEffect(ex2,0)
end
end
function c101004014.regcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
end
function c101004014.regop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
c101004014[cid]=true
end
function c101004014.regop2(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
c101004014[cid]=false
end
function c101004014.counterfilter(c)
return c:IsSetCard(0x103)
end
function c101004014.spcon1(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
return c101004014[cid] and rp==tp
end
function c101004014.sptg1(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 c101004014.spop1(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 c101004014.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(101004014,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c101004014.splimit)
Duel.RegisterEffect(e1,tp)
end
function c101004014.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x103)
end
function c101004014.filter(c,e,tp)
return c:IsSetCard(0x103) and not c:IsCode(101004014) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101004014.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101004014.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101004014.spop2(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,c101004014.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--オルターガイスト・ピクシール
--Altergeist Pixiel
function c101004015.initial_effect(c)
--mill
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004015,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101004015)
e1:SetCost(c101004015.cost)
e1:SetTarget(c101004015.target)
e1:SetOperation(c101004015.operation)
c:RegisterEffect(e1)
end
function c101004015.cost(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 c101004015.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
end
function c101004015.filter(c)
return c:IsAbleToHand() and c:IsSetCard(0x103)
end
function c101004015.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,3) then return end
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then
Duel.DisableShuffleCheck()
if g:IsExists(c101004015.filter,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c101004015.filter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
g:Sub(sg)
end
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
end
end
--夢幻崩界イヴリース
--Destroymare Iblee
--Scripted by Eerie Code
function c101004017.initial_effect(c)
--spsummon link
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004017,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c101004017.sptg)
e1:SetOperation(c101004017.spop)
c:RegisterEffect(e1)
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c101004017.splimit)
c:RegisterEffect(e2)
--spsummon opp
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004017,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,101004017)
e3:SetCondition(c101004017.condition)
e3:SetTarget(c101004017.target)
e3:SetOperation(c101004017.operation)
c:RegisterEffect(e3)
end
function c101004017.get_zone(c,seq)
local zone=0
if seq<4 and c:IsLinkMarker(LINK_MARKER_LEFT) then zone=bit.bor(zone,math.pow(2,seq+1)) end
if seq>0 and seq<5 and c:IsLinkMarker(LINK_MARKER_RIGHT) then zone=bit.bor(zone,math.pow(2,seq-1)) end
return zone
end
function c101004017.spfilter(c,e,tp,seq)
local zone=c101004017.get_zone(c,seq)
return zone~=0 and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c101004017.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local seq=e:GetHandler():GetSequence()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004017.spfilter(chkc,e,tp,seq) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101004017.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,seq) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004017.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,seq)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004017.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsControler(tp) and tc:IsRelateToEffect(e) then
local zone=c101004017.get_zone(tc,c:GetSequence())
if zone~=0 and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
end
function c101004017.splimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsType(TYPE_LINK)
end
function c101004017.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():GetPreviousControler()==tp
end
function c101004017.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101004017.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end
--星遺物-『星槍』
--World Legacy - "World Lance"
--Script by nekrozar
function c101004018.initial_effect(c)
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004018,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c101004018.atkcon)
e1:SetCost(c101004018.atkcost)
e1:SetOperation(c101004018.atkop)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(c101004018.atktg)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004018,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101004018.tkcon)
e3:SetTarget(c101004018.tktg)
e3:SetOperation(c101004018.tkop)
c:RegisterEffect(e3)
end
function c101004018.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsControler(1-tp) then a,d=d,a end
e:SetLabelObject(d)
local g=Group.FromCards(a,d)
return a and d and a:IsRelateToBattle() and d:IsRelateToBattle() and g:IsExists(Card.IsType,1,nil,TYPE_LINK)
end
function c101004018.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c101004018.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject()
if tc:IsFaceup() and tc:IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-3000)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
function c101004018.atktg(e,c)
return c:IsFaceup() and c:IsSetCard(0xfe) and c~=e:GetHandler()
end
function c101004018.cfilter(c,tp)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function c101004018.tkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004018.cfilter,1,nil,tp)
end
function c101004018.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c101004018.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,101004118,0xfe,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,101004118,0xfe,0x4011,0,0,1,RACE_MACHINE,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE,1-tp) then return end
local token1=Duel.CreateToken(tp,101004118)
local token2=Duel.CreateToken(tp,101004118)
Duel.SpecialSummonStep(token1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
Duel.SpecialSummonStep(token2,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
Duel.SpecialSummonComplete()
end
--エレメントセイバー・アイナ
--Script by nekrozar
function c101004019.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004019,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c101004019.spcost)
e1:SetTarget(c101004019.sptg)
e1:SetOperation(c101004019.spop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004019,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c101004019.atttg)
e2:SetOperation(c101004019.attop)
c:RegisterEffect(e2)
end
function c101004019.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c101004019.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004019.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004019.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c101004019.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and not c:IsCode(101004019) and (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c101004019.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004019.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101004019.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004019.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004019.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
function c101004019.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c101004019.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--エレメントセイバー・マカニ
--Elementsaber Makani
--Scripted by Eerie Code
function c101004020.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004020,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c101004020.thcost)
e1:SetTarget(c101004020.thtg)
e1:SetOperation(c101004020.thop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004020,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c101004020.atttg)
e2:SetOperation(c101004020.attop)
c:RegisterEffect(e2)
end
function c101004020.costfilter(c,tp)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c101004020.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c101004020.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004020.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004020.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c101004020.thfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsCode(101004020) and (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and c:IsAbleToHand()
end
function c101004020.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004020.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101004020.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101004020.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
function c101004020.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c101004020.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--エレメントセイバー・ナル
--Elementsaber Naru
--Scripted by Eerie Code
function c101004021.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004021,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetCost(c101004021.thcost)
e1:SetTarget(c101004021.thtg)
e1:SetOperation(c101004021.thop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004021,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c101004021.atttg)
e2:SetOperation(c101004021.attop)
c:RegisterEffect(e2)
end
function c101004021.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c101004021.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004021.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004021.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c101004021.thfilter(c)
return (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and c:IsType(TYPE_MONSTER) and not c:IsCode(101004021) and c:IsAbleToHand()
end
function c101004021.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101004021.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004021.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101004021.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101004021.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c101004021.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c101004021.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--エレメントセイバー・マロー
--Elementsaber Malo
function c101004022.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004022,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c101004022.sgcost)
e1:SetTarget(c101004022.sgtg)
e1:SetOperation(c101004022.sgop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004022,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c101004022.atttg)
e2:SetOperation(c101004022.attop)
c:RegisterEffect(e2)
end
function c101004022.costfilter(c,tp)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c101004022.filter,tp,LOCATION_DECK,0,1,c)
end
function c101004022.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004022.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004022.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c101004022.filter(c)
return (c:IsSetCard(0x400d) or c:IsSetCard(0x113)) and not c:IsCode(101004022) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c101004022.sgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c101004022.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101004022.sgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101004022.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c101004022.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c101004022.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--エレメントセイバー・ラパウィラ
--Elementsaber Rapawira
--Scripted by Eerie Code
function c101004023.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004023,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c101004023.negcon)
e1:SetCost(c101004023.negcost)
e1:SetTarget(c101004023.negtg)
e1:SetOperation(c101004023.negop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004023,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c101004023.atttg)
e2:SetOperation(c101004023.attop)
c:RegisterEffect(e2)
end
function c101004023.negcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c101004023.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c101004023.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004023.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004023.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c101004023.negtg(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)
end
end
function c101004023.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c101004023.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c101004023.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--エレメントセイバー・モーレフ
--
--Scripted by Eerie Code
function c101004024.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004024,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,0x1e0)
e1:SetCost(c101004024.setcost)
e1:SetTarget(c101004024.settg)
e1:SetOperation(c101004024.setop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004024,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c101004024.atttg)
e2:SetOperation(c101004024.attop)
c:RegisterEffect(e2)
end
function c101004024.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c101004024.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004024.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c101004024.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c101004024.setfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c101004024.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101004024.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004024.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c101004024.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c101004024.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
function c101004024.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
end
function c101004024.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--エレメントセイバー・ウィラード
--Elementsaber Willard
--Scripted by Eerie Code
function c101004025.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004025,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101004025)
e1:SetCost(c101004025.spcost)
e1:SetTarget(c101004025.sptg)
e1:SetOperation(c101004025.spop)
c:RegisterEffect(e1)
--summon success
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c101004025.regcon)
e2:SetOperation(c101004025.regop)
c:RegisterEffect(e2)
e2:SetLabelObject(e1)
end
function c101004025.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and (c:IsSetCard(0x400d) or c:IsLocation(LOCATION_HAND))
end
function c101004025.regfilter(c,attr)
return c:IsSetCard(0x400d) and bit.band(c:GetOriginalAttribute(),attr)~=0
end
function c101004025.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,101004060)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c101004025.costfilter,tp,loc,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101004025.costfilter,tp,loc,0,2,2,e:GetHandler())
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(101004060,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
local flag=0
if g:IsExists(c101004025.regfilter,1,nil,ATTRIBUTE_EARTH+ATTRIBUTE_WIND) then flag=bit.bor(flag,0x1) end
if g:IsExists(c101004025.regfilter,1,nil,ATTRIBUTE_WATER+ATTRIBUTE_FIRE) then flag=bit.bor(flag,0x2) end
if g:IsExists(c101004025.regfilter,1,nil,ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) then flag=bit.bor(flag,0x4) end
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(flag)
end
function c101004025.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 c101004025.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)
end
end
function c101004025.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 and e:GetLabelObject():GetLabel()~=0
end
function c101004025.regop(e,tp,eg,ep,ev,re,r,rp)
local flag=e:GetLabelObject():GetLabel()
local c=e:GetHandler()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(LOCATION_MZONE,0)
e0:SetTarget(c101004025.immtg)
e0:SetReset(RESET_EVENT+0x1fe0000)
if bit.band(flag,0x1)~=0 then
local e1=e0:Clone()
e1:SetDescription(aux.Stringid(101004025,1))
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
end
if bit.band(flag,0x2)~=0 then
local e2=e0:Clone()
e2:SetDescription(aux.Stringid(101004025,2))
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
c:RegisterEffect(e2)
end
if bit.band(flag,0x4)~=0 then
local e3=e0:Clone()
e3:SetDescription(aux.Stringid(101004025,3))
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
end
end
function c101004025.immtg(e,c)
return c:IsSetCard(0x400d) or c:IsSetCard(0x113)
end
--光霊神フォスオラージュ
--Forceaurage the Elemental Lord
function c101004026.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
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)
--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(c101004026.spcon)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004026,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,101004026)
e3:SetTarget(c101004026.destg)
e3:SetOperation(c101004026.desop)
c:RegisterEffect(e3)
--leave
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(c101004026.leaveop)
c:RegisterEffect(e4)
end
function c101004026.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.GetMatchingGroupCount(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_LIGHT)==5
end
function c101004026.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0,nil)
end
function c101004026.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c101004026.leaveop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsFacedown() then return end
local effp=e:GetHandler():GetControler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
if Duel.GetTurnPlayer()==effp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c101004026.skipcon)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,effp)
end
function c101004026.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
--太陽電池メン
--Solar Batteryman
--Scripted by Eerie Code
function c101004027.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004027,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101004027)
e1:SetTarget(c101004027.tgtg)
e1:SetOperation(c101004027.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004027,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCountLimit(1,101004027+100)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101004027.tkcon)
e3:SetTarget(c101004027.tktg)
e3:SetOperation(c101004027.tkop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--name
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101004027,2))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1,101004027+200)
e5:SetTarget(c101004027.nmtg)
e5:SetOperation(c101004027.nmop)
c:RegisterEffect(e5)
end
function c101004027.tgfilter(c)
return c:IsRace(RACE_THUNDER) and c:IsAbleToGrave()
end
function c101004027.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004027.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101004027.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101004027.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c101004027.tkcfilter(c)
return c:IsFaceup() and c:IsRace(RACE_THUNDER)
end
function c101004027.tkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004027.tkcfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c101004027.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c101004027.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,101004027+100,0,0x4011,0,0,1,RACE_THUNDER,ATTRIBUTE_LIGHT) then return end
local token=Duel.CreateToken(tp,101004027+100)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
function c101004027.nmfilter(c,cd)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsType(TYPE_EFFECT)
and c:IsOriginalSetCard(0x28) and c:GetOriginalCode()~=cd
end
function c101004027.nmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cd=e:GetHandler():GetCode()
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c101004027.nmfilter(chkc,cd) end
if chk==0 then return Duel.IsExistingTarget(c101004027.nmfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,cd) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101004027.nmfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,cd)
end
function c101004027.nmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and (tc:IsLocation(LOCATION_GRAVE) or tc:IsFaceup()) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(tc:GetOriginalCode())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--番猫-ウォッチキャット
--Watch Cat
--Script by nekrozar
function c101004028.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004028,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101004028)
e1:SetCondition(c101004028.spcon)
e1:SetTarget(c101004028.sptg)
e1:SetOperation(c101004028.spop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(c101004028.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004028,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101004128)
e3:SetCondition(c101004028.setcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c101004028.settg)
e3:SetOperation(c101004028.setop)
c:RegisterEffect(e3)
end
function c101004028.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c101004028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101004028.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 c101004028.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(101004028,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c101004028.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(101004028)~=0 and Duel.GetTurnPlayer()==tp
end
function c101004028.setfilter(c)
return c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsSSetable()
end
function c101004028.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c101004028.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c101004028.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c101004028.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
Duel.ConfirmCards(1-tp,g)
end
end
--トランスファミリア
--Transfamiliar
--Script by nekrozar
function c101004029.initial_effect(c)
--move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004029,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c101004029.mvtg)
e1:SetOperation(c101004029.mvop)
c:RegisterEffect(e1)
end
function c101004029.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101004029,1))
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101004029.mvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
--妖海のアウトロール
--Outroll of the Haunted Sea
--Script by nekrozar
function c101004030.initial_effect(c)
--change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004030,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101004030)
e1:SetCost(c101004030.cost)
e1:SetTarget(c101004030.cgtg)
e1:SetOperation(c101004030.cgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004030,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101004130)
e3:SetCost(c101004030.cost)
e3:SetTarget(c101004030.sptg)
e3:SetOperation(c101004030.spop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(101004030,ACTIVITY_SPSUMMON,c101004030.counterfilter)
end
function c101004030.counterfilter(c)
return c:IsRace(RACE_BEASTWARRIOR)
end
function c101004030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(101004030,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(c101004030.splimit)
Duel.RegisterEffect(e1,tp)
end
function c101004030.splimit(e,c)
return not c:IsRace(RACE_BEASTWARRIOR)
end
function c101004030.cgfilter(c,mc)
return c:IsRace(RACE_BEASTWARRIOR) and c:GetLevel()>0 and not (c:GetLevel()==mc:GetLevel() and c:IsAttribute(mc:GetAttribute()))
end
function c101004030.cgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101004030.cgfilter(chkc,c) end
if chk==0 then return Duel.IsExistingTarget(c101004030.cgfilter,tp,LOCATION_GRAVE,0,1,nil,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101004030.cgfilter,tp,LOCATION_GRAVE,0,1,1,nil,c)
end
function c101004030.cgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
local lv=tc:GetLevel()
local att=tc:GetAttribute()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(att)
c:RegisterEffect(e2)
end
end
function c101004030.spfilter(c,e,tp,mc)
return c:IsLevel(mc:GetLevel()) and c:IsRace(mc:GetRace()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101004030.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101004030.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,c101004030.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,e:GetHandler())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ヤジロベーダー
--Yajirovader
--Script by nekrozar
function c101004031.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c101004031.descon)
e1:SetOperation(c101004031.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004031,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c101004031.seqcon)
e3:SetOperation(c101004031.seqop)
c:RegisterEffect(e3)
--move
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101004031,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c101004031.mvcon)
e4:SetTarget(c101004031.mvtg)
e4:SetOperation(c101004031.mvop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function c101004031.descon(e)
return e:GetHandler():GetSequence()~=2
end
function c101004031.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c101004031.seqcon(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
if seq>4 then return false end
return (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))
end
function c101004031.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end
local seq=c:GetSequence()
if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end
flag=bit.bxor(flag,0xff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(c,nseq)
end
end
function c101004031.mvcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():IsControler(1-tp)
end
function c101004031.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=eg:GetFirst()
tc:CreateEffectRelation(e)
end
function c101004031.desfilter(c,g)
return g:IsContains(c)
end
function c101004031.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp)
or not tc:IsRelateToEffect(e) or tc:IsControler(tp) then return end
local seq1=c:GetSequence()
local seq2=tc:GetSequence()
if seq1>4 then return end
if (seq1>seq2 and Duel.CheckLocation(tp,LOCATION_MZONE,seq1-1))
or (seq1<seq2 and Duel.CheckLocation(tp,LOCATION_MZONE,seq1+1)) then
local nseq=0
if seq1>seq2 and Duel.CheckLocation(tp,LOCATION_MZONE,seq1-1) then nseq=seq1-1
else nseq=seq1+1 end
Duel.MoveSequence(c,nseq)
local cg=c:GetColumnGroup()
local g=Duel.GetMatchingGroup(c101004031.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--鉄騎龍ティアマトン
--Tiamaton the Steel Battalion Dragon
--Script by nekrozar
function c101004032.initial_effect(c)
c:EnableReviveLimit()
--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:SetDescription(aux.Stringid(101004032,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,101004032)
e2:SetCondition(c101004032.spcon)
e2:SetTarget(c101004032.sptg)
e2:SetOperation(c101004032.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004032,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c101004032.destg)
e3:SetOperation(c101004032.desop)
c:RegisterEffect(e3)
--disable field
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_DISABLE_FIELD)
e4:SetOperation(c101004032.disop)
c:RegisterEffect(e4)
end
function c101004032.cfilter(c)
return c:GetColumnGroupCount()>1
end
function c101004032.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101004032.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c101004032.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,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101004032.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)~=0 then
c:CompleteProcedure()
end
end
function c101004032.desfilter(c,g)
return g:IsContains(c)
end
function c101004032.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local cg=e:GetHandler():GetColumnGroup()
local g=Duel.GetMatchingGroup(c101004032.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c101004032.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cg=c:GetColumnGroup()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=Duel.GetMatchingGroup(c101004032.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function c101004032.disop(e,tp)
local c=e:GetHandler()
local flag1=bit.band(c:GetColumnZone(LOCATION_MZONE),0xffffff00)
local flag2=bit.band(bit.lshift(c:GetColumnZone(LOCATION_SZONE),8),0xffff00ff)
local flag3=bit.band(c:GetColumnZone(LOCATION_MZONE),0xff00ffff)
local flag4=bit.band(bit.lshift(c:GetColumnZone(LOCATION_SZONE),8),0xffff)
return flag1+flag2+flag3+flag4
end
--屋敷わらし
--Yashiki Warashi
--Script by nekrozar
--not fully implemented
function c101004033.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004033,0))
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101004033)
e1:SetCondition(c101004033.discon)
e1:SetCost(c101004033.discost)
e1:SetTarget(c101004033.distg)
e1:SetOperation(c101004033.disop)
c:RegisterEffect(e1)
end
function c101004033.discon(e,tp,eg,ep,ev,re,r,rp)
local ex1,g1,gc1,dp1,dv1=Duel.GetOperationInfo(ev,CATEGORY_TOHAND)
local ex2,g2,gc2,dp2,dv2=Duel.GetOperationInfo(ev,CATEGORY_TODECK)
-- local ex3,g3,gc3,dp3,dv3=Duel.GetOperationInfo(ev,CATEGORY_TOEXTRA)
local ex4,g4,gc4,dp4,dv4=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON)
local ex5,g5,gc5,dp5,dv5=Duel.GetOperationInfo(ev,CATEGORY_REMOVE)
return ((ex1 and (bit.band(dv1,LOCATION_GRAVE)==LOCATION_GRAVE or g1 and g1:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
or (ex2 and (bit.band(dv2,LOCATION_GRAVE)==LOCATION_GRAVE or g2 and g2:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
-- or (ex3 and (bit.band(dv3,LOCATION_GRAVE)==LOCATION_GRAVE or g3 and g3:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
or (ex4 and (bit.band(dv4,LOCATION_GRAVE)==LOCATION_GRAVE or g4 and g4:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)))
or (ex5 and (bit.band(dv5,LOCATION_GRAVE)==LOCATION_GRAVE or g5 and g5:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE))))
and Duel.IsChainNegatable(ev)
end
function c101004033.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c101004033.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)
end
function c101004033.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) then
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then
Duel.SendtoGrave(eg,REASON_EFFECT)
end
end
end
--急き兎馬
--Rapid Red Hared Mare
--scripted by Edo9300
function c101004034.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_ATTACK,0)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101004034)
e1:SetCondition(c101004034.hspcon)
e1:SetValue(c101004034.hspval)
c:RegisterEffect(e1)
--self destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004034,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_CUSTOM+101004034)
e2:SetTarget(c101004034.destg)
e2:SetOperation(c101004034.desop)
c:RegisterEffect(e2)
--custom EVENT_PLACED
local e2a=Effect.CreateEffect(c)
e2a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2a:SetRange(LOCATION_MZONE)
e2a:SetCode(EVENT_ADJUST)
e2a:SetOperation(c101004034.plchk)
c:RegisterEffect(e2a)
--direct attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004034,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c101004034.datop)
c:RegisterEffect(e3)
end
function c101004034.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=0x1f
local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for tc in aux.Next(lg) do
zone=bit.band(zone,bit.bnot(tc:GetColumnZone(LOCATION_MZONE,0,0,tp)))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101004034.hspval(e,c)
local tp=c:GetControler()
local zone=0x1f
local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for tc in aux.Next(lg) do
zone=bit.band(zone,bit.bnot(tc:GetColumnZone(LOCATION_MZONE,0,0,tp)))
end
return 0,zone
end
function c101004034.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c101004034.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function c101004034.plfilter(c)
return not c:IsStatus(STATUS_SUMMONING) and not c:IsStatus(STATUS_SUMMON_DISABLED)
end
function c101004034.gfilter(c,g)
return not g:IsContains(c)
end
function c101004034.plchk(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cg=c:GetColumnGroup():Filter(c101004034.plfilter,nil)
if c:GetFlagEffect(101004034+100)==0 or c:GetFlagEffectLabel(101004034+100)~=c:GetSequence() then
c:ResetFlagEffect(101004034+100)
c:RegisterFlagEffect(101004034+100,RESET_EVENT+0x1fd0000,0,1,c:GetSequence())
cg:KeepAlive()
e:SetLabelObject(cg)
elseif cg:IsExists(c101004034.gfilter,1,nil,e:GetLabelObject()) then
cg:KeepAlive()
e:SetLabelObject(cg)
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+101004034,e,0,0,0,0)
end
end
function c101004034.datop(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_SET_BASE_ATTACK)
e1:SetValue(math.ceil(c:GetBaseAttack()/2))
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
--ボイコットン
--Boycotton
--Scripted by Eerie Code
function c101004035.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c101004035.damop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101004035.thcon)
e2:SetTarget(c101004035.thtg)
e2:SetOperation(c101004035.thop)
c:RegisterEffect(e2)
end
function c101004035.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(1-ep,ev,false)
end
function c101004035.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==tp and bit.band(r,REASON_BATTLE)~=0
and (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c)
and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c101004035.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c101004035.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
--トポロジック・トゥリスバエナ
--Topologic Tulisbaena
--Scripted by Eerie Code
function c101004036.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
--banish
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004036,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101004036.rmcon)
e1:SetTarget(c101004036.rmtg)
e1:SetOperation(c101004036.rmop)
c:RegisterEffect(e1)
end
function c101004036.cfilter(c,ec)
if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.band(ec:GetLinkedZone(c:GetPreviousControler()),bit.lshift(0x1,c:GetPreviousSequence()))~=0
end
end
function c101004036.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004036.cfilter,1,nil,e:GetHandler())
end
function c101004036.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(c101004036.cfilter,nil,e:GetHandler())
local tg=g:Filter(Card.IsLocation,nil,LOCATION_MZONE)
Duel.SetTargetCard(tg)
local g2=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
g:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c101004036.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local g2=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
g:Merge(g2)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,1-tp)
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
end
--スペース・インシュレイター
--Space Insulator
--Script by nekrozar
function c101004037.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2)
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c101004037.tgtg)
e1:SetValue(-800)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004037,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c101004037.spcon)
e3:SetTarget(c101004037.sptg)
e3:SetOperation(c101004037.spop)
c:RegisterEffect(e3)
end
function c101004037.tgtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c101004037.cfilter(c,tp)
return c:IsControler(tp) and c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK)
end
function c101004037.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004037.cfilter,1,nil,tp) and aux.exccon(e)
end
function c101004037.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=0
local lg=eg:Filter(c101004037.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetLinkedZone())
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101004037.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=0
local lg=eg:Filter(c101004037.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetLinkedZone())
end
if c:IsRelateToEffect(e) and zone~=0 and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT+0x47e0000)
c:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
--トリックスター・ベラマドンナ
--Trickstar Bella Madonna
--Script by nekrozar
function c101004038.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfb),2)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101004038.imcon)
e1:SetValue(c101004038.immval)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004038,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101004038)
e2:SetCondition(c101004038.damcon)
e2:SetTarget(c101004038.damtg)
e2:SetOperation(c101004038.damop)
c:RegisterEffect(e2)
end
function c101004038.imcon(e)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetLinkedGroupCount()==0
end
function c101004038.immval(e,te)
return te:GetOwner()~=e:GetHandler() and te:IsActivated()
end
function c101004038.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroupCount()==0
end
function c101004038.damfilter(c)
return c:IsSetCard(0xfb) and c:IsType(TYPE_MONSTER)
end
function c101004038.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004038.damfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(c101004038.damfilter,tp,LOCATION_GRAVE,0,nil)
local dam=g:GetClassCount(Card.GetCode)*200
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c101004038.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c101004038.damfilter,tp,LOCATION_GRAVE,0,nil)
local dam=g:GetClassCount(Card.GetCode)*200
Duel.Damage(p,dam,REASON_EFFECT)
end
--トリックスター・ブルム
--Trickstar Bloom
function c101004039.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c101004039.matfilter,1,1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004039,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c101004039.drcon)
e1:SetTarget(c101004039.drtg)
e1:SetOperation(c101004039.drop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004039,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101004039)
e2:SetCondition(c101004039.damcon)
e2:SetTarget(c101004039.damtg)
e2:SetOperation(c101004039.damop)
c:RegisterEffect(e2)
end
function c101004039.matfilter(c,lc,sumtype,tp)
return c:IsLevelBelow(2) and c:IsLinkSetCard(0xfb)
end
function c101004039.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004039.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1) end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,1)
end
function c101004039.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c101004039.cfilter(c,tp,zone)
local seq=c:GetPreviousSequence()
if c:GetPreviousControler()~=tp then seq=seq+16 end
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsSetCard(0xfb)
and c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0
end
function c101004039.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004039.cfilter,1,nil,tp,e:GetHandler():GetLinkedZone())
end
function c101004039.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c101004039.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,Duel.GetFieldGroupCount(p,LOCATION_HAND,0)*200,REASON_EFFECT)
end
--トリックスター・デビルフィニウム
--Trickstar Delfiendium
function c101004040.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfb),2)
c:EnableReviveLimit()
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetTarget(c101004040.thtg)
e1:SetOperation(c101004040.thop)
c:RegisterEffect(e1)
end
function c101004040.filter(c)
return c:IsFaceup() and c:IsSetCard(0xfb) and c:IsAbleToHand()
end
function c101004040.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101004040.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004040.filter,tp,LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_LINK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK)
local g=Duel.SelectTarget(tp,c101004040.filter,tp,LOCATION_REMOVED,0,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c101004040.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoHand(rg,nil,REASON_EFFECT)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
if ct>0 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(ct*1000)
c:RegisterEffect(e1)
end
end
end
--剛鬼ザ・マスター・オーガ
--Gouki The Master Ogre
--Script by nekrozar
function c101004041.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfc),2)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004041,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,0x1c0)
e1:SetCountLimit(1)
e1:SetCost(c101004041.discost)
e1:SetTarget(c101004041.distg)
e1:SetOperation(c101004041.disop)
c:RegisterEffect(e1)
--attack all
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetValue(1)
c:RegisterEffect(e2)
--attack limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetCondition(c101004041.atcon)
e3:SetValue(c101004041.atlimit)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e4:SetCondition(c101004041.atcon)
c:RegisterEffect(e4)
end
function c101004041.discost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c101004041.costfilter(c,g)
return c:IsFaceup() and c:IsSetCard(0xfc) and g:IsContains(c) and c:IsAbleToHandAsCost()
end
function c101004041.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lg=e:GetHandler():GetLinkedGroup()
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and aux.disfilter1(chkc) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c101004041.costfilter,tp,LOCATION_MZONE,0,1,nil,lg)
and Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil)
else return false end
end
e:SetLabel(0)
local rt=Duel.GetTargetCount(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local cg=Duel.SelectMatchingCard(tp,c101004041.costfilter,tp,LOCATION_MZONE,0,1,rt,nil,lg)
local ct=cg:GetCount()
Duel.SendtoHand(cg,nil,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c101004041.disfilter(c,e)
return ((c:IsFaceup() and not c:IsDisabled()) or c:IsType(TYPE_TRAPMONSTER)) and c:IsRelateToEffect(e)
end
function c101004041.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c101004041.disfilter,nil,e)
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
tc=g:GetNext()
end
end
function c101004041.atcon(e)
return Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil)
end
function c101004041.atlimit(e,c)
local g=Duel.GetMatchingGroup(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetAttack)
return not tg:IsContains(c) or c:IsFacedown()
end
--オルターガイスト・キードゥルガー
--Altergeist Kidolga
--Script by nekrozar
function c101004042.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x103),2,2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004042,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101004042.spcon)
e1:SetTarget(c101004042.sptg)
e1:SetOperation(c101004042.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004042,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetTarget(c101004042.thtg)
e2:SetOperation(c101004042.thop)
c:RegisterEffect(e2)
end
function c101004042.spcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(0x103) and tc~=e:GetHandler()
end
function c101004042.spfilter(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c101004042.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=e:GetHandler():GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c101004042.spfilter(chkc,e,tp,zone) end
if chk==0 then return Duel.IsExistingTarget(c101004042.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004042.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004042.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=c:GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetCondition(c101004042.atkcon)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
function c101004042.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetOwner():GetAttackAnnouncedCount()==0
end
function c101004042.thfilter(c)
return c:IsSetCard(0x103) and c:IsAbleToHand()
end
function c101004042.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004042.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004042.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,c101004042.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,1,0,0)
end
function c101004042.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--トロイメア・マーメイド
--Troymare Mermaid
--Script by nekrozar
function c101004043.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c101004043.matfilter,1,1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004043,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101004043)
e1:SetCondition(c101004043.spcon)
e1:SetCost(c101004043.spcost)
e1:SetTarget(c101004043.sptg)
e1:SetOperation(c101004043.spop)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c101004043.atktg)
e2:SetValue(-1000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
function c101004043.matfilter(c)
return c:IsLinkSetCard(0x112) and not c:IsLinkCode(101004043)
end
function c101004043.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004043.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101004043.spfilter(c,e,tp)
return c:IsSetCard(0x112) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004043.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101004043.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetLabel(0)
end
end
function c101004043.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,c101004043.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(101004043,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c101004043.atktg(e,c)
return c:GetMutualLinkedGroupCount()==0
end
--トロイメア・ゴブリン
--Troymare Goblin
--Script by nekrozar
function c101004044.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c101004044.lcheck)
c:EnableReviveLimit()
--extra summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004044,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c101004044.sumcon)
e1:SetCost(c101004044.sumcost)
e1:SetTarget(c101004044.sumtg)
e1:SetOperation(c101004044.sumop)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101004044.tgtg)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c101004044.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c101004044.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004044.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101004044.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) end
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetLabel(0)
end
end
function c101004044.sumop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(101004044,1)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
if Duel.GetFlagEffect(tp,101004044)~=0 then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetLabelObject(c)
e1:SetCondition(c101004044.sumcon2)
e1:SetValue(c101004044.sumval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,101004044,RESET_PHASE+PHASE_END,0,1)
end
function c101004044.sumcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():IsLocation(LOCATION_MZONE)
end
function c101004044.sumval(e,c)
local c=e:GetLabelObject()
local sumzone=c:GetLinkedZone()
local relzone=-bit.lshift(1,c:GetSequence())
return 0,sumzone,relzone
end
function c101004044.tgtg(e,c)
return c:GetMutualLinkedGroupCount()>0
end
--トロイメア・ケルベロス
--Troymare Cerberus
--Script by nekrozar
function c101004045.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c101004045.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004045,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101004045)
e1:SetCondition(c101004045.descon)
e1:SetCost(c101004045.descost)
e1:SetTarget(c101004045.destg)
e1:SetOperation(c101004045.desop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101004045.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c101004045.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c101004045.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004045.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101004045.desfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:GetSequence()<5
end
function c101004045.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c101004045.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004045.desfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101004045.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_DESTROY)
e:SetLabel(0)
end
end
function c101004045.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(101004045,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c101004045.indtg(e,c)
return c:GetMutualLinkedGroupCount()>0
end
--トロイメア・フェニックス
--Troymare Phoenix
--Script by nekrozar
function c101004046.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c101004046.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004046,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101004046)
e1:SetCondition(c101004046.descon)
e1:SetCost(c101004046.descost)
e1:SetTarget(c101004046.destg)
e1:SetOperation(c101004046.desop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101004046.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c101004046.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c101004046.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004046.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101004046.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_DESTROY)
e:SetLabel(0)
end
end
function c101004046.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(101004046,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c101004046.indtg(e,c)
return c:GetMutualLinkedGroupCount()>0
end
--トロイメア・ユニコーン
--Troymare Unicorn
--Script by nekrozar
function c101004047.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c101004047.lcheck)
c:EnableReviveLimit()
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004047,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101004047)
e1:SetCondition(c101004047.tdcon)
e1:SetCost(c101004047.tdcost)
e1:SetTarget(c101004047.tdtg)
e1:SetOperation(c101004047.tdop)
c:RegisterEffect(e1)
--draw count
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetValue(c101004047.drval)
c:RegisterEffect(e2)
end
function c101004047.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c101004047.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004047.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101004047.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_TODECK)
e:SetLabel(0)
end
end
function c101004047.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0
and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(101004047,1)) then
Duel.BreakEffect()
if tc:IsLocation(LOCATION_DECK) and tc:IsControler(tp) then
Duel.ShuffleDeck(tp)
end
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c101004047.drfilter(c)
return c:IsFaceup() and c:IsSetCard(0x112) and c:GetMutualLinkedGroupCount()>0
end
function c101004047.drval(e)
local g=Duel.GetMatchingGroup(c101004047.drfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()<=0 then return 1 end
return g:GetClassCount(Card.GetCode)
end
--トロイメア・グリフォン
--Troymare Gryphon
--Script by nekrozar
function c101004048.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c101004048.lcheck)
c:EnableReviveLimit()
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004048,0))
e1:SetCategory(CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101004048)
e1:SetCondition(c101004048.setcon)
e1:SetCost(c101004048.setcost)
e1:SetTarget(c101004048.settg)
e1:SetOperation(c101004048.setop)
c:RegisterEffect(e1)
--cannot activate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,1)
e2:SetValue(c101004048.aclimit)
c:RegisterEffect(e2)
end
function c101004048.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function c101004048.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004048.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101004048.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c101004048.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101004048.setfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c101004048.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c101004048.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_LEAVE_GRAVE)
e:SetLabel(0)
end
end
function c101004048.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(101004048,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c101004048.aclimit(e,re,tp)
local tc=re:GetHandler()
return tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and tc:IsSummonType(SUMMON_TYPE_SPECIAL) and not tc:IsLinkState() and re:IsActiveType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e)
end
--発条補修ゼンマイコン
--Wind-Up Maintenance Zenmaicon
--Script by nekrozar
function c101004049.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x58),2,2)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004049,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101004049)
e1:SetCondition(c101004049.thcon)
e1:SetTarget(c101004049.thtg)
e1:SetOperation(c101004049.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004049,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101004149)
e2:SetCost(c101004049.spcost)
e2:SetTarget(c101004049.sptg)
e2:SetOperation(c101004049.spop)
c:RegisterEffect(e2)
--material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004049,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c101004049.matcon)
e3:SetTarget(c101004049.mattg)
e3:SetOperation(c101004049.matop)
c:RegisterEffect(e3)
end
function c101004049.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101004049.thfilter(c)
return c:IsSetCard(0x58) and c:IsAbleToHand()
end
function c101004049.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004049.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101004049.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101004049.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
function c101004049.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101004049.cfilter(c,e,tp)
return c:IsSetCard(0x58) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c101004049.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function c101004049.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004049.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c101004049.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101004049.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101004049.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101004049.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101004049.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c101004049.matfilter(c)
return c:IsFaceup() and c:IsSetCard(0x58) and c:IsType(TYPE_XYZ)
end
function c101004049.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101004049.matfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004049.matfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101004049.matfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c101004049.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
--小法師ヒダルマー
--Pint-Sized Priest Hidaruma
function c101004051.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST),2,2)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c101004051.atkval)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004051,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetTarget(c101004051.destg)
e2:SetOperation(c101004051.desop)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004051,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(aux.bdocon)
e3:SetTarget(c101004051.thtg)
e3:SetOperation(c101004051.thop)
c:RegisterEffect(e3)
end
function c101004051.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST)
end
function c101004051.atkval(e,c)
return Duel.GetMatchingGroupCount(c101004051.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)*100
end
function c101004051.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c101004051.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101004051.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(c101004051.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c101004051.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,c101004051.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function c101004051.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.Destroy(tg,REASON_EFFECT)
end
end
function c101004051.thfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToHand()
end
function c101004051.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c101004051.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004051.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101004051.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101004051.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--グレートフライ
--Greatfly
--Scripted by Eerie Code
function c101004052.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WIND),2,2)
c:EnableReviveLimit()
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_WIND))
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_EARTH))
e3:SetValue(-400)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101004052,0))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,101004052)
e5:SetCondition(c101004052.thcon)
e5:SetTarget(c101004052.thtg)
e5:SetOperation(c101004052.thop)
c:RegisterEffect(e5)
end
function c101004052.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c101004052.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToHand()
end
function c101004052.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004052.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004052.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101004052.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101004052.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--サイバーサル・サイクロン
--Cybersal Cyclone
--scripted by Larry126
function c101004053.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101004053.target)
e1:SetOperation(c101004053.activate)
c:RegisterEffect(e1)
end
function c101004053.filter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_LINK)
and Duel.IsExistingMatchingCard(c101004053.rmfilter,tp,LOCATION_GRAVE,0,1,nil,c:GetLink())
end
function c101004053.rmfilter(c,link)
return c:IsType(TYPE_MONSTER) and c:IsLink(link) and c:IsAbleToRemove()
end
function c101004053.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c101004053.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101004053.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101004053.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c101004053.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101004053.rmfilter),tp,LOCATION_GRAVE,0,1,1,nil,tc:GetLink())
local rc=g:GetFirst()
if rc and Duel.Remove(rc,0,REASON_EFFECT)~=0 and rc:IsLocation(LOCATION_REMOVED)
and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_SZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101004053,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
--トリックスター・ライトアリーナ
--Trickstar Light Arena
--Scripted by sahim
function c101004054.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004054,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,101004054)
e2:SetCondition(c101004054.spcon)
e2:SetTarget(c101004054.sptg)
e2:SetOperation(c101004054.spop)
c:RegisterEffect(e2)
--lock
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004054,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,101004054+100)
e3:SetTarget(c101004054.target)
e3:SetOperation(c101004054.operation)
c:RegisterEffect(e3)
end
function c101004054.spcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
return ec:IsSetCard(0xfb) and ec:IsSummonType(SUMMON_TYPE_LINK) and ec:GetSummonPlayer()==tp
end
function c101004054.spfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsSetCard(0xfb)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101004054.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=eg:GetFirst():GetMaterial()
if chkc then return mg:IsContains(chkc) and c101004054.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and mg:IsExists(c101004054.spfilter,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:FilterSelect(tp,c101004054.spfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004054.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
function c101004054.cfilter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function c101004054.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_SZONE) and c101004054.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004054.cfilter,tp,0,LOCATION_SZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101004054,2))
local g=Duel.SelectTarget(tp,c101004054.cfilter,tp,0,LOCATION_SZONE,1,1,e:GetHandler())
end
function c101004054.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFacedown() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
e:SetLabelObject(tc)
c:ResetFlagEffect(101004054)
tc:ResetFlagEffect(101004054)
local fid=c:GetFieldID()
c:RegisterFlagEffect(101004054,RESET_EVENT+0x1fe0000,0,1,fid)
tc:RegisterFlagEffect(101004054,RESET_EVENT+0x1fe0000,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e1:SetLabelObject(tc)
e1:SetCondition(c101004054.rcon)
e1:SetValue(1)
tc:RegisterEffect(e1)
--End of e1
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e2:SetLabel(fid)
e2:SetLabelObject(e1)
e2:SetCondition(c101004054.rstcon)
e2:SetOperation(c101004054.rstop)
Duel.RegisterEffect(e2,tp)
--return to hand
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e3:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c101004054.agcon)
e3:SetOperation(c101004054.agop)
Duel.RegisterEffect(e3,1-tp)
--activate check
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_CHAINING)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DRAW)
e4:SetLabel(tc:GetFieldID())
e4:SetLabelObject(e3)
e4:SetOperation(c101004054.rstop2)
Duel.RegisterEffect(e4,tp)
end
end
function c101004054.rcon(e)
return e:GetOwner():IsHasCardTarget(e:GetHandler()) and e:GetHandler():GetFlagEffect(101004054)~=0
end
function c101004054.rstcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject():GetLabelObject()
if tc:GetFlagEffectLabel(101004054)==e:GetLabel()
and c:GetFlagEffectLabel(101004054)==e:GetLabel() then
return not c:IsDisabled()
else
e:Reset()
return false
end
end
function c101004054.rstop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
te:Reset()
Duel.HintSelection(Group.FromCards(e:GetHandler()))
end
function c101004054.agcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(101004054)==e:GetLabel()
and c:GetFlagEffectLabel(101004054)==e:GetLabel() then
return not c:IsDisabled()
else
e:Reset()
return false
end
end
function c101004054.agop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
function c101004054.rstop2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffectLabel(101004054)~=e:GetLabel() then return end
local c=e:GetHandler()
c:CancelCardTarget(tc)
local te=e:GetLabelObject()
tc:ResetFlagEffect(101004054)
if te then te:Reset() end
end
--トリックスター・ブーケ
--Trickstar Bouquet
--Scripted by Eerie Code
function c101004055.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101004055)
e1:SetTarget(c101004055.target)
e1:SetOperation(c101004055.activate)
c:RegisterEffect(e1)
end
function c101004055.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfb)
and c:IsAbleToHand() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function c101004055.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101004055.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c101004055.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101004055.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=2 then return end
local hc=g:GetFirst()
local tc=g:GetNext()
if hc~=e:GetLabelObject() then tc,hc=hc,tc end
if hc:IsFaceup() and tc:IsFaceup() and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 then
local atk=hc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--剛鬼フェイスターン
--Gouki Face Turn
function c101004056.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101004056+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101004056.target)
e1:SetOperation(c101004056.activate)
c:RegisterEffect(e1)
end
function c101004056.desfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfc) and Duel.GetMZoneCount(tp,c)>0
end
function c101004056.spfilter(c,e,tp)
return c:IsSetCard(0xfc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004056.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,c,tp)
and Duel.IsExistingTarget(c101004056.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c101004056.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0)
e:SetLabelObject(g1:GetFirst())
end
function c101004056.activate(e,tp,eg,ep,ev,re,r,rp)
local tc1,tc2=Duel.GetFirstTarget()
if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end
if tc1:IsControler(tp) and tc1:IsRelateToEffect(e) and Duel.Destroy(tc1,REASON_EFFECT)>0 and tc2:IsRelateToEffect(e) then
Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP)
end
end
--星遺物が導く果て
--World Legacy End
--Script by nekrozar
function c101004057.initial_effect(c)
c:SetUniqueOnField(1,0,101004057)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004057,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c101004057.spcon)
e2:SetTarget(c101004057.sptg)
e2:SetOperation(c101004057.spop)
c:RegisterEffect(e2)
end
function c101004057.cfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and bit.band(c:GetPreviousTypeOnField(),TYPE_LINK)~=0
and (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT)))
end
function c101004057.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004057.cfilter,1,nil,tp,rp)
end
function c101004057.spfilter(c,e,tp)
return c:IsSetCard(0xfe) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101004057.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101004057.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c101004057.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101004057.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--星遺物を継ぐもの
--World Legacy Successor
--Scripted by Eerie Code
function c101004058.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101004058+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101004058.target)
e1:SetOperation(c101004058.activate)
c:RegisterEffect(e1)
end
function c101004058.filter(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c101004058.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=Duel.GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004058.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101004058.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004058.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004058.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local zone=Duel.GetLinkedZone(tp)
if tc:IsRelateToEffect(e) and zone~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
--星遺物へ誘う悪夢
--World Legacy Nightmare
--Script by nekrozar
function c101004059.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--avoid battle damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101004059.efilter)
e2:SetValue(1)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004059,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetTarget(c101004059.mvtg)
e3:SetOperation(c101004059.mvop)
c:RegisterEffect(e3)
end
function c101004059.efilter(e,c)
return c:GetMutualLinkedGroupCount()>0
end
function c101004059.mvfilter1(c)
return c:IsFaceup() and c:IsSetCard(0x112)
end
function c101004059.mvfilter2(c,tp)
return c:IsFaceup() and c:IsSetCard(0x112) and c:GetSequence()<5
and Duel.IsExistingMatchingCard(c101004059.mvfilter3,tp,LOCATION_MZONE,0,1,c)
end
function c101004059.mvfilter3(c)
return c:IsFaceup() and c:IsSetCard(0x112) and c:GetSequence()<5
end
function c101004059.mvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c101004059.mvfilter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0
local b2=Duel.IsExistingMatchingCard(c101004059.mvfilter2,tp,LOCATION_MZONE,0,1,nil,tp)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(101004059,1),aux.Stringid(101004059,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(101004059,1))
else op=Duel.SelectOption(tp,aux.Stringid(101004059,2))+1 end
e:SetLabel(op)
end
function c101004059.mvop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101004059,3))
local g=Duel.SelectMatchingCard(tp,c101004059.mvfilter1,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(g:GetFirst(),nseq)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectMatchingCard(tp,c101004059.mvfilter2,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc1=g1:GetFirst()
if not tc1 then return end
Duel.HintSelection(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectMatchingCard(tp,c101004059.mvfilter3,tp,LOCATION_MZONE,0,1,1,tc1)
Duel.HintSelection(g2)
local tc2=g2:GetFirst()
Duel.SwapSequence(tc1,tc2)
end
end
--霊神の聖殿
--Temple of the Elemental Lords
--Scripted by Eerie Code
function c101004060.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--boost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(c101004060.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101004060,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetTarget(c101004060.thtg)
e4:SetOperation(c101004060.thop)
c:RegisterEffect(e4)
--change cost
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101004060,1))
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(101004060)
e5:SetRange(LOCATION_FZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e5:SetTargetRange(1,0)
e5:SetCondition(c101004060.condition)
c:RegisterEffect(e5)
end
function c101004060.atkval(e,c)
return Duel.GetMatchingGroup(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_MONSTER):GetClassCount(Card.GetAttribute)*200
end
function c101004060.thfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101004060.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004060.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101004060.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101004060.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
if Duel.GetTurnPlayer()==tp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c101004060.skipcon)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
end
function c101004060.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
function c101004060.condition(e)
return e:GetHandler():GetFlagEffect(101004060)==0
end
--再臨の帝王
--Return of the Monarchs
function c101004061.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101004061+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101004061.target)
e1:SetOperation(c101004061.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetOperation(c101004061.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c101004061.desop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--double tribute
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_DOUBLE_TRIBUTE)
e4:SetValue(c101004061.condition)
c:RegisterEffect(e4)
end
function c101004061.spfilter(c,e,tp)
return (c:GetAttack()==2400 or c:GetAttack()==2800) and c:GetDefense()==1000 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004061.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004061.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101004061.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004061.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101004061.eqlimit(e,c)
return e:GetOwner()==c
end
function c101004061.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if not Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then return end
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c101004061.eqlimit)
c:RegisterEffect(e1)
--Disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e3)
Duel.SpecialSummonComplete()
end
end
function c101004061.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c101004061.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c101004061.condition(e,c)
return c:IsType(TYPE_MONSTER)
end
--雪花の光
--Light of Sekka
--Script by nekrozar
function c101004062.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004062,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101004062)
e1:SetCondition(c101004062.condition)
e1:SetTarget(c101004062.target)
e1:SetOperation(c101004062.activate)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004062,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101004162)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101004062.tdtg)
e2:SetOperation(c101004062.tdop)
c:RegisterEffect(e2)
end
function c101004062.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_SPELL+TYPE_TRAP)
end
function c101004062.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c101004062.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c101004062.aclimit)
Duel.RegisterEffect(e1,tp)
end
function c101004062.aclimit(e,re,tp)
return not re:GetHandler():IsCode(101004062) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:GetHandler():IsImmuneToEffect(e)
end
function c101004062.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c101004062.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(c101004062.tdfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101004062.tdop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c101004062.tdfilter,p,LOCATION_HAND,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,1,1,nil)
Duel.ConfirmCards(1-p,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(p)
Duel.BreakEffect()
Duel.Draw(p,1,REASON_EFFECT)
end
end
--バウンドリンク
--Bound Link
--Script by nekrozar
function c101004063.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101004063.target)
e1:SetOperation(c101004063.activate)
c:RegisterEffect(e1)
end
function c101004063.filter(c,tp)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_LINK) and c:IsAbleToExtra() and Duel.IsPlayerCanDraw(tp,c:GetLink())
end
function c101004063.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c101004063.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101004063.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101004063.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(g:GetFirst():GetLink())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,g:GetFirst():GetLink())
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,g:GetFirst():GetLink())
end
function c101004063.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local tc=Duel.GetFirstTarget()
local ct=tc:GetLink()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_EXTRA) then
if Duel.Draw(p,ct,REASON_EFFECT)==ct then
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,ct,ct,nil)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
Duel.SortDecktop(p,p,ct)
for i=1,ct do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),1)
end
end
end
end
--にらみ合い
--Staredown
--Script by nekrozar
function c101004064.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004064,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c101004064.mvcon1)
e2:SetTarget(c101004064.mvtg1)
e2:SetOperation(c101004064.mvop1)
c:RegisterEffect(e2)
--move
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004064,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c101004064.mvcon2)
e3:SetTarget(c101004064.mvtg2)
e3:SetOperation(c101004064.mvop2)
c:RegisterEffect(e3)
end
function c101004064.cfilter(c,tp)
return c:GetSummonPlayer()==tp and c:IsPreviousLocation(LOCATION_EXTRA)
end
function c101004064.mvcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004064.cfilter,1,nil,tp)
end
function c101004064.mvfilter(c)
return c:GetSequence()<5
end
function c101004064.mvtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=0
local lg=eg:Filter(c101004064.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,1-tp))
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c101004064.mvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004064.mvfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101004064,2))
Duel.SelectTarget(tp,c101004064.mvfilter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c101004064.mvop1(e,tp,eg,ep,ev,re,r,rp)
local zone=0
local lg=eg:Filter(c101004064.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,1-tp))
end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(tp)
or Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)<=0 then return end
local flag=bit.bxor(zone,0xff)*0x10000
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,flag)/0x10000
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
function c101004064.mvcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004064.cfilter,1,nil,1-tp)
end
function c101004064.mvtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=0
local lg=eg:Filter(c101004064.cfilter,nil,1-tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101004064.mvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004064.mvfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101004064,2))
Duel.SelectTarget(tp,c101004064.mvfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101004064.mvop2(e,tp,eg,ep,ev,re,r,rp)
local zone=0
local lg=eg:Filter(c101004064.cfilter,nil,1-tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp)
or Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL,zone)<=0 then return end
local flag=bit.bxor(zone,0xff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
--墓穴の指名者
--Designator From the Grave
--Script by nekrozar
function c101004065.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101004065.target)
e1:SetOperation(c101004065.activate)
c:RegisterEffect(e1)
end
function c101004065.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c101004065.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and c101004065.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101004065.filter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c101004065.filter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c101004065.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c101004065.distg)
e1:SetLabel(tc:GetOriginalCode())
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(c101004065.discon)
e2:SetOperation(c101004065.disop)
e2:SetLabel(tc:GetOriginalCode())
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end
function c101004065.distg(e,c)
local code=e:GetLabel()
local code1,code2=c:GetOriginalCodeRule()
return code1==code or code2==code
end
function c101004065.discon(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel()
local code1,code2=re:GetHandler():GetOriginalCodeRule()
return re:IsActiveType(TYPE_MONSTER) and (code1==code or code2==code)
end
function c101004065.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--取捨蘇生
--Selective Reborn
--Script by nekrozar
function c101004066.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101004066.target)
e1:SetOperation(c101004066.activate)
c:RegisterEffect(e1)
end
function c101004066.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004066.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101004066.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101004066.filter,tp,LOCATION_GRAVE,0,3,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004066.filter,tp,LOCATION_GRAVE,0,3,3,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004066.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local tc=g:Select(1-tp,1,1,nil):GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
g:RemoveCard(tc)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
--リミット・コード
--Limit Code
--scripted by Larry126
function c101004067.initial_effect(c)
c:EnableCounterPermit(0x47)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101004067+EFFECT_COUNT_CODE_DUEL)
e1:SetCost(c101004067.cost)
e1:SetTarget(c101004067.target)
e1:SetOperation(c101004067.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c101004067.desop)
c:RegisterEffect(e2)
--remove counter
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetCondition(c101004067.rccon)
e3:SetOperation(c101004067.rcop)
c:RegisterEffect(e3)
end
function c101004067.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(c101004067.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c101004067.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
e:GetOwner():CancelToGrave(false)
end
function c101004067.spfilter(c,e,tp)
return c:IsSetCard(0x101) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c101004067.cfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK)
end
function c101004067.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanAddCounter(tp,0x47,1,e:GetHandler())
and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c101004067.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c101004067.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
local ct=Duel.GetMatchingGroupCount(c101004067.cfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,ct,0,0x47)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101004067.eqlimit(e,c)
return e:GetLabelObject()==c
end
function c101004067.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetMatchingGroupCount(c101004067.cfilter,tp,LOCATION_GRAVE,0,nil)
if c:IsRelateToEffect(e) and ct>0 and c:IsCanAddCounter(0x47,ct) then
c:AddCounter(0x47,ct)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101004067.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c101004067.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
Duel.SpecialSummonComplete()
elseif not c:IsStatus(STATUS_LEAVE_CONFIRMED) then
c:CancelToGrave(false)
end
end
end
function c101004067.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c101004067.rccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c101004067.rcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
if c:IsCanRemoveCounter(tp,0x47,1,REASON_EFFECT) then
c:RemoveCounter(tp,0x47,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
end
end
end
--レッド・リブート
--Red Reboot
--Scripted by Eerie Code
function c101004068.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c101004068.condition)
e1:SetCost(c101004068.cost)
e1:SetTarget(c101004068.target)
e1:SetOperation(c101004068.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2)
end
function c101004068.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c101004068.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
end
function c101004068.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable(true)
end
function c101004068.target(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)
end
function c101004068.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) then
rc:CancelToGrave()
Duel.ChangePosition(rc,POS_FACEDOWN)
Duel.RaiseEvent(rc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
local g=Duel.GetMatchingGroup(c101004068.setfilter,tp,0,LOCATION_DECK,nil)
if g:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(101004068,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(1-tp,1,1,nil)
Duel.SSet(1-tp,sg:GetFirst())
Duel.ConfirmCards(tp,sg)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(0,LOCATION_SZONE+LOCATION_HAND)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TRAP))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--ジェルゴンヌの終焉
--Gergonne's End
--Script by nekrozar
function c101004069.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c101004069.cost)
e1:SetTarget(c101004069.target)
e1:SetOperation(c101004069.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004069,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c101004069.descon)
e2:SetTarget(c101004069.destg)
e2:SetOperation(c101004069.desop)
c:RegisterEffect(e2)
end
function c101004069.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(c101004069.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c101004069.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
e:GetOwner():CancelToGrave(false)
end
function c101004069.filter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0x10b)
end
function c101004069.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101004069.filter(chkc) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingTarget(c101004069.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c101004069.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101004069.eqlimit(e,c)
return c:GetControler()==e:GetHandlerPlayer() and c:IsType(TYPE_LINK) and c:IsSetCard(0x10b)
end
function c101004069.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(c101004069.eqlimit)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
else
c:CancelToGrave(false)
end
end
function c101004069.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget()
return tc and tc:GetLinkedGroupCount()==tc:GetLink()
end
function c101004069.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetEquipTarget()
if chk==0 then return tc:GetLinkedGroupCount()>0 end
local lg=tc:GetLinkedGroup()
lg:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,lg,lg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetAttack())
end
function c101004069.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
if not c:IsRelateToEffect(e) or not tc then return end
local atk=tc:GetAttack()
local lg=tc:GetLinkedGroup()
lg:AddCard(c)
local ct=lg:GetCount()
if ct>0 then
local dc=Duel.Destroy(lg,REASON_EFFECT)
if dc==ct then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
--オルターガイスト・エミュレルフ
--Altergeist Emulelf
function c101004070.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:SetTarget(c101004070.target)
e1:SetOperation(c101004070.activate)
c:RegisterEffect(e1)
end
function c101004070.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101004070,0x103,0x21,1400,1800,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101004070.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,101004070,0x103,0x21,1400,1800,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) then return end
c:AddMonsterAttribute(TYPE_TRAP+TYPE_EFFECT)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP)
c:AddMonsterAttributeComplete()
--untargetable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c101004070.etarget)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c101004070.etarget)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
function c101004070.etarget(e,c)
return c:IsSetCard(0x103) and c:IsType(TYPE_TRAP) and c~=e:GetHandler()
end
--星遺物からの目醒め
--World Legacy Awakening
--Script by nekrozar
function c101004071.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101004071+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101004071.target)
e1:SetOperation(c101004071.activate)
c:RegisterEffect(e1)
end
function c101004071.filter(c)
return c:IsSpecialSummonable(SUMMON_TYPE_LINK)
end
function c101004071.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004071.filter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c101004071.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101004071.filter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_LINK)
end
end
--星遺物への抵抗
--Resistance Against the World Legacy
--Script by nekrozar
function c101004072.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101004072.target)
e1:SetOperation(c101004072.activate)
c:RegisterEffect(e1)
end
function c101004072.cfilter(c)
return c:GetMutualLinkedGroupCount()>0
end
function c101004072.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingMatchingCard(c101004072.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
local ct=Duel.GetMatchingGroupCount(c101004072.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c101004072.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end
--星遺物に響く残叫
--Echo in the World Legacy
function c101004073.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,101004073+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101004073.condition)
e1:SetTarget(c101004073.target)
e1:SetOperation(c101004073.activate)
c:RegisterEffect(e1)
end
function c101004073.cfilter(c)
return c:IsFaceup() and c:GetMutualLinkedGroupCount()>0
end
function c101004073.condition(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or not Duel.IsExistingMatchingCard(c101004073.cfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
return Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function c101004073.target(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)
end
end
function c101004073.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--霊神統一
--Elemental Training
--Scripted by Eerie Code
function c101004074.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--indes/untarget
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c101004074.intg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101004074,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetRange(LOCATION_SZONE)
e4:SetCost(c101004074.spcost)
e4:SetTarget(c101004074.sptg)
e4:SetOperation(c101004074.spop)
c:RegisterEffect(e4)
--discard & salvage
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101004074,1))
e5:SetCategory(CATEGORY_HANDES+CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetRange(LOCATION_SZONE)
e5:SetCost(c101004074.thcost)
e5:SetTarget(c101004074.thtg)
e5:SetOperation(c101004074.thop)
c:RegisterEffect(e5)
end
function c101004074.intg(e,c)
return c:IsFaceup() and c:IsCode(101004060)
end
function c101004074.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101004074.filter1(c,e,tp)
return Duel.IsExistingMatchingCard(c101004074.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalAttribute())
and Duel.GetMZoneCount(tp,c)>0
end
function c101004074.filter2(c,e,tp,att)
return c:IsSetCard(0x400d) and c:GetOriginalAttribute()~=att and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004074.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c101004074.filter1,1,nil,e,tp)
end
local rg=Duel.SelectReleaseGroup(tp,c101004074.filter1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetOriginalAttribute())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101004074.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local att=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101004074.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,att)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101004074.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 c101004074.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x113) and c:IsAbleToHand()
end
function c101004074.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=hg:GetCount()
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(c101004074.thfilter,tp,LOCATION_GRAVE,0,ct,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,hg,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,ct,tp,LOCATION_GRAVE)
end
function c101004074.thop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=Duel.SendtoGrave(hg,REASON_EFFECT+REASON_DISCARD)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101004074.thfilter),tp,LOCATION_GRAVE,0,ct,ct,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
--神属の堕天使
--Darklord Divinity
function c101004075.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101004075+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101004075.cost)
e1:SetTarget(c101004075.target)
e1:SetOperation(c101004075.activate)
c:RegisterEffect(e1)
end
function c101004075.costfilter(c)
return c:IsSetCard(0xef)
and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c101004075.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function c101004075.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004075.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101004075.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c101004075.filter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end
function c101004075.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004075.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0)
end
function c101004075.activate(e,tp,eg,ep,ev,re,r,rp)
local exc=nil
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then exc=e:GetHandler() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c101004075.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,exc)
if g:GetCount()>0 then
local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local atk=tc:GetAttack()
if atk>0 then
Duel.Recover(tp,atk,REASON_EFFECT)
end
end
end
--電網の落とし穴
--Network Trap Hole
--Script by nekrozar
function c101004076.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c101004076.target)
e1:SetOperation(c101004076.activate)
c:RegisterEffect(e1)
end
function c101004076.filter(c,tp)
return c:GetSummonPlayer()~=tp and bit.band(c:GetSummonLocation(),LOCATION_DECK+LOCATION_GRAVE)~=0
and c:IsAbleToRemove() and c:IsLocation(LOCATION_MZONE)
end
function c101004076.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c101004076.filter,nil,tp)
local ct=g:GetCount()
if chk==0 then return ct>0 end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,ct,0,0)
end
function c101004076.activate(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c101004076.filter,nil,tp):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
--無限泡影
--Fleeting Infinity
--Script by nekrozar
function c101004077.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetTarget(c101004077.target)
e1:SetOperation(c101004077.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c101004077.handcon)
c:RegisterEffect(e2)
end
function c101004077.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 aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_MZONE,1,1,nil)
end
function c101004077.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
if not c:IsStatus(STATUS_ACT_FROM_HAND) and c:IsLocation(LOCATION_SZONE) then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e4:SetTarget(c101004077.distg)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetLabel(c:GetSequence())
Duel.RegisterEffect(e4,tp)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetOperation(c101004077.disop)
e5:SetReset(RESET_PHASE+PHASE_END)
e5:SetLabel(c:GetSequence())
Duel.RegisterEffect(e5,tp)
end
end
end
function c101004077.distg(e,c)
local seq=e:GetLabel()
local p=c:GetControler()
local tp=e:GetHandlerPlayer()
return c:IsType(TYPE_SPELL+TYPE_TRAP)
and ((p==tp and c:GetSequence()==seq) or (p==1-tp and c:GetSequence()==4-seq))
end
function c101004077.disop(e,tp,eg,ep,ev,re,r,rp)
local tseq=e:GetLabel()
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
local p=re:GetHandlerPlayer()
local tp=e:GetHandlerPlayer()
if bit.band(loc,LOCATION_SZONE)~=0 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and ((p==tp and seq==tseq) or (p==1-tp and seq==4-tseq)) then
Duel.NegateEffect(ev)
end
end
function c101004077.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
--無情なはたき落とし
--Ruthless Drop Off
--Script by nekrozar
function c101004078.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetCode(EVENT_TO_HAND)
e1:SetCondition(c101004078.condition)
e1:SetTarget(c101004078.target)
e1:SetOperation(c101004078.activate)
c:RegisterEffect(e1)
end
function c101004078.cfilter(c,tp)
return c:IsControler(tp) and c:IsReason(REASON_EFFECT) and (c:IsPreviousLocation(LOCATION_GRAVE) or (c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)))
end
function c101004078.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004078.cfilter,1,nil,1-tp)
end
function c101004078.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,1-tp,1)
end
function c101004078.filter(c,e,tp)
return c:IsRelateToEffect(e) and c101004078.cfilter(c,tp)
end
function c101004078.rmfilter(c,g)
return c:IsAbleToRemove() and g:IsExists(Card.IsCode,1,nil,c:GetCode())
end
function c101004078.activate(e,tp,eg,ep,ev,re,r,rp)
local dg=eg:Filter(c101004078.filter,nil,e,1-tp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
local tg=g:Filter(c101004078.rmfilter,nil,dg)
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
end
end
--豆まき
--Mamemaki
--Script by nekrozar
function c101004079.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101004079.target)
e1:SetOperation(c101004079.activate)
c:RegisterEffect(e1)
end
function c101004079.filter(c,tp)
local lv=c:GetLevel()
return lv>0 and c:IsFaceup() and c:IsAbleToDeck() and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=lv and Duel.IsPlayerCanDraw(tp,lv)
end
function c101004079.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 c101004079.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101004079.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c101004079.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
local lv=g:GetFirst():GetLevel()
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,lv)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,lv)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101004079.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local lv=tc:GetLevel()
if tc:IsRelateToEffect(e) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=lv then
local ct=Duel.DiscardHand(tp,aux.TRUE,lv,lv,REASON_EFFECT+REASON_DISCARD)
if ct>0 and Duel.Draw(tp,lv,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
--やぶ蛇
--Shrub Serpent
--Script by nekrozar
function c101004080.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004080,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c101004080.spcon)
e1:SetTarget(c101004080.sptg)
e1:SetOperation(c101004080.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
end
function c101004080.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c101004080.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004080.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
return loc~=0 and Duel.IsExistingMatchingCard(c101004080.spfilter,tp,loc,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c101004080.spop(e,tp,eg,ep,ev,re,r,rp)
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101004080.spfilter,tp,loc,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ヴァンパイア・サッカー
--Vampire Sucker
--Scripted by Eerie Code
function c101004100.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_ZOMBIE),2,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004100,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101004100)
e1:SetTarget(c101004100.sptg)
e1:SetOperation(c101004100.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004100,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,101004100+100)
e2:SetCondition(c101004100.drcon)
e2:SetTarget(c101004100.drtg)
e2:SetOperation(c101004100.drop)
c:RegisterEffect(e2)
--extra material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_ZOMBIE))
e3:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_HAND,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
end
function c101004100.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function c101004100.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c101004100.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsExistingTarget(c101004100.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101004100.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101004100.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_ZOMBIE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
end
function c101004100.drfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsPreviousLocation(LOCATION_GRAVE)
end
function c101004100.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101004100.drfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c101004100.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101004100.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
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