Commit 0a2b69c1 authored by mercury233's avatar mercury233

rm

parent 234ccfd5
#created by ...
#main
101005001
101005002
101005003
101005004
101005005
101005006
101005007
101005008
101005009
101005010
101005011
101005012
101005013
101005014
101005015
101005016
101005017
101005018
101005019
101005020
101005021
101005022
101005023
101005024
101005025
101005026
101005027
101005028
101005029
101005030
101005031
101005051
101005052
101005100
101005054
101005055
101005056
101005057
101005058
101005059
101005060
101005061
101005062
101005063
101005064
101005101
101005066
101005067
101005068
101005069
#extra
101005032
101005033
101005034
101005035
101005036
101005037
101005038
101005039
101005040
101005041
101005042
101005043
101005044
101005045
101005046
!side
101005047
101005048
101005049
101005050
101005070
101005071
101005072
101005073
101005074
101005075
101005076
101005077
101005078
101005079
101005080
#The first line is used for comment #The first line is used for comment
!setname 0x216 魔神仪
!setname 0x217 圣像骑士
!counter 0x48 指示物(连接死亡炮塔)
--SIMMタブラス
--SIMM Dublas
--scripted by Naim
function c101005001.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101005001)
e1:SetCost(c101005001.cost)
e1:SetTarget(c101005001.target)
e1:SetOperation(c101005001.operation)
c:RegisterEffect(e1)
end
function c101005001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101005001.lkfilter(c)
return c:IsType(TYPE_LINK) and c:IsLinkState()
end
function c101005001.filter(c)
return c:IsRace(RACE_CYBERSE) and c:GetLevel()==4 and c:IsAbleToHand()
end
function c101005001.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101005001.filter(chkc) end
local c=e:GetHandler()
if chk==0 then
local lg=Duel.GetMatchingGroup(c101005001.lkfilter,tp,LOCATION_MZONE,0,nil)
local zone=0
for tc in aux.Next(lg) do
zone=bit.bor(zone,bit.band(tc:GetLinkedZone(),0x1f))
end
return zone~=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101005001.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c101005001.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101005001.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local lg=Duel.GetMatchingGroup(c101005001.lkfilter,tp,LOCATION_MZONE,0,nil)
local zone=0
for tc in aux.Next(lg) do
zone=bit.bor(zone,bit.band(tc:GetLinkedZone(),0x1f))
end
if zone~=0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
--クラスター・コンジェスター
--Cluster Congester
--Scripted by Eerie Code
function c101005002.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101005002)
e1:SetCondition(c101005002.tkcon1)
e1:SetTarget(c101005002.tktg1)
e1:SetOperation(c101005002.tkop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--tokens
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMING_BATTLE_PHASE)
e3:SetCondition(c101005002.tkcon2)
e3:SetCost(c101005002.tkcost2)
e3:SetTarget(c101005002.tktg2)
e3:SetOperation(c101005002.tkop)
c:RegisterEffect(e3)
end
function c101005002.tkcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_LINK)==0
end
function c101005002.tktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101005002+100,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function c101005002.tkop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,101005002+100,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) then
local tk=Duel.CreateToken(tp,101005002+100)
Duel.SpecialSummon(tk,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101005002.tkcon2(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_LINK)
return at and g:IsContains(at)
end
function c101005002.tkcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,Duel.GetAttackTarget())>0 end
local g=Group.FromCards(e:GetHandler(),Duel.GetAttackTarget())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101005002.tktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_LINK)
and Duel.IsPlayerCanSpecialSummonMonster(tp,101005002+100,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function c101005002.tkop2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanSpecialSummonMonster(tp,101005002+100,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) then return end
local ct=math.min(Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK),Duel.GetLocationCount(tp,LOCATION_MZONE))
if ct<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
repeat
local token=Duel.CreateToken(tp,101005002+100)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
ct=ct-1
until ct<=0 or not Duel.SelectYesNo(tp,aux.Stringid(101005002,0))
Duel.SpecialSummonComplete()
end
--剛鬼ムーンサルト
--Gouki Moonsault
--Script by nekrozar
function c101005003.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005003,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,101005003)
e1:SetCost(c101005003.spcost)
e1:SetTarget(c101005003.sptg)
e1:SetOperation(c101005003.spop)
c:RegisterEffect(e1)
--to extra
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005003,1))
e2:SetCategory(CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101005103)
e2:SetTarget(c101005003.tdtg)
e2:SetOperation(c101005003.tdop)
c:RegisterEffect(e2)
end
function c101005003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101005003.spfilter(c)
return c:IsSetCard(0xfc) and c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(101005003)
end
function c101005003.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101005003.spfilter(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(c101005003.spfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c101005003.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101005003.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
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
function c101005003.tdfilter(c)
return c:IsSetCard(0xfc) and c:IsType(TYPE_LINK) and c:IsAbleToExtra()
end
function c101005003.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005003.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005003.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101005003.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c101005003.thfilter(c)
return c:IsSetCard(0xfc) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101005003.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 tc:IsLocation(LOCATION_EXTRA) then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101005003.thfilter),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101005003,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--剛鬼ツープラトン
--Gouki Double Team
--Script by nekrozar
function c101005004.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005004,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c101005004.atkcon)
e1:SetOperation(c101005004.atkop)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005004,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101005004.tdtg)
e2:SetOperation(c101005004.tdop)
c:RegisterEffect(e2)
end
function c101005004.atkcon(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(0xfc)
end
function c101005004.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if rc:IsFaceup() and rc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
rc:RegisterEffect(e1)
end
end
function c101005004.tdfilter(c)
return c:IsSetCard(0xfc) and c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function c101005004.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101005004.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005004.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101005004.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c101005004.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
--剛鬼ヘルトレーナー
--Gouki Hell Trainer
--Script by nekrozar
function c101005005.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101005005)
e1:SetCondition(c101005005.spcon)
e1:SetCost(c101005005.spcost)
e1:SetTarget(c101005005.sptg)
e1:SetOperation(c101005005.spop)
c:RegisterEffect(e1)
--indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(c101005005.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c101005005.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c101005005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101005005.spfilter(c,e,tp)
return c:IsSetCard(0xfc) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005005.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005005.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c101005005.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005005.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c101005005.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
Duel.BreakEffect()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
end
end
function c101005005.indfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0xfc)
end
function c101005005.indcon(e)
return Duel.IsExistingMatchingCard(c101005005.indfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--魔境のパラディオン
--Script by nekrozar
function c101005006.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,101005006)
e1:SetCondition(c101005006.spcon)
e1:SetValue(c101005006.spval)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005006,0))
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_SUMMON_SUCCESS)
e2:SetCountLimit(1,101005106)
e2:SetCondition(c101005006.descon)
e2:SetTarget(c101005006.destg)
e2:SetOperation(c101005006.desop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c101005006.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101005006.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c101005006.descon(e,tp,eg,ep,ev,re,r,rp)
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
return lg1 and lg1:IsContains(e:GetHandler())
end
function c101005006.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x217)
end
function c101005006.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101005006.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c101005006.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function c101005006.desop(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 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--神樹のパラディオン
--Script by nekrozar
function c101005007.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,101005007)
e1:SetCondition(c101005007.spcon)
e1:SetValue(c101005007.spval)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetCountLimit(1,101005107)
e2:SetTarget(c101005007.reptg)
e2:SetValue(c101005007.repval)
e2:SetOperation(c101005007.repop)
c:RegisterEffect(e2)
end
function c101005007.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101005007.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c101005007.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsSetCard(0x217) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c101005007.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c101005007.repfilter,1,c,tp) and c:IsAbleToRemove()
and Duel.GetFlagEffect(tp,101005007)==0 end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c101005007.repval(e,c)
return c101005007.repfilter(c,e:GetHandlerPlayer())
end
function c101005007.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,101005007,RESET_PHASE+PHASE_END,0,1)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
--百獣のパラディオン
--Script by nekrozar
function c101005008.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,101005008)
e1:SetCondition(c101005008.spcon)
e1:SetValue(c101005008.spval)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005008,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101005108)
e2:SetCondition(c101005008.condition)
e2:SetTarget(c101005008.target)
e2:SetOperation(c101005008.operation)
c:RegisterEffect(e2)
end
function c101005008.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101005008.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c101005008.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c101005008.filter(c)
return c:IsFaceup() and c:IsSetCard(0x217) and c:IsType(TYPE_LINK) and not c:IsHasEffect(EFFECT_PIERCE)
end
function c101005008.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(c101005008.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005008.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005008.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--星辰のパラディオン
--Script by nekrozar
function c101005009.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,101005009)
e1:SetCondition(c101005009.spcon)
e1:SetValue(c101005009.spval)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005009,0))
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_SUMMON_SUCCESS)
e2:SetCountLimit(1,101005109)
e2:SetCondition(c101005009.thcon)
e2:SetTarget(c101005009.thtg)
e2:SetOperation(c101005009.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c101005009.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101005009.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c101005009.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
return lg1 and lg1:IsContains(e:GetHandler())
end
function c101005009.thfilter(c)
return c:IsSetCard(0x217) and not c:IsCode(101005009) and c:IsAbleToHand()
end
function c101005009.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005009.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005009.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101005009.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101005009.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
--天穹のパラディオン
--Script by nekrozar
function c101005010.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,101005010)
e1:SetCondition(c101005010.spcon)
e1:SetValue(c101005010.spval)
c:RegisterEffect(e1)
--double damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005010,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101005110)
e2:SetCondition(c101005010.dbcon)
e2:SetTarget(c101005010.dbtg)
e2:SetOperation(c101005010.dbop)
c:RegisterEffect(e2)
end
function c101005010.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101005010.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c101005010.dbcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c101005010.dbfilter(c)
return c:IsFaceup() and c:IsSetCard(0x217) and c:IsType(TYPE_LINK) and c:GetFlagEffect(101005010)==0
end
function c101005010.dbtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101005010.dbfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005010.dbfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005010.dbfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005010.dbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c101005010.ftarget)
e1:SetLabel(tc:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if tc:IsRelateToEffect(e) then
tc:RegisterFlagEffect(101005010,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c101005010.damcon)
e1:SetOperation(c101005010.damop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c101005010.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c101005010.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetBattleTarget()~=nil
end
function c101005010.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
end
--星遺物-『星冠』
--World Legacy - "World Crown"
--Scripted by ahtelel
function c101005011.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005011,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,101005011)
e1:SetCondition(c101005011.spcon)
e1:SetValue(c101005011.spval)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005011,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101005011.negcon)
e2:SetCost(c101005011.negcost)
e2:SetTarget(c101005011.negtg)
e2:SetOperation(c101005011.negop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005011,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_RELEASE)
e3:SetCountLimit(1,101005011+100)
e3:SetCondition(c101005011.thcon)
e3:SetTarget(c101005011.thtg)
e3:SetOperation(c101005011.thop)
c:RegisterEffect(e3)
end
function c101005011.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101005011.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c101005011.negcon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():GetSummonLocation()==LOCATION_EXTRA and loc==LOCATION_MZONE
and Duel.IsChainNegatable(ev)
end
function c101005011.negcost(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 c101005011.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 c101005011.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 c101005011.thfilter(c)
return c:IsSetCard(0xfe) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c101005011.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c101005011.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005011.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005011.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005011.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
--魔神儀-キャンドール
--Deviritual Candoll
function c101005012.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005012,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101005012)
e1:SetCost(c101005012.spcost)
e1:SetTarget(c101005012.sptg)
e1:SetOperation(c101005012.spop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005012,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,101005012)
e2:SetCondition(c101005012.thcon)
e2:SetTarget(c101005012.thtg)
e2:SetOperation(c101005012.thop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c101005012.sumlimit)
c:RegisterEffect(e3)
end
function c101005012.filter(c,e,tp)
return c:IsSetCard(0x216) and not c:IsCode(101005012) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005012.costfilter(c)
return c:GetType()==0x82 and not c:IsPublic()
end
function c101005012.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005012.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c101005012.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c101005012.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(c101005012.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101005012.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():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,c101005012.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(e:GetHandler())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101005012.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function c101005012.thfilter(c)
return c:GetType()==0x82 and c:IsAbleToHand()
end
function c101005012.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005012.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005012.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005012.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 c101005012.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA)
end
--魔神儀-タリスマンドラ
--Deviritual Talismandra
function c101005013.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005013,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101005013)
e1:SetCost(c101005013.spcost)
e1:SetTarget(c101005013.sptg)
e1:SetOperation(c101005013.spop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005013,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,101005013)
e2:SetCondition(c101005013.thcon)
e2:SetTarget(c101005013.thtg)
e2:SetOperation(c101005013.thop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c101005013.sumlimit)
c:RegisterEffect(e3)
end
function c101005013.filter(c,e,tp)
return c:IsSetCard(0x216) and not c:IsCode(101005013) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005013.costfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and not c:IsPublic()
end
function c101005013.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005013.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c101005013.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c101005013.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(c101005013.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101005013.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():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,c101005013.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(e:GetHandler())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101005013.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function c101005013.thfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToHand()
end
function c101005013.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005013.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005013.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005013.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 c101005013.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA)
end
--サイバー・ドラゴン・フィーア
--Cyber Dragon Vier
--Script by nekrozar
function c101005014.initial_effect(c)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(70095154)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005014,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,101005014)
e2:SetCondition(c101005014.spcon)
e2:SetTarget(c101005014.sptg)
e2:SetOperation(c101005014.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsCode,70095154))
e4:SetValue(500)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
end
function c101005014.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(70095154) and c:GetSummonPlayer()==tp
end
function c101005014.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101005014.cfilter,1,nil,tp)
end
function c101005014.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,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101005014.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_DEFENSE)
end
end
--サイバー・ドラゴン・ヘルツ
--Cyber Dragon Hertz
--scripted by Naim
function c101005015.initial_effect(c)
--name change
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(70095154)
c:RegisterEffect(e1)
--level change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005015,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101005015)
e2:SetTarget(c101005015.lvtg)
e2:SetOperation(c101005015.lvop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005015,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,101005015)
e3:SetTarget(c101005015.thtg)
e3:SetOperation(c101005015.thop)
c:RegisterEffect(e3)
end
function c101005015.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsLevel(5) end
end
function c101005015.lvop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(5)
c:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(1,0)
e2:SetLabelObject(e)
e2:SetTarget(c101005015.splimit)
Duel.RegisterEffect(e2,tp)
end
function c101005015.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_MACHINE)
end
function c101005015.thfilter(c)
return c:IsCode(70095154) and c:IsAbleToHand()
end
function c101005015.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005015.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c101005015.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101005015.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,e:GetHandler())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--ドラグニティ-セナート
--Dragunity Senatus
--Scripted by ahtelel
function c101005016.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005016,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101005016)
e1:SetCost(c101005016.eqcost)
e1:SetTarget(c101005016.eqtg)
e1:SetOperation(c101005016.eqop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005016,1))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c101005016.reptg)
e2:SetValue(c101005016.repval)
e2:SetOperation(c101005016.repop)
c:RegisterEffect(e2)
end
function c101005016.cfilter(c)
return c:IsSetCard(0x29) and c:IsDiscardable()
end
function c101005016.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005016.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c101005016.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c101005016.eqfilter(c,ec)
return c:IsSetCard(0x29) and c:IsType(TYPE_TUNER) and not c:IsForbidden()
end
function c101005016.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c101005016.eqfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c101005016.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c101005016.eqfilter,tp,LOCATION_DECK,0,1,1,nil,c)
if g:GetCount()>0 then
Duel.Equip(tp,g:GetFirst(),c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c101005016.eqlimit)
e1:SetLabelObject(c)
g:GetFirst():RegisterEffect(e1)
end
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c101005016.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c101005016.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c101005016.splimit(e,c)
return not c:IsRace(RACE_DRAGON) and c:IsLocation(LOCATION_EXTRA)
end
function c101005016.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and c:IsSetCard(0x29)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and not c:IsReason(REASON_REPLACE)
end
function c101005016.desfilter(c,e,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_SZONE) and c:IsSetCard(0x29)
and e:GetHandler():GetEquipGroup():IsContains(c)
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function c101005016.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c101005016.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(c101005016.desfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c101005016.desfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
e:SetLabelObject(g:GetFirst())
g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
end
return false
end
function c101005016.repval(e,c)
return c101005016.repfilter(c,e:GetHandlerPlayer())
end
function c101005016.repop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
tc:SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE)
end
--ドラグニティ-クーゼ
--Dragunity Couse
--scripted by Naim
function c101005017.initial_effect(c)
--synchro limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(c101005017.synlimit)
c:RegisterEffect(e1)
--synchro level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetValue(c101005017.slevel)
c:RegisterEffect(e2)
--special summon while equipped
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005017,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c101005017.sptg)
e3:SetOperation(c101005017.spop)
c:RegisterEffect(e3)
end
function c101005017.synlimit(e,c)
if not c then return false end
return not c:IsSetCard(0x29)
end
function c101005017.slevel(e,c)
local lv=e:GetHandler():GetLevel()
return 4*65536+lv
end
function c101005017.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 c101005017.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--メタファイズ・デコイドラゴン
--Metaphys Decoy Dragon
--Script by nekrozar
function c101005018.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005018,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,101005018)
e1:SetCondition(c101005018.spcon1)
e1:SetTarget(c101005018.sptg1)
e1:SetOperation(c101005018.spop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101005118)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005018,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1,101005218)
e3:SetRange(LOCATION_REMOVED)
e3:SetCondition(c101005018.spcon2)
e3:SetTarget(c101005018.sptg2)
e3:SetOperation(c101005018.spop2)
c:RegisterEffect(e3)
end
function c101005018.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget() and Duel.GetAttackTarget():IsControler(tp)
end
function c101005018.spfilter(c,e,tp)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x105) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c101005018.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c101005018.spfilter(chkc,e,tp) end
if chk==0 then return e:GetHandler():IsAbleToRemove()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101005018.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005018.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101005018.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0
and c:IsLocation(LOCATION_REMOVED) and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
end
function c101005018.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetHandler():GetTurnID()+1
end
function c101005018.sptg2(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 c101005018.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--闇霊神オブルミラージュ
--Oblemirage the Elemental Lord
--Script by nekrozar
function c101005019.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(c101005019.spcon)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005019,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,101005019)
e3:SetTarget(c101005019.thtg)
e3:SetOperation(c101005019.thop)
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(c101005019.leaveop)
c:RegisterEffect(e4)
end
function c101005019.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_DARK)==5
end
function c101005019.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005019.thfilter(c)
return c:IsAttackBelow(1500) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101005019.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005019.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 c101005019.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(c101005019.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 c101005019.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
--コスモブレイン
--Cosmo Brain
--Script by nekrozar
function c101005020.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c101005020.sprcon)
e1:SetOperation(c101005020.sprop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005020,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101005020)
e2:SetCost(c101005020.spcost)
e2:SetTarget(c101005020.sptg)
e2:SetOperation(c101005020.spop)
c:RegisterEffect(e2)
end
function c101005020.sprfilter(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and not c:IsType(TYPE_EFFECT) and c:IsType(TYPE_MONSTER)
and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c101005020.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c101005020.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp)
end
function c101005020.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101005020.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
local lv=g:GetFirst():GetLevel()
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(lv*200)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function c101005020.costfilter(c,tp)
return c:IsType(TYPE_EFFECT) and Duel.GetMZoneCount(tp,c,tp)>0
end
function c101005020.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c101005020.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c101005020.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c101005020.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005020.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005020.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end
function c101005020.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,c101005020.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--魔晶龍ジルドラス
--Zirdras, the Magicrystal Dragon
--Script by nekrozar
function c101005021.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005021,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,101005021)
e1:SetCondition(c101005021.spcon)
e1:SetTarget(c101005021.sptg)
e1:SetOperation(c101005021.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
end
function c101005021.cfilter(c,tp)
return bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0 and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp
end
function c101005021.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101005021.cfilter,1,nil,tp)
end
function c101005021.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 c101005021.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(TYPE_FIELD) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSSetable()
end
function c101005021.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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101005021.setfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101005021,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--魔神童
--Majindou
--Script by nekrozar
function c101005022.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005022,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,101005022)
e1:SetCondition(c101005022.spcon)
e1:SetTarget(c101005022.sptg)
e1:SetOperation(c101005022.spop)
c:RegisterEffect(e1)
--flip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005022,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101005122)
e2:SetTarget(c101005022.tgtg)
e2:SetOperation(c101005022.tgop)
c:RegisterEffect(e2)
end
function c101005022.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_DECK)
end
function c101005022.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,POS_FACEDOWN_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101005022.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_FACEDOWN_DEFENSE)~=0 then
Duel.ConfirmCards(1-tp,c)
end
end
function c101005022.tgfilter(c)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c101005022.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005022.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101005022.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101005022.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--サイコ・エース
--Psycho Ace
--Script by nekrozar
function c101005023.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005023,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_RELEASE)
e1:SetCondition(c101005023.descon)
e1:SetTarget(c101005023.destg)
e1:SetOperation(c101005023.desop)
c:RegisterEffect(e1)
end
function c101005023.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c101005023.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101005023.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
--ハイ・キューピット
--High Cupit
--Script by nekrozar
function c101005024.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005024,0))
e1:SetCategory(CATEGORY_LVCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101005024)
e1:SetCost(c101005024.lvcost)
e1:SetOperation(c101005024.lvop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005024,1))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,101005124)
e2:SetCondition(c101005024.reccon)
e2:SetTarget(c101005024.rectg)
e2:SetOperation(c101005024.recop)
c:RegisterEffect(e2)
end
function c101005024.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
local ct={}
for i=3,1,-1 do
if Duel.IsPlayerCanDiscardDeckAsCost(tp,i) then
table.insert(ct,i)
end
end
if #ct==1 then
Duel.DiscardDeck(tp,ct[1],REASON_COST)
e:SetLabel(1)
else
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101005024,2))
local ac=Duel.AnnounceNumber(tp,table.unpack(ct))
Duel.DiscardDeck(tp,ac,REASON_COST)
e:SetLabel(ac)
end
end
function c101005024.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local ct=e:GetLabel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetValue(ct)
c:RegisterEffect(e1)
end
end
function c101005024.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp and bit.band(r,REASON_DESTROY)~=0 and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c101005024.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
function c101005024.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--寝ガエル
--Doublecross Frog
--Script by nekrozar
function c101005025.initial_effect(c)
--cannot material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e4)
--to defense
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101005025,0))
e5:SetCategory(CATEGORY_POSITION)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetTarget(c101005025.postg)
e5:SetOperation(c101005025.posop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e6)
--control
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(101005025,1))
e7:SetCategory(CATEGORY_CONTROL)
e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetProperty(EFFECT_FLAG_CARD_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetTarget(c101005025.cttg)
e7:SetOperation(c101005025.ctop)
c:RegisterEffect(e7)
end
function c101005025.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c101005025.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() and c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
end
function c101005025.ctfilter1(c,tp)
local seq=c: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 c101005025.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c101005025.ctfilter1(chkc,1-tp) end
if chk==0 then return Duel.IsExistingTarget(c101005025.ctfilter1,tp,0,LOCATION_MZONE,1,nil,1-tp)
and e:GetHandler():IsControlerCanBeChanged() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c101005025.ctfilter1,tp,0,LOCATION_MZONE,1,1,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function c101005025.ctfilter2(c)
return c:GetSequence()<5 and c:IsFaceup() and c:IsCode(101005025)
end
function c101005025.ctfilter3(c,seq1,seq2)
local seq=c:GetSequence()
return seq>seq1 and seq<seq2 and c:IsControlerCanBeChanged()
end
function c101005025.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) or not c:IsPosition(POS_FACEUP_DEFENSE) then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or not tc:IsControler(1-tp) then return end
local seq=tc:GetSequence()
if seq>4 then return end
if (seq>0 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq+1)) then
local zone=0
if seq>0 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq-1) then zone=bit.replace(zone,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq+1) then zone=bit.replace(zone,0x1,seq+1) end
if Duel.GetControl(c,1-tp,0,0,zone)==0 then return end
local g1=Duel.GetMatchingGroup(c101005025.ctfilter2,tp,0,LOCATION_MZONE,nil)
if g1:GetCount()==2 then
local seq1=g1:GetFirst():GetSequence()
local seq2=g1:GetNext():GetSequence()
if seq1>seq2 then seq1,seq2=seq2,seq1 end
local g2=Duel.GetMatchingGroup(c101005025.ctfilter3,tp,0,LOCATION_MZONE,nil,seq1,seq2)
if g2:GetCount()>0 then
Duel.BreakEffect()
Duel.GetControl(g2,tp)
end
end
end
end
--サイバース・マジシャン
--Cyberse Magician
--Scripted by ahtelel
function c101005026.initial_effect(c)
c:EnableReviveLimit()
--halve damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetLabel(tp)
e1:SetValue(c101005026.val)
c:RegisterEffect(e1)
--target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetCondition(c101005026.atcon)
e2:SetValue(c101005026.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c101005026.atcon)
e3:SetTarget(c101005026.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e4:SetCondition(c101005026.atkcon)
e4:SetOperation(c101005026.atkop)
c:RegisterEffect(e4)
--to hand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101005026,0))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(c101005026.thcon)
e5:SetTarget(c101005026.thtg)
e5:SetOperation(c101005026.thop)
c:RegisterEffect(e5)
end
function c101005026.val(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)>0 then return dam end
if bit.band(r,REASON_EFFECT)~=0 or bit.band(r,REASON_BATTLE)~=0 then
return dam/2
else
return dam
end
end
function c101005026.filter(c)
return c:IsType(TYPE_LINK)
end
function c101005026.atcon(e)
return Duel.IsExistingMatchingCard(c101005026.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c101005026.atlimit(e,c)
return c~=e:GetHandler()
end
function c101005026.tglimit(e,c)
return c~=e:GetHandler()
end
function c101005026.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsType(TYPE_LINK)
end
function c101005026.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(1000)
c:RegisterEffect(e1)
end
end
function c101005026.thfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101005026.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:GetPreviousControler()==tp
end
function c101005026.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c101005026.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005026.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005026.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
--破滅の天使ルイン
--Ruin, Angel of Oblivion
--Scripted by ahtelel
function c101005027.initial_effect(c)
c:EnableReviveLimit()
--multi attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(aux.Stringid(101005027,0))
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c101005027.atkcon)
e1:SetOperation(c101005027.atkop)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005027,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetTarget(c101005027.target)
e2:SetOperation(c101005027.operation)
c:RegisterEffect(e2)
--name change
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetRange(LOCATION_MZONE+LOCATION_HAND)
e3:SetValue(46427957)
c:RegisterEffect(e3)
end
function c101005027.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101005027.atkop(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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c101005027.filter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function c101005027.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005027.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005027.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005027.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005027.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101005027.actcon)
e1:SetOperation(c101005027.actop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(101005027,2))
end
end
function c101005027.actcon(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker()
return ac and ac:IsControler(tp) and ac:IsType(TYPE_RITUAL)
end
function c101005027.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c101005027.actlimit)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c101005027.actlimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
--終焉の悪魔デミス
--Demise, Fiend of Armageddon
--Scripted by ahtelel
function c101005028.initial_effect(c)
c:EnableReviveLimit()
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetValue(72426662)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005028,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c101005028.descon)
e2:SetTarget(c101005028.destg)
e2:SetOperation(c101005028.desop)
c:RegisterEffect(e2)
--actlimit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005028,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetTarget(c101005028.target)
e3:SetOperation(c101005028.operation)
c:RegisterEffect(e3)
end
function c101005028.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101005028.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101005028.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function c101005028.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function c101005028.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005028.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005028.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005028.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005028.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c101005028.actop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(101005028,2))
end
end
function c101005028.actop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_RITUAL) and re:IsActiveType(TYPE_MONSTER) and ep==tp then
Duel.SetChainLimit(c101005028.chainlm)
end
end
function c101005028.chainlm(e,rp,tp)
return tp==rp
end
--破滅の美神ルイン
--Ruin, Graceful Queen of Oblivion
function c101005029.initial_effect(c)
c:EnableReviveLimit()
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetValue(46427957)
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:SetCondition(c101005029.indcon)
e2:SetTarget(c101005029.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetCondition(c101005029.condition)
e3:SetValue(1)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetCondition(aux.bdocon)
e4:SetTarget(c101005029.damtg)
e4:SetOperation(c101005029.damop)
c:RegisterEffect(e4)
end
function c101005029.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101005029.indtg(e,c)
return c:IsType(TYPE_RITUAL)
end
function c101005029.mfilter(c)
return not c:IsType(TYPE_RITUAL)
end
function c101005029.condition(e)
local c=e:GetHandler()
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:GetCount()>0 and not mg:IsExists(c101005029.mfilter,1,nil)
end
function c101005029.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetBattleTarget()
local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c101005029.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--終焉の覇王デミス
--Demise, Supreme King of Armageddon
function c101005030.initial_effect(c)
c:EnableReviveLimit()
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetValue(72426662)
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:SetCondition(c101005030.indcon)
e2:SetTarget(c101005030.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
--cost change
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_LPCOST_CHANGE)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(1,1)
e0:SetCondition(c101005030.costcon)
e0:SetValue(c101005030.costval)
c:RegisterEffect(e0)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c101005030.descost)
e3:SetTarget(c101005030.destg)
e3:SetOperation(c101005030.desop)
c:RegisterEffect(e3)
end
function c101005030.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101005030.indtg(e,c)
return c:IsType(TYPE_RITUAL)
end
function c101005030.mfilter(c)
return not c:IsType(TYPE_RITUAL)
end
function c101005030.costcon(e)
local c=e:GetHandler()
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:GetCount()>0 and not mg:IsExists(c101005030.mfilter,1,nil)
end
function c101005030.costchange(e,re,rp,val)
if re and re:IsHasType(0x7e0) and re:GetHandler()==e:GetHandler() then
return 0
else return val end
end
function c101005030.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c101005030.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local ct=g:FilterCount(Card.IsControler,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*200)
end
function c101005030.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,1-tp)
if ct>0 then
Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end
end
--嵐竜の聖騎士
--Paladin of Storm Dragon
--Scripted by ahtelel
function c101005031.initial_effect(c)
c:EnableReviveLimit()
--return to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005031,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCountLimit(1,101005031)
e1:SetTarget(c101005031.thtg)
e1:SetOperation(c101005031.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005031,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101005131)
e2:SetCost(c101005031.spcost)
e2:SetTarget(c101005031.sptg)
e2:SetOperation(c101005031.spop)
c:RegisterEffect(e2)
end
function c101005031.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local d=Duel.GetAttackTarget()
if chk==0 then return Duel.GetAttacker()==c and d and d:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,d,1,0,0)
end
function c101005031.thop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d and d:IsRelateToBattle() then
Duel.SendtoHand(d,nil,REASON_EFFECT)
end
end
function c101005031.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp,c)>0 and c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c101005031.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005031.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 c101005031.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,c101005031.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
--ドラグニティナイト-ハールーン
--Dragunity Knight – Harloon
--Script by dest
function c101005032.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x29),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005032,0))
e1:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101005032)
e1:SetTarget(c101005032.eqtg)
e1:SetOperation(c101005032.eqop)
c:RegisterEffect(e1)
--equip(self)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005032,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101005032+100)
e2:SetTarget(c101005032.eqstg)
e2:SetOperation(c101005032.eqsop)
c:RegisterEffect(e2)
end
function c101005032.filter(c)
return c:IsSetCard(0x29) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c101005032.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005032.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c101005032.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c101005032.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c101005032.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if not Duel.Equip(tp,tc,c,false) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c101005032.eqlimit)
tc:RegisterEffect(e1)
end
end
function c101005032.eqlimit(e,c)
return e:GetOwner()==c
end
function c101005032.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x29)
end
function c101005032.eqstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005032.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c101005032.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c101005032.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101005032.eqsop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
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(c101005032.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
end
--ドラグニティナイト-アスカロン
--Dragunity Knight - Ascalon
--Scripted by ahtelel
function c101005033.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x29),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--banish
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005033,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c101005033.rmcost)
e1:SetTarget(c101005033.rmtg)
e1:SetOperation(c101005033.rmop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005033,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101005033)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c101005033.spcon)
e2:SetTarget(c101005033.sptg)
e2:SetOperation(c101005033.spop)
c:RegisterEffect(e2)
end
function c101005033.cfilter(c)
return c:IsSetCard(0x29) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c101005033.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005033.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101005033.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101005033.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c101005033.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c101005033.spfilter(c,e,tp)
return c:IsSetCard(0x29) and c:IsAttackBelow(3000) and c:IsType(TYPE_SYNCHRO)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c101005033.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c101005033.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.IsExistingMatchingCard(c101005033.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101005033.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101005033.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
end
end
--ヴァレルソード・ドラゴン
--BorrelSword Dragon
function c101005034.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),3)
c:EnableReviveLimit()
--battle indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005034,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetHintTiming(0,0x1e0)
e2:SetTarget(c101005034.postg)
e2:SetOperation(c101005034.posop)
c:RegisterEffect(e2)
--atk change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005034,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1)
e3:SetCondition(c101005034.atkcon)
e3:SetTarget(c101005034.atktg)
e3:SetOperation(c101005034.atkop)
c:RegisterEffect(e3)
end
function c101005034.posfilter(c)
return c:IsAttackPos() and c:IsCanChangePosition()
end
function c101005034.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101005034.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005034.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c101005034.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
Duel.SetChainLimit(c101005034.chlimit)
end
function c101005034.chlimit(e,ep,tp)
return tp==ep
end
function c101005034.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsAttackPos() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
end
if c:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function c101005034.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and tc:IsFaceup() and tc:GetAttack()>0
end
function c101005034.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
e:GetHandler():GetBattleTarget():CreateEffectRelation(e)
end
function c101005034.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() or tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
if c:IsRelateToEffect(e) and c:IsFaceup() then
local atk=tc:GetAttack()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetValue(math.ceil(atk/2))
c:RegisterEffect(e2)
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e1)
end
end
end
--サイバース・ウィッチ
--Cyberse Witch
--Scripted by ahtelel
function c101005035.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_CYBERSE),2,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005035,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101005035)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101005035.thcon)
e1:SetCost(c101005035.thcost)
e1:SetTarget(c101005035.thtg)
e1:SetOperation(c101005035.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005035,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101005135)
e2:SetCondition(c101005035.spcon)
e2:SetTarget(c101005035.sptg)
e2:SetOperation(c101005035.spop)
c:RegisterEffect(e2)
end
function c101005035.thcfilter(c,tp,lg)
return c:IsControler(tp) and lg:IsContains(c)
end
function c101005035.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c101005035.thcfilter,1,nil,tp,lg)
end
function c101005035.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function c101005035.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005035.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101005035.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101005035.thfilter1(c,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c101005035.thfilter2,tp,LOCATION_DECK,0,1,c)
end
function c101005035.thfilter2(c)
return c:IsCode(101005051) and c:IsAbleToHand()
end
function c101005035.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005035.thfilter1,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c101005035.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,c101005035.thfilter1,tp,LOCATION_DECK,0,1,1,nil,tp)
if g1:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c101005035.thfilter2,tp,LOCATION_DECK,0,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
Duel.RegisterFlagEffect(tp,101005035,RESET_PHASE+PHASE_END,0,1)
end
function c101005035.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,101005035)>0
end
function c101005035.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005035.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101005035.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101005035.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005035.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101005035.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
--リンク・ディヴォーティー
--Link Devotee
--scripted by Larry126
function c101005036.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c101005036.matfilter,1,1)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005036,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c101005036.limop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005036,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101005036)
e2:SetCondition(c101005036.spcon)
e2:SetTarget(c101005036.sptg)
e2:SetOperation(c101005036.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetLabelObject(e2)
e3:SetOperation(c101005036.chk)
c:RegisterEffect(e3)
end
function c101005036.chk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(e:GetHandler():GetMutualLinkedGroupCount())
end
function c101005036.matfilter(c,lc,sumtype,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE,lc,sumtype,tp)
end
function c101005036.limop(e,tp,eg,ep,ev,re,r,rp,c)
--cannot link summon
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c101005036.splimit)
Duel.RegisterEffect(e1,tp)
end
function c101005036.splimit(e,c,tp,sumtp,sumpos)
return c:IsType(TYPE_LINK) and c:IsLinkAbove(3) and bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function c101005036.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()>0
end
function c101005036.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 Duel.IsPlayerCanSpecialSummonMonster(tp,101005136,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
end
function c101005036.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2
or not Duel.IsPlayerCanSpecialSummonMonster(tp,101005136,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,101005136)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
--レストレーション・ポイントガード
--Restoration Point Guard
--Scripted by Eerie Code
function c101005037.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_CYBERSE),2,2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c101005037.incon)
e1:SetOperation(c101005037.inop)
c:RegisterEffect(e1)
--be material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c101005037.regcon)
e2:SetOperation(c101005037.regop)
c:RegisterEffect(e2)
end
function c101005037.incon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_LINK) and not eg:IsContains(e:GetHandler())
end
function c101005037.inop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
end
function c101005037.regcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function c101005037.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101005037)
e1:SetLabelObject(rc)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c101005037.spcon)
e1:SetTarget(c101005037.sptg)
e1:SetOperation(c101005037.spop)
c:RegisterEffect(e1)
end
function c101005037.spcon(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabelObject()
return eg:IsContains(rc) and bit.band(r,REASON_EFFECT)~=0 and rp~=tp
end
function c101005037.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 c101005037.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
--剛鬼ジャドウ・オーガ
--Gouki Shadow Ogre
--Script by nekrozar
function c101005038.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfc),2,2)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005038,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(c101005038.negcon)
e1:SetTarget(c101005038.negtg)
e1:SetOperation(c101005038.negop)
c:RegisterEffect(e1)
end
function c101005038.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local loc,seq,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE,CHAININFO_TRIGGERING_CONTROLER)
if p==1-tp then seq=seq+16 end
return re:IsActiveType(TYPE_MONSTER) and bit.band(loc,LOCATION_MZONE)~=0 and bit.extract(c:GetLinkedZone(),seq)~=0 and Duel.IsChainNegatable(ev)
end
function c101005038.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 c101005038.spfilter(c,e,tp)
return c:IsSetCard(0xfc) and not c:IsCode(101005038) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005038.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101005038.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101005038,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--剛鬼ザ・ジャイアント・オーガ
--Gouki the Giant Ogre
function c101005039.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfc),3)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c101005039.immval)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005039,0))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101005039.negcon)
e3:SetTarget(c101005039.negtg)
e3:SetOperation(c101005039.negop)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101005039,1))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c101005039.atkcon)
e4:SetOperation(c101005039.atkop)
c:RegisterEffect(e4)
end
function c101005039.immval(e,te)
return te:GetOwner()~=e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
and te:GetOwner():GetAttack()<=e:GetHandler():GetAttack() and te:IsActivated()
end
function c101005039.negfilter(c,g)
return g:IsContains(c)
end
function c101005039.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local lg=e:GetHandler():GetLinkedGroup()
lg:AddCard(c)
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and lg:IsExists(c101005039.negfilter,1,nil,tg) and Duel.IsChainNegatable(ev)
end
function c101005039.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)
end
function c101005039.negop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsFacedown() or c:GetAttack()<500 or not c:IsRelateToEffect(e)
or Duel.GetCurrentChain()~=ev+1 or c:IsStatus(STATUS_BATTLE_DESTROYED) then
return
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
c:RegisterEffect(e1)
if not c:IsImmuneToEffect(e1) and not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.NegateActivation(ev)
end
end
function c101005039.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetAttack()~=c:GetBaseAttack() and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
end
function c101005039.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
--ショートヴァレル・ドラゴン
--Miniborrel Dragon
--Script by nekrozar
function c101005040.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x102),2,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005040,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,101005040)
e1:SetCondition(c101005040.spcon)
e1:SetCost(c101005040.spcost)
e1:SetTarget(c101005040.sptg)
e1:SetOperation(c101005040.spop)
c:RegisterEffect(e1)
end
function c101005040.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10f) and c:IsType(TYPE_LINK)
end
function c101005040.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101005040.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101005040.costfilter(c,tp)
return c:IsLinkBelow(3) and Duel.GetMZoneCount(tp,c)>0
end
function c101005040.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c101005040.costfilter,1,nil,tp) end
local sg=Duel.SelectReleaseGroup(tp,c101005040.costfilter,1,1,nil,tp)
e:SetLabel(sg:GetFirst():GetLink())
Duel.Release(sg,REASON_COST)
end
function c101005040.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101005040.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_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetTarget(c101005040.lklimit)
e1:SetLabel(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
end
function c101005040.lklimit(e,c)
if not c then return false end
local lk=e:GetLabel()
return c:IsLink(lk)
end
--マガジンドラムゴン
--Vorticular Drumgon
--Script by nekrozar
function c101005041.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c101005041.matfilter,3,3)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005041,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101005041)
e1:SetTarget(c101005041.drtg)
e1:SetOperation(c101005041.drop)
c:RegisterEffect(e1)
--disable field
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101005041.discon)
e2:SetOperation(c101005041.disop)
c:RegisterEffect(e2)
end
function c101005041.matfilter(c)
return c:IsLinkRace(RACE_DRAGON) and c:IsLinkAttribute(ATTRIBUTE_DARK)
end
function c101005041.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101005041.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)
e:GetHandler():RegisterFlagEffect(101005041,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
function c101005041.discon(e)
return e:GetHandler():GetFlagEffect(101005041)~=0
end
function c101005041.disop(e,tp)
local c=e:GetHandler()
local flag1=bit.band(c:GetLinkedZone(tp),0xffffff00)
local flag2=bit.band(c:GetLinkedZone(1-tp),0xff00ffff)
return flag1+flag2
end
--マギアス・パラディオン
--Script by nekrozar
function c101005042.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c101005042.matfilter,1,1)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101005042.atkval)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c101005042.antg)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005042,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,101005042)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101005042.thcon)
e3:SetTarget(c101005042.thtg)
e3:SetOperation(c101005042.thop)
c:RegisterEffect(e3)
end
function c101005042.matfilter(c)
return c:IsLinkSetCard(0x217) and not c:IsLinkCode(101005042)
end
function c101005042.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c101005042.antg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c101005042.cfilter(c,lg)
return c:IsType(TYPE_EFFECT) and lg:IsContains(c)
end
function c101005042.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c101005042.cfilter,1,nil,lg)
end
function c101005042.thfilter(c)
return c:IsSetCard(0x217) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101005042.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005042.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005042.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005042.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
--レグレクス・パラディオン
--Script by nekrozar
function c101005043.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,c101005043.lcheck)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101005043.atkval)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c101005043.antg)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005043,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,101005043)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101005043.thcon)
e3:SetTarget(c101005043.thtg)
e3:SetOperation(c101005043.thop)
c:RegisterEffect(e3)
end
function c101005043.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x217)
end
function c101005043.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c101005043.antg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c101005043.cfilter(c,lg)
return c:IsType(TYPE_EFFECT) and lg:IsContains(c)
end
function c101005043.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c101005043.cfilter,1,nil,lg)
end
function c101005043.thfilter(c)
return c:IsSetCard(0x217) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c101005043.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005043.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005043.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005043.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
--アークロード・パラディオン
--Arch-Lord Palladion
--Script by nekrozar
function c101005044.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,c101005044.lcheck)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101005044.atkval)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c101005044.antg)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005044,0))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,0x1c0)
e3:SetCountLimit(1)
e3:SetCost(c101005044.discost)
e3:SetTarget(c101005044.distg)
e3:SetOperation(c101005044.disop)
c:RegisterEffect(e3)
end
function c101005044.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_LINK)
end
function c101005044.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c101005044.antg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c101005044.cfilter(c,g)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x217)) and g:IsContains(c)
end
function c101005044.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.CheckReleaseGroup(tp,c101005044.cfilter,1,nil,lg) end
local g=Duel.SelectReleaseGroup(tp,c101005044.cfilter,1,1,nil,lg)
Duel.Release(g,REASON_COST)
end
function c101005044.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c101005044.disop(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: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
end
end
--明星の機械騎士
--Mekk-Knight of the Morning Star
--Script by nekrozar
function c101005045.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c101005045.lcheck)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005045,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101005045)
e1:SetCondition(c101005045.thcon)
e1:SetCost(c101005045.thcost)
e1:SetTarget(c101005045.thtg)
e1:SetOperation(c101005045.thop)
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(aux.TargetBoolFunction(Card.IsSetCard,0x10c))
e2:SetValue(c101005045.tglimit)
c:RegisterEffect(e2)
--avoid battle damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x10c))
e3:SetValue(c101005045.tglimit)
c:RegisterEffect(e3)
end
function c101005045.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x10c)
end
function c101005045.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101005045.costfilter(c)
return ((c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)) and c:IsDiscardable()
end
function c101005045.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005045.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c101005045.costfilter,1,1,REASON_DISCARD+REASON_COST)
end
function c101005045.thfilter(c)
return c:IsSetCard(0xfe) and c:IsAbleToHand()
end
function c101005045.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005045.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005045.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005045.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 c101005045.tglimit(e,c)
return not c:GetBattleTarget():GetColumnGroup():IsContains(c)
end
--サイバー・ドラゴン・ズィーガー
--Cyber Dragon Zieger
--Scripted by ahtelel
function c101005046.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_MACHINE),2,2,c101005046.lcheck)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(70095154)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005046,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1,101005046)
e2:SetCondition(c101005046.con)
e2:SetTarget(c101005046.target)
e2:SetOperation(c101005046.operation)
c:RegisterEffect(e2)
end
function c101005046.lcheck(g,lc)
return g:IsExists(Card.IsLinkCode,1,nil,70095154)
end
function c101005046.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()) and e:GetHandler():GetAttackAnnouncedCount()<1
end
function c101005046.filter(c)
return c:IsFaceup() and c:IsAttackAbove(2100) and c:IsRace(RACE_MACHINE)
end
function c101005046.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005046.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005046.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005046.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005046.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(2100)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e4:SetValue(1)
c:RegisterEffect(e4)
end
end
--閃刀姫-ハヤテ
--Brandish Maiden Hayate
--Scripted by ahtelel
function c101005047.initial_effect(c)
c:SetSPSummonOnce(101005047)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c101005047.matfilter,1,1)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005047,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetTarget(c101005047.tgtg)
e2:SetOperation(c101005047.tgop)
c:RegisterEffect(e2)
end
function c101005047.matfilter(c)
return c:IsLinkSetCard(0x1115) and not c:IsLinkAttribute(ATTRIBUTE_WIND)
end
function c101005047.tgfilter(c)
return c:IsSetCard(0x115) and c:IsAbleToGrave()
end
function c101005047.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005047.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101005047.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101005047.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--リプロドクス
--Riplodocus
--Script by nekrozar
function c101005048.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005048,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101005048)
e1:SetTarget(c101005048.ractg)
e1:SetOperation(c101005048.racop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(101005048,1))
e2:SetTarget(c101005048.atttg)
e2:SetOperation(c101005048.attop)
c:RegisterEffect(e2)
end
function c101005048.filter(c,g)
return c:IsFaceup() and g:IsContains(c)
end
function c101005048.ractg(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.IsExistingMatchingCard(c101005048.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE)
local rac=Duel.AnnounceRace(tp,1,RACE_ALL)
e:SetLabel(rac)
end
function c101005048.racop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local lg=c:GetLinkedGroup()
local g=Duel.GetMatchingGroup(c101005048.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,lg)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c101005048.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.IsExistingMatchingCard(c101005048.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xffff)
e:SetLabel(att)
end
function c101005048.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local lg=c:GetLinkedGroup()
local g=Duel.GetMatchingGroup(c101005048.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,lg)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--見習い魔嬢
--
--Scripted by Eerie Code
function c101005049.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_DARK),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_DARK))
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_LIGHT))
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(101005049,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,101005049)
e5:SetCondition(c101005049.thcon)
e5:SetTarget(c101005049.thtg)
e5:SetOperation(c101005049.thop)
c:RegisterEffect(e5)
end
function c101005049.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c101005049.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function c101005049.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005049.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005049.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101005049.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101005049.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
--ハイパースター
--Hyper Star
--Scripted by Eerie Code
function c101005050.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_LIGHT),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_LIGHT))
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_DARK))
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(101005050,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,101005050)
e5:SetCondition(c101005050.thcon)
e5:SetTarget(c101005050.thtg)
e5:SetOperation(c101005050.thop)
c:RegisterEffect(e5)
end
function c101005050.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c101005050.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
end
function c101005050.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005050.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005050.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101005050.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101005050.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
--サイバネット・リチューアル
--Cynet Ritual
--Scripted by ahtelel
function c101005051.initial_effect(c)
aux.AddRitualProcGreater(c,c101005051.ritual_filter)
--token
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetDescription(aux.Stringid(101005051,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c101005051.spcon)
e1:SetCost(c101005051.spcost)
e1:SetTarget(c101005051.sptg)
e1:SetOperation(c101005051.spop)
c:RegisterEffect(e1)
end
function c101005051.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsRace(RACE_CYBERSE)
end
function c101005051.spcon(e,tp,eg,ep,ev,re,r,rp)
return aux.exccon(e) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c101005051.cfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c101005051.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c101005051.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101005051.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101005051.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 Duel.IsPlayerCanSpecialSummonMonster(tp,101005151,0,0x4011,0,0,4,RACE_CYBERSE,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
end
function c101005051.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,101005151,0,0x4011,0,0,4,RACE_CYBERSE,ATTRIBUTE_LIGHT) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,101005151)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
--ゼロ・エクストラリンク
--Zero Extra Link
--Script by nekrozar
function c101005052.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101005052.target)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetLabelObject(e1)
e2:SetCondition(c101005052.tgcon)
e2:SetOperation(c101005052.tgop)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c101005052.atktg1)
e3:SetValue(c101005052.atkval1)
c:RegisterEffect(e3)
--atkup
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101005052,0))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_SZONE)
e4:SetTarget(c101005052.atktg2)
e4:SetOperation(c101005052.atkop2)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetRange(LOCATION_SZONE)
e5:SetValue(c101005052.valcheck)
c:RegisterEffect(e5)
--destroy
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(101005052,0))
e6:SetCategory(CATEGORY_DESTROY)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_BATTLED)
e6:SetRange(LOCATION_SZONE)
e6:SetCondition(c101005052.descon)
e6:SetTarget(c101005052.destg)
e6:SetOperation(c101005052.desop)
c:RegisterEffect(e6)
end
function c101005052.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:GetSequence()>4
end
function c101005052.filter(c,g)
return c:IsFaceup() and c:IsType(TYPE_LINK) and g:IsContains(c)
end
function c101005052.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Group.CreateGroup()
local lg=Duel.GetMatchingGroup(c101005052.lkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(lg) do
tg:Merge(tc:GetMutualLinkedGroup())
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005052.filter(chkc,tg) end
if chk==0 then return Duel.IsExistingTarget(c101005052.filter,tp,LOCATION_MZONE,0,1,nil,tg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005052.filter,tp,LOCATION_MZONE,0,1,1,nil,tg)
end
function c101005052.tgcon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject()
end
function c101005052.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):GetFirst()
if c:IsRelateToEffect(re) and tc:IsFaceup() and tc:IsRelateToEffect(re) then
c:SetCardTarget(tc)
end
end
function c101005052.atktg1(e,c)
return e:GetHandler():IsHasCardTarget(c)
end
function c101005052.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c101005052.atkval1(e,c)
local atk=Duel.GetMatchingGroupCount(c101005052.atkfilter,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,nil)*800
e:SetLabel(atk)
return atk
end
function c101005052.matfilter(c,mc)
return mc:IsHasCardTarget(c)
end
function c101005052.valcheck(e,c)
if c:GetMaterial():IsExists(c101005052.matfilter,1,nil,e:GetHandler()) then
c:RegisterFlagEffect(101005052,RESET_EVENT+0x4fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c101005052.cfilter(c,tp)
return c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_LINK) and c:GetFlagEffect(101005052)~=0
end
function c101005052.atktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c101005052.cfilter,1,nil,tp) end
Duel.SetTargetCard(eg)
end
function c101005052.atkop2(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=e:GetLabelObject():GetLabel()
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
function c101005052.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsHasCardTarget(Duel.GetAttacker())
end
function c101005052.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 c101005052.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Destroy(c,REASON_EFFECT)
end
end
--リユナイト・パラディオン
--Script by nekrozar
function c101005054.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(500)
e2:SetTarget(c101005054.atktg)
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005054,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c101005054.condition)
e3:SetTarget(c101005054.eatg)
e3:SetOperation(c101005054.eaop)
c:RegisterEffect(e3)
end
function c101005054.atktg(e,c)
return c:IsSetCard(0x217) and c:IsType(TYPE_LINK)
end
function c101005054.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c101005054.eafilter(c)
return c:IsFaceup() and c:IsSetCard(0x217) and c:IsType(TYPE_LINK)
end
function c101005054.eatg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005054.eafilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005054.eafilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101005054.eafilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005054.eaop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101005054.ftarget)
e2:SetLabel(tc:GetFieldID())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c101005054.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
--オーバード・パラディオン
--Script by nekrozar
function c101005055.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005055+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101005055.target)
e1:SetOperation(c101005055.activate)
c:RegisterEffect(e1)
end
function c101005055.filter(c)
return c:IsFaceup() and c:IsSetCard(0x217)
end
function c101005055.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005055.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005055.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005055.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005055.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c101005055.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c101005055.efilter(e,re)
return e:GetHandler()~=re:GetOwner()
end
--エンドレス・オブ・ザ・ワールド
--Endless of the World
function c101005056.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(c101005056.target)
e1:SetOperation(c101005056.activate)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005056,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(c101005056.thcost)
e2:SetTarget(c101005056.thtg)
e2:SetOperation(c101005056.thop)
c:RegisterEffect(e2)
end
c101005056.fit_monster={46427957,72426662}
function c101005056.cfilter(c,e,tp,m)
if bit.band(c:GetType(),0x81)~=0x81 or not c:IsCode(46427957,72426662)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
function c101005056.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
return Duel.IsExistingMatchingCard(c101005056.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101005056.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c101005056.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1)
local tc=tg:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c101005056.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function c101005056.filter(c)
return c:IsCode(8198712) and c:IsAbleToHand()
end
function c101005056.filter2(c)
return c:IsCode(46427957,72426662) and c:IsAbleToHand()
end
function c101005056.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005056.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005056.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005056.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101005056.filter2),tp,LOCATION_GRAVE,0,nil)
if mg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101005056,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=mg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--ブレイク・オブ・ザ・ワールド
--Break of the World
--Scripted by Eerie Code
function c101005057.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--change level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005057,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(c101005057.lvtg)
e2:SetOperation(c101005057.lvop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(c101005057.condition)
e3:SetTarget(c101005057.target)
c:RegisterEffect(e3)
end
function c101005057.lvfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
and Duel.IsExistingMatchingCard(c101005057.lvcfilter,tp,LOCATION_HAND,0,1,nil,c)
end
function c101005057.lvcfilter(c,mc)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
and (not mc or not c:IsLevel(mc:GetLevel()))
end
function c101005057.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101005057.lvfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101005057.lvfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101005057.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c101005057.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local ec=tc
if not tc:IsRelateToEffect(e) then ec=nil end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,c101005057.lvcfilter,tp,LOCATION_HAND,0,1,1,nil,ec)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
local pc=cg:GetFirst()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
pc:RegisterEffect(e2)
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetLevel())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
pc:RegisterEffect(e1)
end
end
end
function c101005057.cfilter(c,tp)
return c:IsCode(46427957,72426662) and c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101005057.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101005057.cfilter,1,nil,tp)
end
function c101005057.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsPlayerCanDraw(tp,1)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
local b2=g:GetCount()>0
if chk==0 then return b1 or b2 end
local sel=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
if b1 and b2 then
sel=Duel.SelectOption(tp,aux.Stringid(101005057,0),aux.Stringid(101005057,1))
elseif b1 then
sel=Duel.SelectOption(tp,aux.Stringid(101005057,0))
else
sel=Duel.SelectOption(tp,aux.Stringid(101005057,1))+1
end
if sel==0 then
e:SetCategory(CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e:SetOperation(c101005057.drop)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
else
e:SetCategory(CATEGORY_DESTROY)
e:SetOperation(c101005057.desop)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function c101005057.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 c101005057.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--リバース・オブ・ザ・ワールド
--Reverse of the World
--Script by nekrozar
function c101005058.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,101005058+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101005058.target)
e1:SetOperation(c101005058.activate)
c:RegisterEffect(e1)
end
function c101005058.mfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_RITUAL)
end
function c101005058.filter(c,e,tp,m)
if not c:IsCode(72426662,46427957) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
function c101005058.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(c101005058.mfilter,nil)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101005058.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101005058.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg=Duel.GetRitualMaterial(tp):Filter(c101005058.mfilter,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c101005058.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,mg)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
--サイバー・レヴシステム
--Cyber Revsystem
--Scripted by ahtelel
function c101005059.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(c101005059.target)
e1:SetOperation(c101005059.activate)
c:RegisterEffect(e1)
end
function c101005059.filter(c,e,tp)
return c:IsCode(70095154) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005059.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101005059.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c101005059.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,aux.NecroValleyFilter(c101005059.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
g:GetFirst():RegisterEffect(e1)
end
end
--星遺物の醒存
--World Legacy Survival
--Script by nekrozar
function c101005060.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005060+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101005060.target)
e1:SetOperation(c101005060.activate)
c:RegisterEffect(e1)
end
function c101005060.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c101005060.filter(c)
return (c:IsSetCard(0x104) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)
end
function c101005060.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,5) then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5)
if g:GetCount()>0 then
if g:IsExists(c101005060.filter,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c101005060.filter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
g:Sub(sg)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
else
Duel.ShuffleDeck(tp)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c101005060.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101005060.splimit(e,c)
return not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_EXTRA)
end
--星遺物の機憶
--World Legacy Mekkmory
--Scripted by Eerie Code
function c101005061.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,101005061+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101005061.target)
e1:SetOperation(c101005061.activate)
c:RegisterEffect(e1)
end
function c101005061.filter(c,e,tp)
return c:IsSetCard(0x10c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101005061.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101005061.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101005061.activate(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)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c101005061.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101005061.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local fid=c:GetFieldID()
tc:RegisterFlagEffect(101005061,RESET_EVENT+0x1fe0000,0,1,fid)
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:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c101005061.thcon)
e3:SetOperation(c101005061.thop)
Duel.RegisterEffect(e3,tp)
Duel.SpecialSummonComplete()
end
end
function c101005061.splimit(e,c)
return not c:IsSetCard(0x10c)
end
function c101005061.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(101005061)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function c101005061.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
--魔導研究所
--Magic Lab
--Script by nekrozar
function c101005062.initial_effect(c)
c:EnableCounterPermit(0x1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c101005062.ctcon)
e2:SetOperation(c101005062.ctop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(94243005,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c101005062.thtg)
e3:SetOperation(c101005062.thop)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_SZONE)
e4:SetTarget(c101005062.reptg)
c:RegisterEffect(e4)
end
function c101005062.ctfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
and bit.band(c:GetPreviousTypeOnField(),TYPE_PENDULUM)~=0 and c:IsPreviousSetCard(0x10d)
end
function c101005062.ctcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101005062.ctfilter,1,nil)
end
function c101005062.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x1,2)
end
function c101005062.thfilter1(c,tp)
local lv=c:GetLevel()
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and lv>0 and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE)
and Duel.IsCanRemoveCounter(tp,1,0,0x1,lv,REASON_COST) and c:IsAbleToHand()
end
function c101005062.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005062.thfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c101005062.thfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,tp)
local lvt={}
local tc=g:GetFirst()
while tc do
local tlv=tc:GetLevel()
lvt[tlv]=tlv
tc=g:GetNext()
end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101005062,1))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.RemoveCounter(tp,1,0,0x1,lv,REASON_COST)
e:SetLabel(lv)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c101005062.thfilter2(c,lv)
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE)
and c:GetLevel()==lv and c:IsAbleToHand()
end
function c101005062.thop(e,tp,eg,ep,ev,re,r,rp)
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005062.thfilter2,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,lv)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c101005062.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_EFFECT) and Duel.IsCanRemoveCounter(tp,1,0,0x1,1,REASON_EFFECT) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.RemoveCounter(tp,1,0,0x1,1,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
--獣・魔・導
--Beast Magic
--Scripted by Eerie Code
function c101005063.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005063,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005063+EFFECT_COUNT_CODE_OATH)
e1:SetLabel(2)
e1:SetCost(c101005063.cost)
e1:SetTarget(c101005063.thtg)
e1:SetOperation(c101005063.thop)
c:RegisterEffect(e1)
--spsummon (mythical)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(101005063,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetLabel(4)
e2:SetTarget(c101005063.sptg1)
e2:SetOperation(c101005063.spop1)
c:RegisterEffect(e2)
--spsummon (generic)
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(101005063,2))
e3:SetLabel(6)
e3:SetTarget(c101005063.sptg2)
e3:SetOperation(c101005063.spop2)
c:RegisterEffect(e3)
end
function c101005063.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,ct,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x1,ct,REASON_COST)
end
function c101005063.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10d) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c101005063.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005063.thfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_MZONE)
end
function c101005063.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c101005063.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c101005063.spfilter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x10d) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005063.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c101005063.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101005063.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101005063.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
if tc:IsCanAddCounter(0x1,2) and Duel.SelectYesNo(tp,aux.Stringid(101005063,3)) then
tc:AddCounter(0x1,2)
end
end
end
function c101005063.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005063.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c101005063.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101005063.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c101005063.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--星呼びの天儀台
--Celestial Sextant
--Scripted by Eerie Code
function c101005064.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005064+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101005064.cost)
e1:SetTarget(c101005064.target)
e1:SetOperation(c101005064.activate)
c:RegisterEffect(e1)
end
function c101005064.filter(c)
return c:IsLevel(6) and (c:IsFaceup() or not c:IsLocation(LOCATION_MZONE)) and c:IsAbleToDeckAsCost()
end
function c101005064.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005064.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c101005064.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end
function c101005064.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 c101005064.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)
end
--クロス・ブリード
--Cross Breed
--Script by nekrozar
function c101005066.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005066+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101005066.cost)
e1:SetTarget(c101005066.target)
e1:SetOperation(c101005066.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
function c101005066.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101005066.costfilter1(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c101005066.costfilter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,c,c,tp)
end
function c101005066.costfilter2(c,tc,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and c:GetOriginalRace()==tc:GetOriginalRace() and c:GetOriginalAttribute()==tc:GetOriginalAttribute() and c:GetOriginalCode()~=tc:GetOriginalCode()
and Duel.IsExistingMatchingCard(c101005066.thfilter,tp,LOCATION_DECK,0,1,nil,c,tc)
end
function c101005066.thfilter(c,tc1,tc2)
return c:GetOriginalRace()==tc1:GetOriginalRace() and c:GetOriginalAttribute()==tc1:GetOriginalAttribute()
and c:GetOriginalCode()~=tc1:GetOriginalCode() and c:GetOriginalCode()~=tc2:GetOriginalCode()
and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101005066.target(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 e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingMatchingCard(c101005066.costfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c101005066.costfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c101005066.costfilter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,g1:GetFirst(),g1:GetFirst(),tp)
g1:Merge(g2)
g1:KeepAlive()
e:SetLabelObject(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005066.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=e:GetLabelObject()
local tc1=tg:GetFirst()
local tc2=tg:GetNext()
tg:DeleteGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005066.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc1,tc2)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--予言通帳
--Bankbook of Prediction
--Script by nekrozar
function c101005067.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005067+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101005067.target)
e1:SetOperation(c101005067.activate)
c:RegisterEffect(e1)
end
function c101005067.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil)==3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK)
end
function c101005067.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end
if ct>3 then ct=3 end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
g:KeepAlive()
local c=e:GetHandler()
c:SetTurnCounter(0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabelObject(g)
e1:SetCondition(c101005067.thcon)
e1:SetOperation(c101005067.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
Duel.RegisterEffect(e1,tp)
end
function c101005067.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c101005067.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
local g=e:GetLabelObject()
if g:GetCount()==3 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
--シールド・ハンドラ
--Shield Handler
--Script by nekrozar
function c101005068.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c101005068.condition)
e1:SetCost(c101005068.cost)
e1:SetTarget(c101005068.target)
e1:SetOperation(c101005068.activate)
c:RegisterEffect(e1)
end
function c101005068.cfilter(c)
return c:IsOnField() and c:IsType(TYPE_MONSTER)
end
function c101005068.condition(e,tp,eg,ep,ev,re,r,rp)
if tp==ep then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(c101005068.cfilter,nil)-tg:GetCount()>0
end
function c101005068.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(c101005068.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c101005068.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 c101005068.eqfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c101005068.disfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_LINK)
end
function c101005068.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101005068.eqfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(c101005068.disfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
Duel.SelectTarget(tp,c101005068.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local g=Duel.SelectTarget(tp,c101005068.disfilter,tp,0,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(g:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101005068.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
if hc:IsFaceup() and hc:IsRelateToEffect(e) and hc:IsType(TYPE_MONSTER) and not hc:IsDisabled() and hc:IsControler(1-tp) then
Duel.NegateRelatedChain(hc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
hc: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)
hc:RegisterEffect(e2)
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c101005068.eqlimit)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e4)
else
c:CancelToGrave(false)
end
end
end
function c101005068.eqlimit(e,c)
return c:GetControler()==e:GetHandlerPlayer() and c:IsType(TYPE_LINK)
end
--ミラーフォース・ランチャー
--Mirror Force Launcher
--Scripted by Eerie Code
function c101005069.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c101005069.thcon)
e2:SetCost(c101005069.thcost)
e2:SetTarget(c101005069.thtg)
e2:SetOperation(c101005069.thop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c101005069.setcon)
e3:SetTarget(c101005069.settg)
e3:SetOperation(c101005069.setop)
c:RegisterEffect(e3)
end
function c101005069.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c101005069.thcfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c101005069.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005069.thcfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c101005069.thcfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c101005069.thfilter(c)
return c:IsCode(44095762) and c:IsAbleToHand()
end
function c101005069.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005069.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c101005069.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101005069.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c101005069.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c101005069.setfilter(c)
return c:IsCode(44095762) and c:IsSSetable()
end
function c101005069.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>1
and e:GetHandler():IsSSetable() and Duel.IsExistingMatchingCard(c101005069.setfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c101005069.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<2 or not c:IsRelateToEffect(e) or not c:IsSSetable() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101005069.setfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local sg=Group.FromCards(c,tc)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
tc:RegisterEffect(e2)
end
end
--リンク・デス・ターレット
--Link Turret
--Scripted by Eerie Code
function c101005070.initial_effect(c)
c:EnableCounterPermit(0x48)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101005070.target)
e1:SetOperation(c101005070.activate)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c101005070.ctcon)
e2:SetOperation(c101005070.ctop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c101005070.spcon)
e3:SetCost(c101005070.spcost)
e3:SetTarget(c101005070.sptg)
e3:SetOperation(c101005070.spop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(101005070,ACTIVITY_SPSUMMON,c101005070.counterfilter)
end
function c101005070.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanAddCounter(tp,0x48,4,c) end
end
function c101005070.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(0x48,4)
end
end
function c101005070.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA or (c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_DARK))
end
function c101005070.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE)==REASON_BATTLE
end
function c101005070.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x48,1)
end
function c101005070.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c101005070.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanRemoveCounter(tp,0x48,1,REASON_EFFECT)
and Duel.GetCustomActivityCount(101005070,tp,ACTIVITY_SPSUMMON)==0 end
c:RemoveCounter(tp,0x48,1,REASON_EFFECT)
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:SetTargetRange(1,0)
e1:SetTarget(c101005070.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101005070.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_DARK)) and c:IsLocation(LOCATION_EXTRA)
end
function c101005070.spfilter(c,e,tp)
return c:IsSetCard(0x102) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005070.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005070.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101005070.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005070.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101005070.spop(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 Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x47e0000)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3,true)
end
end
--クルセイド・パラディオン
--Script by nekrozar
function c101005071.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005071+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101005071.target)
c:RegisterEffect(e1)
--atk limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(c101005071.atcon)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetValue(c101005071.atlimit)
c:RegisterEffect(e3)
end
function c101005071.spfilter1(c,e,tp)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x217)) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c101005071.spfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,c:GetOriginalCode())
end
function c101005071.spfilter2(c,e,tp,code)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x217)) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005071.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.CheckReleaseGroup(tp,c101005071.spfilter1,1,nil,e,tp)
and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(101005071,0)) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(c101005071.activate)
local rg=Duel.SelectReleaseGroup(tp,c101005071.spfilter1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetOriginalCode())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
end
end
function c101005071.activate(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
local code=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101005071.spfilter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,code)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101005071.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x217) and c:IsType(TYPE_LINK)
end
function c101005071.atcon(e)
return Duel.IsExistingMatchingCard(c101005071.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c101005071.atlimit(e,c)
return c:IsFacedown() or not c:IsType(TYPE_LINK)
end
--リターン・オブ・ザ・ワールド
--Return of the World
--Scripted by Eerie Code
function c101005072.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005072)
e1:SetTarget(c101005072.rmtg)
e1:SetOperation(c101005072.rmop)
c:RegisterEffect(e1)
--ritual summon/to hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101005072)
e2:SetLabelObject(e1)
e2:SetCost(c101005072.cost)
e2:SetTarget(c101005072.target)
c:RegisterEffect(e2)
end
function c101005072.filter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToRemove()
end
function c101005072.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005072.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c101005072.rmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,c101005072.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
tc:RegisterFlagEffect(101005072,RESET_EVENT+0x1fe0000,0,0)
e:SetLabelObject(tc)
end
end
function c101005072.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c101005072.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject():GetLabelObject()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if not tc or tc:IsFacedown() or tc:GetFlagEffect(101005072)==0 then return false end
local b1=tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and Duel.IsExistingMatchingCard(c101005072.relfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,1,tc,e,tp,tc,ft)
local b2=tc:IsAbleToHand()
return b1 or b2
end
local b1=tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and Duel.IsExistingMatchingCard(c101005072.relfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,1,tc,e,tp,tc,ft)
local b2=tc:IsAbleToHand()
local sel=0
if b1 and b2 then
sel=Duel.SelectOption(tp,aux.Stringid(101005072,0),aux.Stringid(101005072,1))
elseif b1 then
sel=Duel.SelectOption(tp,aux.Stringid(101005072,0))
else
sel=Duel.SelectOption(tp,aux.Stringid(101005072,1))+1
end
if sel==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(c101005072.spop)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
else
e:SetCategory(CATEGORY_TOHAND)
e:SetOperation(c101005072.thop)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0)
end
end
function c101005072.relfilter(c,e,tp,tc,ft)
if not c:IsLevelAbove(tc:GetLevel()) then return false end
if tc.mat_filter and not tc.mat_filter(c) then return false end
if c:IsLocation(LOCATION_GRAVE) then
return c:IsType(TYPE_RITUAL) and ft>0 and c:IsAbleToDeck()
else
return (ft>0 or c:IsControler(tp)) and c:IsReleasableByEffect(e)
end
end
function c101005072.spop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabelObject():GetLabelObject()
if not rc or rc:IsFacedown() or rc:GetFlagEffect(101005072)==0 then return end
if not rc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101005072.relfilter),tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,1,1,rc,e,tp,rc,ft):GetFirst()
if tc then
rc:SetMaterial(Group.FromCards(tc))
if tc:IsLocation(LOCATION_GRAVE) then
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)==0 then return end
else
if Duel.Release(tc,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)==0 then return end
end
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
rc:CompleteProcedure()
end
end
function c101005072.thop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabelObject():GetLabelObject()
if not rc or rc:IsFacedown() or rc:GetFlagEffect(101005072)==0 then return end
Duel.SendtoHand(rc,nil,REASON_EFFECT)
end
--サイバネティック・オーバーフロー
--Cybernetic Overflow
--Scripted by Eerie Code
function c101005073.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005073)
e1:SetTarget(c101005073.target)
e1:SetOperation(c101005073.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101005073+100)
e2:SetCondition(c101005073.thcon)
e2:SetTarget(c101005073.thtg)
e2:SetOperation(c101005073.thop)
c:RegisterEffect(e2)
end
function c101005073.rmfilter(c)
return (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsCode(70095154) and c:IsLevelAbove(1) and c:IsAbleToRemove()
end
function c101005073.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005073.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD)
end
function c101005073.rescon(sg,e,tp,mg)
return sg:GetClassCount(Card.GetLevel)==sg:GetCount()
end
function c101005073.activate(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
local ct=dg:GetCount()
local g=Duel.GetMatchingGroup(c101005073.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil)
if ct==0 or g:GetCount()==0 then return end
local rg=Group.CreateGroup()
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
rg:Merge(sg)
g:Remove(Card.IsLevel,nil,sg:GetFirst():GetLevel())
ct=ct-1
until ct==0 or g:GetCount()==0 or not Duel.SelectYesNo(tp,aux.Stringid(101005073,0))
local rc=Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
if rc>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,rc,rc,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function c101005073.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(r,REASON_EFFECT)~=0
end
function c101005073.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and (c:IsSetCard(0x94) or c:IsSetCard(0x93)) and c:IsAbleToHand()
end
function c101005073.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005073.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005073.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005073.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
--ドラグニティ・ドライブ
--Dragunity Legion
--Scripted by Eerie Code
function c101005074.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,101005074)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c101005074.eftg)
e2:SetOperation(c101005074.efop)
c:RegisterEffect(e2)
end
function c101005074.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x29) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005074.eqfilter1(c,tp)
return c:IsFaceup() and c:IsSetCard(0x29) and Duel.IsExistingMatchingCard(c101005074.eqfilter2,tp,LOCATION_GRAVE,0,1,nil,c,tp)
end
function c101005074.eqfilter2(c,tc,tp)
return c:IsSetCard(0x29) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c101005074.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c101005074.spfilter(chkc,e,tp)
else return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005074.eqfilter1(chkc,tp) end
end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c101005074.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c101005074.eqfilter1,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(101005074,1),aux.Stringid(101005074,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(101005074,1))
else op=Duel.SelectOption(tp,aux.Stringid(101005074,2))+1 end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005074.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
else
e:SetCategory(CATEGORY_EQUIP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005074.eqfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
end
function c101005074.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if e:GetLabel()==0 then
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
else
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local ec=Duel.GetFirstTarget()
if ec:IsRelateToEffect(e) and ec:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101005074.eqfilter2),tp,LOCATION_GRAVE,0,1,1,nil,ec,tp)
local tc=g:GetFirst()
if not tc or not Duel.Equip(tp,tc,ec,true) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c101005074.eqlimit2)
e1:SetLabelObject(ec)
tc:RegisterEffect(e1)
end
end
local e1=Effect.CreateEffect(c)
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:SetLabelObject(e)
e1:SetTarget(c101005074.splimit)
Duel.RegisterEffect(e1,tp)
end
function c101005074.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x29)
end
function c101005074.eqlimit2(e,c)
return c==e:GetLabelObject()
end
--星遺物の交心
--World Legacy Communion
function c101005075.initial_effect(c)
--change effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005075,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,101005075)
e1:SetCondition(c101005075.cecondition)
e1:SetTarget(c101005075.cetarget)
e1:SetOperation(c101005075.ceoperation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005075,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101005075)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101005075.sptarget)
e2:SetOperation(c101005075.spoperation)
c:RegisterEffect(e2)
end
function c101005075.repop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.SelectMatchingCard(tp,c101005075.thfilter,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
function c101005075.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x104)
end
function c101005075.cecondition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(c101005075.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101005075.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c101005075.cetarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005075.thfilter,rp,0,LOCATION_MZONE,1,nil) end
end
function c101005075.ceoperation(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c101005075.repop)
end
function c101005075.spfilter1(c,e,tp)
local zone=bit.band(c:GetLinkedZone(tp),0x1f)
return c:IsFaceup() and c:IsType(TYPE_LINK) and zone>0 and Duel.IsExistingMatchingCard(c101005075.spfilter2,tp,0x13,0,1,c,e,tp,zone)
end
function c101005075.spfilter2(c,e,tp,zone)
return c:IsSetCard(0x104) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,tp,zone)
end
function c101005075.sptarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c101005075.spfilter1(chkc,e,tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(c101005075.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101005075.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x13)
end
function c101005075.spoperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
local zone=bit.band(tc:GetLinkedZone(tp),0x1f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101005075.spfilter2),tp,0x13,0,1,1,c,e,tp,zone)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE,zone)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--メタファイズ・アセンション
--Metaphys Ascension
--Scripted by Eerie Code
function c101005076.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,101005076)
e1:SetCost(c101005076.cost)
e1:SetTarget(c101005076.target)
e1:SetOperation(c101005076.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101005076)
e2:SetTarget(c101005076.thtg)
e2:SetOperation(c101005076.thop)
c:RegisterEffect(e2)
end
function c101005076.cfilter(c)
return c:IsSetCard(0x105) and c:IsDiscardable()
end
function c101005076.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005076.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c101005076.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c101005076.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101005076.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x105) and c:IsAbleToRemove()
end
function c101005076.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(c101005076.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101005076,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
end
function c101005076.thfilter(c)
return c:IsSetCard(0x105) and not c:IsCode(101005076) and c:IsAbleToHand()
end
function c101005076.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005076.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005076.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005076.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
--弩弓部隊
--Ballista Squad
--Script by nekrozar
function c101005077.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetCost(c101005077.cost)
e1:SetTarget(c101005077.target)
e1:SetOperation(c101005077.activate)
c:RegisterEffect(e1)
end
function c101005077.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c101005077.desfilter(c,tc,ec)
return c:GetEquipTarget()~=tc and c~=ec
end
function c101005077.costfilter(c,ec)
return Duel.IsExistingTarget(c101005077.desfilter,tp,0,LOCATION_ONFIELD,1,c,c,ec)
end
function c101005077.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c101005077.costfilter,1,c,c)
else
return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,c)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroup(tp,c101005077.costfilter,1,1,c,c)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101005077.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--深すぎた墓穴
--Excessively Deep Grave
--Script by nekrozar
function c101005078.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(c101005078.target)
e1:SetOperation(c101005078.activate)
c:RegisterEffect(e1)
end
function c101005078.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005078.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c101005078.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101005078.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005078.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101005078.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local fid=c:GetFieldID()
tc:RegisterFlagEffect(101005078,RESET_EVENT+0x1fe0000,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c101005078.spcon)
e1:SetOperation(c101005078.spop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function c101005078.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c101005078.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc and tc:GetFlagEffectLabel(101005078)==e:GetLabel() then
Duel.Hint(HINT_CARD,0,101005078)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--単一化
--Standardization
--Scripted by Eerie Code
function c101005079.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c101005079.condition)
e1:SetTarget(c101005079.target)
e1:SetOperation(c101005079.activate)
c:RegisterEffect(e1)
end
function c101005079.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c101005079.filter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c101005079.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack())
end
function c101005079.filter2(c,atk)
return c:IsFaceup() and c:GetAttack()~=atk
end
function c101005079.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005079.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101005079.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101005079.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
end
function c101005079.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local atk=tc:GetAttack()
local g=Duel.GetMatchingGroup(c101005079.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc,atk)
for sc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
end
end
--ディーラーズ・チョイス
--Dealer’s Choice
--Script by nekrozar
function c101005080.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101005080.target)
e1:SetOperation(c101005080.activate)
c:RegisterEffect(e1)
end
function c101005080.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,PLAYER_ALL,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function c101005080.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetDecktopGroup(tp,1)
local g2=Duel.GetDecktopGroup(1-tp,1)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
local h1=Duel.Draw(tp,1,REASON_EFFECT)
local h2=Duel.Draw(1-tp,1,REASON_EFFECT)
if h1>0 or h2>0 then Duel.BreakEffect() end
if h1>0 then
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
end
if h2>0 then
Duel.ShuffleHand(1-tp)
Duel.DiscardHand(1-tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
--ヴァレル・リロード
--Borrel Regenerator
function c101005100.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005100)
e1:SetTarget(c101005100.target)
e1:SetOperation(c101005100.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(c101005100.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c101005100.rmop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101005100,1))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,101005152)
e4:SetCondition(c101005100.drcon)
e4:SetTarget(c101005100.drtg)
e4:SetOperation(c101005100.drop)
c:RegisterEffect(e4)
end
function c101005100.spfilter(c,e,tp)
return c:IsSetCard(0x102) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005100.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101005100.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101005100.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005100.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 c101005100.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)
and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
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(c101005100.eqlimit)
c:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
end
function c101005100.eqlimit(e,c)
return e:GetOwner()==c
end
function c101005100.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c101005100.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if c:IsReason(REASON_DESTROY) and tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c101005100.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_DESTROY)
end
function c101005100.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101005100.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
--孤毒の剣
--Sword of Toxic Solitude
--Scripted by Eerie Code
function c101005101.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
c:SetUniqueOnField(1,0,101005101)
--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:SetTarget(c101005101.target)
e1:SetOperation(c101005101.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(c101005101.eqlimit)
c:RegisterEffect(e2)
--self destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_SELF_TOGRAVE)
e3:SetCondition(c101005101.sdcon)
c:RegisterEffect(e3)
--double atk/def
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetCondition(c101005101.adcon)
e4:SetValue(c101005101.atkval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(c101005101.defval)
c:RegisterEffect(e5)
end
function c101005101.eqlimit(e,c)
return c:IsControler(e:GetHandlerPlayer())
end
function c101005101.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101005101.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c101005101.sdcon(e)
local tc=e:GetHandler():GetEquipTarget()
return tc and Duel.IsExistingMatchingCard(nil,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,tc)
end
function c101005101.adcon(e)
if Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL then return false end
local eqc=e:GetHandler():GetEquipTarget()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d and (a==eqc or d==eqc)
end
function c101005101.atkval(e,c)
return c:GetBaseAttack()*2
end
function c101005101.defval(e,c)
return c:GetBaseDefense()*2
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