Commit 262a0ac5 authored by mercury233's avatar mercury233

update scripts

parent fec749fc
......@@ -20,6 +20,7 @@ function c100200145.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100200145+100)
e2:SetCost(c100200145.spcost)
e2:SetTarget(c100200145.sptg2)
e2:SetOperation(c100200145.spop2)
......@@ -41,7 +42,7 @@ function c100200145.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -41,10 +41,11 @@ function c100200146.tgfilter(c,lv)
end
function c100200146.lvop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100200146.tgfilter,tp,LOCATION_DECK,0,1,1,nil,c:GetLevel())
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE)
and c:IsFaceup() and c:IsRelateToEffect(e) then
and c:IsFaceup() then
local lv=g:GetFirst():GetLevel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
--ゴッド・オーガス
--Orgoth the Relentless
function c100227001.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227001,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c100227001.target)
e1:SetOperation(c100227001.operation)
c:RegisterEffect(e1)
end
function c100227001.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,3)
end
function c100227001.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d1,d2,d3=Duel.TossDice(tp,3)
local atk=(d1+d2+d3)*100
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
if d1==d2 and d2==d3 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
Duel.Draw(tp,2,REASON_EFFECT)
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DIRECT_ATTACK)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
elseif d1==d2==1 or d2==d3==1 or d1==d3==1 or d1==d2==2 or d2==d3==2 or d1==d3==2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
elseif d1==d2==3 or d2==d3==3 or d1==d3==3 or d1==d2==4 or d2==d3==4 or d1==d3==4 then
Duel.Draw(tp,2,REASON_EFFECT)
elseif d1==d2==5 or d2==d3==5 or d1==d3==5 or d1==d2==5 or d2==d3==6 or d1==d3==6 then
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--時械神 サンダイオン
--Sandaion the Timelord
function c100227025.initial_effect(c)
c:SetUniqueOnField(1,0,100227025)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetRange(LOCATION_DECK)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227025,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c100227025.spcon)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e4)
--damage val
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e5:SetValue(1)
c:RegisterEffect(e5)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e8:SetValue(1)
c:RegisterEffect(e8)
--LP
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_PHASE+PHASE_BATTLE)
e6:SetCountLimit(1)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c100227025.damcon)
e6:SetTarget(c100227025.damtg)
e6:SetOperation(c100227025.damop)
c:RegisterEffect(e6)
--to deck
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(100227025,1))
e7:SetCategory(CATEGORY_TODECK)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e7:SetCode(EVENT_PHASE+PHASE_STANDBY)
e7:SetProperty(EFFECT_FLAG_REPEAT)
e7:SetCountLimit(1)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(c100227025.tdcon)
e7:SetTarget(c100227025.tdtg)
e7:SetOperation(c100227025.tdop)
c:RegisterEffect(e7)
end
function c100227025.spcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)>0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c100227025.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0 or e:GetHandler():GetAttackedCount()>0
end
function c100227025.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
end
function c100227025.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c100227025.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100227025.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c100227025.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsAbleToDeck() then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
--No.90 銀河眼の光子卿
--Number 90:Galaxy-Eyes Photon Lord
function c100227033.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c100227033.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--negate activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227033,0))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100227033)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c100227033.negcon)
e2:SetCost(c100227033.negcost)
e2:SetTarget(c100227033.negtg)
e2:SetOperation(c100227033.negop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetDescription(aux.Stringid(100227033,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,100227033+100)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100227033.condition)
e3:SetTarget(c100227033.target)
e3:SetOperation(c100227033.operation)
c:RegisterEffect(e3,false,1)
end
c100227033.xyz_number=90
function c100227033.indcon(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,0x55)
end
function c100227033.negcon(e,tp,eg,ep,ev,re,r,rp,chk)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function c100227033.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local ct=Duel.GetOperatedGroup():GetFirst()
e:SetLabelObject(ct)
end
function c100227033.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c100227033.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and e:GetLabelObject():IsSetCard(0x7b) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c100227033.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return Duel.GetTurnPlayer()~=tp
end
function c100227033.filter(c)
return c:IsSetCard(0x55) or c:IsSetCard(0x7b)
end
function c100227033.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100227033.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c100227033.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,c100227033.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and (tc:IsAbleToHand() and Duel.SelectYesNo(tp,aux.Stringid(100227033,2))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.Overlay(c,Group.FromCards(tc))
end
end
--トポロジック・ガンブラー・ドラゴン
--Topologic Gamble Dragon
function c100227043.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
c:EnableReviveLimit()
--discard
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227043,0))
e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100227043)
e1:SetCondition(c100227043.hdcon)
e1:SetTarget(c100227043.hdtg)
e1:SetOperation(c100227043.hdop)
c:RegisterEffect(e1)
--discard
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227043,1))
e2:SetCategory(CATEGORY_HANDES+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100227043)
e2:SetCondition(c100227043.hdcon2)
e2:SetTarget(c100227043.hdtg2)
e2:SetOperation(c100227043.hdop2)
c:RegisterEffect(e2)
if not Card.IsExtraLinked then
function Duel.GetExtraLinkedGroup(tp)
local card1=Duel.GetFieldCard(tp,LOCATION_MZONE,1)
local card2=Duel.GetFieldCard(tp,LOCATION_MZONE,2)
local card3=Duel.GetFieldCard(tp,LOCATION_MZONE,3)
local card5=Duel.GetFieldCard(tp,LOCATION_MZONE,5)
local card6=Duel.GetFieldCard(tp,LOCATION_MZONE,6)
if not card1 or not card2 or not card3 or not card5 or not card6 then return nil end
if bit.band(card1:GetMutualLinkedZone(),0x24)~=0x24 then return nil end
if bit.band(card2:GetMutualLinkedZone(),0xa)~=0xa then return nil end
if bit.band(card3:GetMutualLinkedZone(),0x44)~=0x44 then return nil end
if bit.band(card5:GetMutualLinkedZone(),0x2)~=0x2 then return nil end
if bit.band(card6:GetMutualLinkedZone(),0x8)~=0x8 then return nil end
local elg=Group:FromCards(card1,card2,card3,card5,card6)
local card0=Duel.GetFieldCard(tp,LOCATION_MZONE,0)
local card4=Duel.GetFieldCard(tp,LOCATION_MZONE,4)
if card0 and bit.band(card0:GetMutualLinkedZone(),0x2)==0x2 then elg:AddCard(card0) end
if card4 and bit.band(card4:GetMutualLinkedZone(),0x8)==0x8 then elg:AddCard(card4) end
return elg
end
function Card.IsExtraLinked(c)
local elg=Duel.GetExtraLinkedGroup(c:GetControler())
return elg and elg:IsContains(c)
end
end
end
function c100227043.cfilter(c,zone)
local seq=c:GetSequence()
if c:IsControler(1) then seq=seq+16 end
return bit.extract(zone,seq)~=0
end
function c100227043.hdcon(e,tp,eg,ep,ev,re,r,rp)
local zone=Duel.GetLinkedZone(0)+Duel.GetLinkedZone(1)*0x10000
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100227043.cfilter,1,nil,zone)
end
function c100227043.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
function c100227043.hdop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=math.min(hg:GetCount(),2)
if ct<=0 then return false end
ct=Duel.AnnounceNumber(tp,1,2)
local g=hg:RandomSelect(tp,ct)
local ct2=Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
Duel.DiscardHand(1-tp,nil,ct2,ct2,REASON_EFFECT+REASON_DISCARD)
end
function c100227043.hdcon2(e)
return e:GetHandler():IsExtraLinked()
end
function c100227043.hdtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,2)
end
function c100227043.hdop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(1-tp,nil,2,2,REASON_EFFECT+REASON_DISCARD)~=0
and Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)==0 then
Duel.Damage(1-tp,3000,REASON_EFFECT)
end
end
--オッドアイズ・ファンタズマ・ドラゴン
--Odd-Eyes Phantasma Dragon
--scripted by Naim
function c100228001.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100228001,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,100228001)
e1:SetCost(c100228001.thcost)
e1:SetTarget(c100228001.thtg)
e1:SetOperation(c100228001.thop)
c:RegisterEffect(e1)
--special summon from hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100228001,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,100228001+100)
e2:SetCondition(c100228001.spcon)
e2:SetCost(c100228001.spcost)
e2:SetTarget(c100228001.sptg)
e2:SetOperation(c100228001.spop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100228001,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100228001+200)
e3:SetCondition(c100228001.atkcon)
e3:SetOperation(c100228001.atkop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(100228001,ACTIVITY_SPSUMMON,c100228001.counterfilter)
end
function c100228001.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100228001.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100228001.thfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAbleToHand()
end
function c100228001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100228001.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function c100228001.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,c100228001.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100228001.exfilter(c)
return c:IsFaceup() and c:IsSetCard(0x99) and c:IsType(TYPE_PENDULUM)
end
function c100228001.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100228001,tp,ACTIVITY_SPSUMMON)==0 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:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c100228001.splimit)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c100228001.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c100228001.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldCard(tp,LOCATION_PZONE,0) and Duel.GetFieldCard(tp,LOCATION_PZONE,1)
and Duel.IsExistingMatchingCard(c100228001.exfilter,tp,LOCATION_EXTRA,0,1,nil)
end
function c100228001.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 c100228001.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
function c100228001.atkfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsFaceup()
end
function c100228001.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=c:GetBattleTarget()
local gc=Duel.GetMatchingGroupCount(c100228001.atkfilter,tp,LOCATION_EXTRA,0,nil)
return c==Duel.GetAttacker() and d and d:IsFaceup() and not d:IsControler(tp) and gc>0
end
function c100228001.atkop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttacker():GetBattleTarget()
local gc=Duel.GetMatchingGroupCount(c100228001.atkfilter,tp,LOCATION_EXTRA,0,nil)
if d:IsRelateToBattle() and d:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(-gc*1000)
d:RegisterEffect(e1)
end
end
--デーモンの降臨
--Advent Skull Archfiend
--Scripted by Eerie Code
function c100242101.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)
e1:SetValue(70781052)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100242101.indval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(c100242101.indeval)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCondition(c100242101.spcon)
e4:SetTarget(c100242101.sptg)
e4:SetOperation(c100242101.spop)
c:RegisterEffect(e4)
end
function c100242101.indval(e,c)
return not c:IsType(TYPE_RITUAL)
end
function c100242101.indeval(e,re,rp)
return re:IsActiveType(TYPE_MONSTER) and not re:IsActiveType(TYPE_RITUAL)
end
function c100242101.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL)
and rp~=tp and c:GetPreviousControler()==tp
end
function c100242101.spfilter(c,e,tp)
return c:IsCode(70781052) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
function c100242101.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
return Duel.IsExistingMatchingCard(c100242101.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c100242101.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 tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100242101.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP)
end
end
--テクスチェンジャー
--Texchangure
--Scripted by Eerie Code
function c100318002.initial_effect(c)
--negate attack
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100318002.condition)
e1:SetTarget(c100318002.target)
e1:SetOperation(c100318002.operation)
c:RegisterEffect(e1)
end
function c100318002.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget() and Duel.GetAttackTarget():IsControler(tp)
end
function c100318002.filter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100318002.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100318002.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c100318002.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateAttack() or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100318002.filter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--サイバネット・リグレッション
--Cynet Regression
--Scripted by Eerie Code
function c100318033.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100318033+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100318033.condition)
e1:SetTarget(c100318033.target)
e1:SetOperation(c100318033.activate)
c:RegisterEffect(e1)
end
function c100318033.cfilter(c,tp)
return c:IsType(TYPE_LINK) and c:GetSummonPlayer()==tp
end
function c100318033.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100318033.cfilter,1,nil,tp)
end
function c100318033.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100318033.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......@@ -63,7 +63,7 @@ function c100318041.filter(c,e,tp,zone)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c100318041.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=e:GetHandler():GetLinkedZone(tp)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100318041.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100318041.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
......@@ -73,7 +73,7 @@ function c100318041.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c100318041.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local zone=e:GetHandler():GetLinkedZone(tp)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if tc:IsRelateToEffect(e) and zone~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
......
--SIMM Dublas
--scripted by Naim
function c101005001.initial_effect(c)
--return
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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)
local c=e:GetHandler()
if chk==0 then return not c: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
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() 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.GetLocationCount(tp,LOCATION_MZONE)>0
and 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
local i=0
local ctn=true
while ct>0 and ctn do
local token=Duel.CreateToken(tp,101005002+100)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
ct=ct-1
if ct<=0 or not Duel.SelectYesNo(tp,aux.Stringid(101005002,0)) then ctn=false end
end
Duel.SpecialSummonComplete()
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,e:GetHandler(),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,e:GetHandler(),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
\ No newline at end of file
--魔神儀-タリスマンドラ
--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,e:GetHandler(),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,e:GetHandler(),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
\ No newline at end of file
--ドラグニティ-クーゼ
--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
--サイバース・マジシャン
--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:SetDescription(aux.Stringid(101005026,0))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
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,1))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
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 and Duel.IsPlayerAffectedByEffect(e:GetLabel(),92481084) 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_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 chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_DECK) and c101005026.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005026.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101005026.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101005026.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--破滅の天使ルイン
--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_DAMAGE_STEP+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)
local c=e:GetHandler()
return Duel.IsAbleToEnterBP() and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101005027.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
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 c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
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+0x1ff0000)
Duel.RegisterEffect(e1,tp)
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:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
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_DAMAGE_STEP+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)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101005028.filter(c)
return c:IsFaceup()
end
function c101005028.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c101005028.filter,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,c101005028.filter,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()
if not c:IsRelateToEffect(e) then return end
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:SetOperation(c101005028.actop)
e1:SetReset(RESET_EVENT+0x1fe0000)
Duel.RegisterEffect(e1,tp)
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)
local c=e:GetHandler()
return c: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)
--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)
local c=e:GetHandler()
return c: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.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=c:GetMaterial()
local res=c:GetSummonType()==SUMMON_TYPE_RITUAL and not mg:IsExists(c101005030.mfilter,1,nil)
if chk==0 then return res or Duel.CheckLPCost(tp,2000) end
if not res then
Duel.PayLPCost(tp,2000)
end
end
function c101005030.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true 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
--ドラグニティナイト-アスカロン`
--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) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,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
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO)
return pg:GetCount()<=0 and Duel.GetLocationCountFromEx(tp)>0
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)
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_SYNCHRO)
if Duel.GetLocationCountFromEx(tp)<=0 or pg:GetCount()>0 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
\ No newline at end of file
--サイバース・ウィッチ
--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: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(aux.NecroValleyFilter(c101005035.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(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:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c101005036.ls)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005036,0))
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.ls(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:GetLink()>=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)
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) 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
--サイバー・ドラゴン・ズィーガー
--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_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
--サイバネット・リチューアル
--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() and aux.SpElimFilter(c,true)
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
--エンドレス・オブ・ザ・ワールド
--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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c101005056.thcon)
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.thcon(e,tp,eg,ep,ev,re,r,rp)
return aux.exccon(e)
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)
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.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
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
--星遺物の機憶
--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
--ミラーフォース・ランチャー
--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
--リターン・オブ・ザ・ワールド
--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 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)
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
--メタファイズ・アセンション
--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
--単一化
--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:SetTarget(c101005079.target)
e1:SetOperation(c101005079.activate)
c:RegisterEffect(e1)
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 c: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
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