Commit 568e59b8 authored by Tachibana's avatar Tachibana

得得得得得

parent 7c4d5e14
Pipeline #13054 passed with stage
in 11 minutes and 34 seconds
......@@ -4,8 +4,8 @@ stages:
variables:
GIT_DEPTH: "1"
LAST_UPDATE_DATE: "2022.4.26"
CURRENT_UPDATE_DATE: "2022.5.8"
LAST_UPDATE_DATE: "2022.5.9"
CURRENT_UPDATE_DATE: "2022.5.22"
redtext:
stage: prepare
......
No preview for this file type
--Chronicle Utilities
--by wyykak
local cc=13959970
local this=_G["c"..cc]
c13959997={}
Duel.LoadScript("c13959997.lua")
local tpu=c13959997
function this.error(deckname,card,reason)
Debug.Message(string.format("卡组%s中的卡片%d非法:%s",deckname,card,reason))
end
function this.loadDeck(fname,strict)
local result={}
local mct=0
local ect=0
local at={}
local f=io.open(fname,"r")
if not f then
this.error(fname,-1,"卡组文件不存在")
return
end
for l in f:lines() do
if l:sub(1,1)=="!" then
break
end
if l:sub(1,1)~="#" and tonumber(l) then
local tcc=math.floor(tonumber(l))
if tcc<10000 or tcc>99999999 then
this.error(fname,tcc,"卡号范围非法")
if strict then f:close() return end
elseif not Duel.ReadCard(tcc,CARDDATA_TYPE) then
this.error(fname,tcc,"卡片不存在")
if strict then f:close() return end
elseif Duel.ReadCard(tcc,CARDDATA_TYPE)&TYPE_TOKEN~=0 then
this.error(fname,tcc,"卡片是衍生物")
if strict then f:close() return end
else
if not result[tcc] then
result[tcc]=0
end
result[tcc]=result[tcc]+1
if Duel.ReadCard(tcc,CARDDATA_TYPE)&(TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK)~=0 then
ect=ect+1
else
mct=mct+1
end
local ca=Duel.ReadCard(tcc,CARDDATA_ALIAS)
local real=0
if ca==0 then
real=tcc
else
real=ca
end
if not at[real] then
at[real]=0
end
at[real]=at[real]+1
if at[real]>3 then
this.error(fname,real,"同名卡超过3张")
if strict then f:close() return end
end
end
end
end
if mct>60 or mct<40 then
this.error(fname,-1,"主卡组数量错误")
if strict then f:close() return end
end
if ect>15 then
this.error(fname,-1,"额外卡组数量错误")
if strict then f:close() return end
end
f:close()
return result,mct,ect
end
function this.loadNumSeq(s)
local result={}
for i=1,#s do
result[#result+1]=tonumber(s:sub(i,i))
end
return result
end
function this.loadDeckList(dlCode)
if not _G["c"..dlCode] then
_G["c"..dlCode]={}
Duel.LoadScript("c"..dlCode..".lua")
end
local dl=_G["c"..dlCode].deckList
local decks={}
for i=1,#dl//2 do
local cardList=tpu.toList(tpu.loadSet(dl[2*i-1]))
local numList=this.loadNumSeq(dl[2*i])
local deck={}
for j=1,#cardList do
deck[cardList[j]]=numList[j]
end
decks[#decks+1]=deck
end
return decks
end
\ No newline at end of file
This diff is collapsed.
--Design/Image/Script: wyykak
local cc=13959973
local this=_G["c"..cc]
this.dlCode=13959972
c13959970={}
Duel.LoadScript("c13959970.lua")
local cnu=c13959970
function this.initial_effect(c)
if not this.gc then
this.gc=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START|PHASE_DRAW)
e1:SetCondition(this.con)
e1:SetOperation(this.op)
Duel.RegisterEffect(e1,0)
local es1=Effect.CreateEffect(c)
es1:SetType(EFFECT_TYPE_FIELD)
es1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
es1:SetCode(EFFECT_SKIP_DP)
es1:SetTargetRange(1,1)
es1:SetCondition(this.con1)
Duel.RegisterEffect(es1,0)
local es2=es1:Clone()
es2:SetCode(EFFECT_SKIP_SP)
es2:SetCondition(this.con2)
Duel.RegisterEffect(es2,0)
local es3=es2:Clone()
es3:SetCode(EFFECT_SKIP_M1)
Duel.RegisterEffect(es3,0)
local es6=es1:Clone()
es6:SetCode(EFFECT_CANNOT_BP)
es6:SetCondition(this.con3)
Duel.RegisterEffect(es6,0)
local es7=es2:Clone()
es7:SetCode(EFFECT_CANNOT_ACTIVATE)
es7:SetValue(aux.TRUE)
Duel.RegisterEffect(es7,0)
local es8=Effect.CreateEffect(c)
es8:SetType(EFFECT_TYPE_FIELD)
es8:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_IGNORE_RANGE)
es8:SetTargetRange(0xff,0xff)
es8:SetCode(EFFECT_DISABLE)
es8:SetCondition(this.con4)
Duel.RegisterEffect(es8,0)
local es9=es7:Clone()
es9:SetCondition(this.con5)
Duel.RegisterEffect(es9,0)
Duel.RegisterFlagEffect(0,cc,0,0,1)
Duel.RegisterFlagEffect(1,cc,0,0,1)
local es10=es1:Clone()
es10:SetCode(EFFECT_DRAW_COUNT)
es10:SetValue(0)
es10:SetCondition(this.con6)
Duel.RegisterEffect(es10,0)
end
end
function this.con6()
return this.isTag and Duel.GetTurnCount()==3
end
function this.con1()
return this.isTag and ({false,true,false,true,true})[Duel.GetTurnCount()]
end
function this.con2()
return this.isTag and ({true,true,true,true})[Duel.GetTurnCount()]
end
function this.con3()
return this.isTag and ({true,true,true,true,true})[Duel.GetTurnCount()]
end
function this.con4()
return this.isPicking
end
function this.con5()
return Duel.GetCurrentPhase()==PHASE_DRAW and (Duel.GetTurnCount()==1 or (this.isTag and Duel.GetTurnCount()==3))
end
function this.con()
return Duel.GetTurnCount()==1 or (this.isTag and Duel.GetTurnCount()==3)
end
function this.seed3()
local result=0
local g=Duel.GetFieldGroup(0,0xff,0xff):RandomSelect(0,8)
local ct={}
local c=g:GetFirst()
for i=0,7 do
ct[c]=i
c=g:GetNext()
end
for i=0,10 do
result=result+(ct[g:RandomSelect(0,1):GetFirst()]<<(3*i))
end
g:DeleteGroup()
return result&0xffffffff
end
function this.op(e,tp)
this.isPicking=true
if Duel.GetTurnCount()==1 then
math.randomseed(this.seed3())
end
Duel.Exile(Duel.GetFieldGroup(0,LOCATION_DECK|LOCATION_EXTRA|LOCATION_HAND,LOCATION_DECK|LOCATION_EXTRA|LOCATION_HAND),REASON_RULE)
this.isTag=Duel.SelectYesNo(0,aux.Stringid(13959998,8))
this.chronicle()
Duel.ConfirmCards(0,Duel.GetFieldGroup(0,LOCATION_DECK,0))
Duel.ConfirmCards(1,Duel.GetFieldGroup(1,LOCATION_DECK,0))
Duel.SelectMatchingCard(0,nil,0,LOCATION_EXTRA,0,0,99,nil)
Duel.SelectMatchingCard(1,nil,1,LOCATION_EXTRA,0,0,99,nil)
Duel.ShuffleDeck(0)
Duel.ShuffleDeck(1)
Duel.ShuffleExtra(0)
Duel.ShuffleExtra(1)
if not this.isTag or Duel.GetTurnCount()==5 then
this.isPicking=false
end
Duel.Draw(0,5,REASON_RULE)
Duel.Draw(1,5,REASON_RULE)
this.isPicking=false
Duel.ResetTimeLimit(0)
Duel.ResetTimeLimit(1)
end
function this.chronicle()
if not this.deckList then
this.deckList=cnu.loadDeckList(this.dlCode)
end
for tp=0,1 do
local deck=this.deckList[math.random(1,#this.deckList)]
local g=Group.CreateGroup()
for code,num in pairs(deck) do
for i=1,num do
g:AddCard(Duel.CreateToken(tp,code))
end
end
Duel.SelectYesNo(tp,aux.Stringid(cc,math.random(0,4)))
Duel.SendtoDeck(g,tp,0,REASON_RULE)
g:DeleteGroup()
Duel.SelectYesNo(tp,aux.Stringid(cc,math.random(0,4)))
end
end
\ No newline at end of file
--戈耳工的试炼
local m=17061450
local cm=_G["c"..m]
function cm.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,17061450+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsRace(RACE_REPTILE) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_REPTILE) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--十天众的总领者 古兰
local m=17061660
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,2)
--atk update
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.atkval)
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:SetCondition(cm.econ)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
--multiatk
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17061660,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.atkcon)
e3:SetCost(cm.atkcost)
e3:SetTarget(cm.atktg)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(17061660,1))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
end
function cm.matfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA
end
function cm.atkval(e,c)
return math.abs(Duel.GetLP(0)-Duel.GetLP(1))
end
function cm.econ(e)
local tp=e:GetHandler():GetControler()
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK)==0 end
end
function cm.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)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK)
and (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT)))
end
function cm.filter(c,e,tp)
return c:IsCode(17061670) and c:IsCanBeSpecialSummoned(e,0,tp,false,true) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetFirstMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tg then
Duel.SpecialSummon(tg,0,tp,tp,false,true,POS_FACEUP)
end
end
--十天众的总领者 姬塔
local m=17061670
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x37f6),2)
c:EnableReviveLimit()
--change damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17061670,0))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.discon)
e3:SetTarget(cm.distg)
e3:SetOperation(cm.disop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(17061670,1))
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--change damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.spfilter(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local zone=e:GetHandler():GetLinkedZone(tp)
return zone~=0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,zone)
end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,nil,e,tp,zone)
if g:GetCount()>0 and zone>0 and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re)
and Duel.Destroy(eg,REASON_EFFECT)>0 then
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,zone)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK)
and (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT)))
end
function cm.filter(c,e,tp)
return c:IsCode(17061660) and c:IsCanBeSpecialSummoned(e,0,tp,false,true) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetFirstMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tg then
Duel.SpecialSummon(tg,0,tp,tp,false,true,POS_FACEUP)
end
end
......@@ -52,7 +52,7 @@ function c33200018.initial_effect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,33200019)
e4:SetCountLimit(1,33220019)
e4:SetCondition(c33200018.tpcon)
e4:SetTarget(c33200018.tptg)
e4:SetOperation(c33200018.tpop)
......
......@@ -41,7 +41,9 @@ function c33200263.thfilter(c)
return c:IsSetCard(0x326) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c33200263.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33200263.thfilter,tp,LOCATION_DECK,0,3,nil) end
if chk==0 then
local g=Duel.GetMatchingGroup(c33200263.thfilter,tp,LOCATION_DECK,0,nil)
return g:GetClassCount(Card.GetCode)>2 and Duel.IsExistingMatchingCard(c33200263.thfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c33200263.thop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -2,118 +2,119 @@
local m=60151902
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,60151902)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),5,2,c60151902.ovfilter,aux.Stringid(60151902,0),2,c60151902.xyzop)
c:EnableReviveLimit()
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c60151902.e1tg)
c:RegisterEffect(e1)
--pendulum set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60151902,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c60151902.e2tg)
e2:SetOperation(c60151902.e2op)
c:RegisterEffect(e2)
--SEARCH
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60151902,3))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c60151902.e3tg)
e3:SetOperation(c60151902.e3op)
c:RegisterEffect(e3)
if not c60151902.global_check then
c60151902.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c60151902.checkop)
Duel.RegisterEffect(ge1,0)
end
c:SetUniqueOnField(1,0,60151902)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),5,2,c60151902.ovfilter,aux.Stringid(60151902,0),2,c60151902.xyzop)
c:EnableReviveLimit()
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c60151902.e1tg)
c:RegisterEffect(e1)
--pendulum set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60151902,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c60151902.e2tg)
e2:SetOperation(c60151902.e2op)
c:RegisterEffect(e2)
--SEARCH
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60151902,3))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c60151902.e3tg)
e3:SetOperation(c60151902.e3op)
c:RegisterEffect(e3)
if not c60151902.global_check then
c60151902.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c60151902.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c60151902.ovfilter(c)
return c:IsFaceup() and c:IsCode(60151901)
return c:IsFaceup() and c:IsCode(60151901)
end
function c60151902.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,60151902)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c60151902.sumlimit)
Duel.RegisterEffect(e1,tp)
if chk==0 then return Duel.GetFlagEffect(tp,60151902)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c60151902.sumlimit)
Duel.RegisterEffect(e1,tp)
end
function c60151902.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsCode(60151902)
return c:IsLocation(LOCATION_EXTRA) and not c:IsCode(60151902)
end
function c60151902.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if not tc:IsCode(60151902) and tc:GetSummonLocation()==LOCATION_EXTRA then
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60151902,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,60151902,RESET_PHASE+PHASE_END,0,1) end
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if not tc:IsCode(60151902) and tc:GetSummonLocation()==LOCATION_EXTRA then
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60151902,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,60151902,RESET_PHASE+PHASE_END,0,1) end
end
function c60151902.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
local tp=e:GetHandlerPlayer()
local c=e:GetHandler()
local dam=Duel.GetBattleDamage(tp)
if chk==0 then return c:IsFaceup() and c:IsReason(REASON_BATTLE) and c:IsAttackPos()
and not c:IsReason(REASON_REPLACE) end
if dam>=0 then
Duel.Hint(HINT_CARD,0,60151902)
Duel.SetLP(tp,Duel.GetLP(tp)-dam)
return true
else return false end
local tp=e:GetHandlerPlayer()
local c=e:GetHandler()
local dam=Duel.GetBattleDamage(tp)
if chk==0 then return c:IsFaceup() and c:IsReason(REASON_BATTLE) and c:IsAttackPos()
and not c:IsReason(REASON_REPLACE) end
if dam>=0 then
Duel.Hint(HINT_CARD,0,60151902)
Duel.SetLP(tp,Duel.GetLP(tp)-dam)
return true
else return false end
end
function c60151902.rpfilter(c)
return c:IsSetCard(0xab26) and not c:IsForbidden()
return c:IsSetCard(0xab26) and not c:IsForbidden()
end
function c60151902.e2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and Duel.IsExistingMatchingCard(c60151902.rpfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and Duel.IsExistingMatchingCard(c60151902.rpfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c60151902.e2op(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(60151902,2))
local g=Duel.SelectMatchingCard(tp,c60151902.rpfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.SetLP(tp,Duel.GetLP(tp)-500)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c60151902.rpfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
Duel.SetLP(tp,Duel.GetLP(tp)-500)
end
end
function c60151902.thfilter(c)
return (c:IsSetCard(0x6b26) or c:IsSetCard(0x9b26)) and c:IsAbleToHand()
return (c:IsSetCard(0x6b26) or c:IsSetCard(0x9b26)) and c:IsAbleToHand()
end
function c60151902.e3tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60151902.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if chk==0 then return Duel.IsExistingMatchingCard(c60151902.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c60151902.e3op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60151902.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.SetLP(tp,Duel.GetLP(tp)-1000)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60151902.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.SetLP(tp,Duel.GetLP(tp)-1000)
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