Commit ff44ee64 authored by Huangnan's avatar Huangnan

delete cards

parent 2731db51
Pipeline #36461 passed with stage
in 7 minutes and 5 seconds
......@@ -5,8 +5,8 @@ stages:
variables:
GIT_DEPTH: "1"
LAST_UPDATE_DATE: "2025.4.13"
CURRENT_UPDATE_DATE: "2025.4.13"
LAST_UPDATE_DATE: "2025.5.18"
CURRENT_UPDATE_DATE: "2025.5.18"
redtext:
stage: check
......
#created by ...
#main
5012619
5012682
5012683
5012685
10221043
10221091
10221101
11600052
11600053
11600054
11600055
11600056
11600058
11600061
11600066
11600074
11600076
11600080
11600091
11600092
11600093
11600094
11600095
11600096
12400136
12400140
12835116
12835117
12835119
16104403
16110018
16300080
16348099
16349061
16349063
16400225
16400230
16400235
16400240
16400245
16400250
16400255
16400260
16400265
#extra
5012612
5012627
5012636
5012684
10220075
10221035
10221045
11600051
11600062
11600063
11600064
11600065
11600067
11600068
11600070
!side
11600073
11600075
16300005
16310045
16310050
16310055
16310056
16348160
16349310
16369101
16369102
16369103
16400270
16400275
16400280
#created by ...
#main
16400285
16400290
16400295
16400300
16400305
16400395
16400490
16401195
16401200
16401205
16401210
16401215
16401220
16401225
16401230
18030501
18030502
18030503
18030504
18030511
18030601
18030609
18700785
18700968
18700971
18700974
18700977
18700980
18700983
18700986
18701004
18701013
18701016
20000450
20000451
20000452
20000453
20000454
20000455
20000456
20000457
20000458
20000459
20000460
#extra
16400340
16401170
16401175
16401180
16401185
16401190
16401235
16401240
18030505
18030506
18030507
18030508
18030509
18030510
18030602
!side
18030603
18030604
18030605
18030606
18030607
18030608
18700965
18700989
18700992
18700995
18700998
18701001
18701006
18701019
20000461
#created by ...
#main
20000462
20000463
20000464
20000465
22134500
22134505
22134510
22134515
23410101
23410102
23410103
23410105
23410107
23410108
30700036
31750081
31750101
31750133
31750157
31750173
31750177
33201555
33201556
33201557
33401001
33401002
33401003
33401004
33401005
33401052
33401054
33401055
33401057
33401058
33401302
33401303
33401402
33401403
33401404
33401405
33401406
33401407
33401408
33401409
#extra
23410104
23410106
23410109
30700058
31750153
31750165
33201550
33401006
33401007
33401008
33401009
33401010
33401035
33401401
33401410
!side
33401411
37000031
37200001
37200004
37200008
37200010
37200013
37200016
37200019
37200022
37200025
37200027
37200030
37200033
37200036
#created by ...
#main
37200101
37900726
47370212
47370213
47370217
47370601
47370602
47370603
47370604
47370609
47370610
47370611
47370612
47370613
47370614
52301030
52301035
52301040
52301045
52301050
52301055
52301060
52301065
52301075
52310001
52310002
52310003
52310004
52310005
52310006
52310007
52310009
52310010
52310011
52310012
52310013
52310014
52310015
52310016
52320001
52320002
52320003
52320004
52320005
#extra
47370214
47370215
47370216
47370605
47370606
47370607
47370608
52301080
52301085
52310008
52320008
52700740
72001025
72001030
75027012
!side
52320006
52320007
52320009
52320010
52320011
52320012
52700739
52700745
52700746
52798055
60010271
60010277
72001000
72001005
72001010
#created by ...
#main
72001015
72001020
72001035
72001040
72001045
72001050
75027001
75027002
75027004
75027006
75027008
75027010
75027018
75027019
75027020
75027023
75027025
75027027
75027029
75027031
75027036
75030001
75030002
75030003
75030008
75030009
75030010
75030011
75030020
75030023
75030024
75030028
75030031
75030033
75030035
75030040
75030042
75030047
75030049
75030052
75030054
75030055
79100750
79100760
#extra
75027014
75027016
75027033
75030004
75030005
75030012
75030022
75030025
75030026
75030029
75030030
75030037
75030043
75030050
79100620
!side
79100770
79100780
79100790
79100800
79100810
79100820
79101000
79101010
79101020
81901013
81902043
81902081
81902115
81902130
81902602
#created by ...
#main
81903002
82000738
82000742
82000745
82000750
82000752
82000754
82000756
82000758
82000760
82000762
82000766
82000768
82000770
82000772
82000774
82000777
82000779
82000781
82000783
82000785
82000888
88800128
88800131
88800134
88800137
88800143
88800146
88800149
88800152
88800155
88800158
90104000
90104001
90104002
90104003
90104004
90104008
90104009
92600200
92600205
92600210
92600215
92600220
#extra
81903000
81907116
81907118
82000740
82000765
90104005
90104006
90104007
99601005
99601006
99601007
99601008
99601009
99601010
99601014
!side
92600225
92600230
92600235
92600240
92600245
92600250
93050040
98639502
99601000
99601001
99601002
99601003
99601004
99601011
99601012
#created by ...
#main
99601013
99603001
99603002
99603003
99603004
99603005
99603006
99603007
99603008
99603009
99603010
99603011
99603012
99603013
99603014
99603015
99603016
99603018
99603019
99603061
99603062
99603063
99603064
99603065
99603066
99603067
99603068
99603069
99603070
99603071
99603072
99603073
99603074
99603075
99603076
99603077
99603078
99603079
99603097
99603098
99603099
#extra
99601015
99601016
99603017
99603080
99603081
99603082
99603083
99603084
99603085
99603086
99603087
99603088
99603089
99603090
99603091
!side
99603092
99603093
99603094
99603095
99603096
99603100
No preview for this file type
--ALO 世界树
local m=10221012
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x5aa)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetCountLimit(1,10221012+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e0)
--Add counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_FZONE)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--cannot be Destroyed
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x5a1))
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
--atk/def
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x5a1))
e4:SetValue(cm.val)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
--damage
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_FZONE)
e6:SetCost(cm.cost)
e6:SetCountLimit(1)
e6:SetOperation(cm.operation)
c:RegisterEffect(e6)
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x5a1) and c:IsType(TYPE_MONSTER)
and c:GetSummonPlayer()==tp
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
if eg:IsExists(cm.cfilter,1,nil,tp)then
e:GetHandler():AddCounter(0x5aa,1)
end
end
function cm.val(e,c)
return e:GetHandler():GetCounter(0x5aa)*200
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetCounter(0x5aa)>0 end
local g=e:GetHandler():GetCounter(0x5aa)
e:GetHandler():RemoveCounter(tp,0x5aa,g,REASON_COST)
e:SetLabel(g)
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=e:GetLabel()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,g*200)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=e:GetLabel()
Duel.Damage(tp,g*200,REASON_EFFECT,true)
Duel.Damage(1-tp,g*200,REASON_EFFECT,true)
Duel.RDComplete()
end
\ No newline at end of file
--传说的黑夜 骨龙
local m=17243340
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.spcfilter(c)
return c:IsFaceup() and c:IsCode(m+2)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.spfilter(c,e,tp)
return c:IsCode(m+2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
-----------------------------------------------------------------------------
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
\ No newline at end of file
--传说的黑夜 暗黑龙
local m=17243342
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.spcfilter(c)
return c:IsFaceup() and c:IsCode(m-2)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.spfilter(c,e,tp)
return c:IsCode(m-2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
-----------------------------------------------------------------------------
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsRace(RACE_DRAGON)
end
function cm.thfilter(c)
return c.SetCard_CSDHY and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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
\ No newline at end of file
--传说的黑夜 耀月龙
local m=17243344
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsCode,m-4),aux.NonTuner(Card.IsRace,RACE_DRAGON),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
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:SetCountLimit(1,m+1)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
end
cm.SetCard_CSDHY=true
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.spfilter(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
---------------------------------------------------------------
function cm.repfilter(c,tp)
return c:IsLocation(LOCATION_ONFIELD)
and c:IsControler(tp) 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=17243346
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_DRAGON),1)
c:EnableReviveLimit()
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.accon)
e1:SetTarget(cm.actg)
e1:SetOperation(cm.acop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1000)
e2:SetCondition(cm.atkcon)
c:RegisterEffect(e2)
--immune
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.accfilter(c,tp)
if not (c:IsPreviousControler(tp) and c:IsType(TYPE_SPELL)) then return false end
if c:IsType(TYPE_FIELD) then
return c:GetActivateEffect():IsActivatable(tp,true,true)
elseif c:IsType(TYPE_CONTINUOUS) then
return c:GetActivateEffect():IsActivatable(tp)
else
return false
end
end
function cm.accon(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.accfilter,nil,tp)
if #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else
return false
end
end
function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local g1=g:Filter(Card.IsType,nil,TYPE_FIELD)
local g2=g:Filter(Card.IsType,nil,TYPE_CONTINUOUS)
if #g1>0 then
local tc1=g1:GetFirst()
local te1=tc1:GetActivateEffect()
if te1:IsActivatable(tp,true,true) then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc1,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
te1:UseCountLimit(tp,1,true)
local tep1=tc1:GetControler()
local cost1=te1:GetCost()
if cost1 then cost1(te1,tep1,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc1,4179255,te1,0,tp,tp,Duel.GetCurrentChain())
end
end
if #g2<=0 then return end
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ct<#g2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVECARD)
g2=g2:Select(tp,ct,ct,nil)
end
local tc2=g2:GetFirst()
while tc2 do
local te2=tc2:GetActivateEffect()
if te2:IsActivatable(tp) then
Duel.BreakEffect()
Duel.MoveToField(tc2,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
te2:UseCountLimit(tp,1,true)
local tep2=tc2:GetControler()
local cost2=te2:GetCost()
if cost2 then cost2(te,tep,eg,ep,ev,re,r,rp,1) end
end
tc2=g2:GetNext()
end
g:DeleteGroup()
end
----------------------------------------------------------------------------
function cm.atkcon(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return g:GetSum(Card.GetLevel)>=20
end
\ No newline at end of file
--传说的黑夜 笼罩大地
local m=17243347
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCountLimit(1,m+1)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
end
cm.SetCard_CSDHY=true
function cm.filter(c)
return c.SetCard_CSDHY and c:IsType(TYPE_MONSTER) 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.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.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
\ No newline at end of file
--传说的黑夜 龙魂
local m=17243351
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,1,1)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
cm.SetCard_CSDHY=true
function cm.matfilter(c)
return c:IsLinkAttribute(ATTRIBUTE_DARK) and c:IsLevel(4)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_DRAGON) and c:IsLevel(4)and c:IsType(TYPE_TUNER) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
if tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--传说的黑夜 鬼龙
local m=17243352
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),aux.NonTuner(cm.sfilter),1)
c:EnableReviveLimit()
--Change race
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(RACE_DRAGON)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.atkcon)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
--disable spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_SUMMON)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.dscon)
e3:SetTarget(cm.dstg)
e3:SetOperation(cm.dsop)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
cm.material_type=TYPE_SYNCHRO
function cm.sfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO)
end
function cm.atkcfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and bit.band(c:GetPreviousRaceOnField(),RACE_DRAGON)~=0
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.atkcfilter,1,nil)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
function cm.dscon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and Duel.GetCurrentChain()==0
end
function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
\ No newline at end of file
--传说的黑夜 活力龙崽
local m=17243353
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,m+17)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.desfilter(c)
return c:IsLocation(LOCATION_MZONE) or c:IsType(TYPE_MONSTER)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
-----------------------------------------------------------------------
function cm.thfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_NORMAL) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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
\ No newline at end of file
--传说的黑夜 黑阴龙
local m=17243354
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--pzone specialsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
cm.SetCard_CSDHY=true
function cm.spcfilter(c)
return c:IsFaceup() and c.SetCard_CSDHY
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.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 cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil)
end
end
\ No newline at end of file
--传说的黑夜 远古黑龙
local m=17243355
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(cm.sfilter),1,1)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,m+1)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+2)
e3:SetCondition(cm.tdcon)
e3:SetTarget(cm.tdtg)
e3:SetOperation(cm.tdop)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.sfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_NORMAL)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.thfilter(c)
return c:IsCode(m+3) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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 cm.spfilter(c,e,tp)
return c:IsLevel(8) and c:IsType(TYPE_SYNCHRO) and c:IsFaceupEx() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetOperation(cm.desop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetCountLimit(1)
tc:RegisterEffect(e3,true)
end
Duel.SpecialSummonComplete()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
------------------------------------------------------------------------
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==1-tp and Duel.GetCurrentChain()>=2 and re:GetHandler():IsRelateToEffect(re)
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if tc:IsRelateToEffect(re) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
\ No newline at end of file
--传说的黑夜 龙之坟墓
local m=17243358
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.descon)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.spcfilter(c,tp)
return c:IsRace(RACE_DRAGON) and c:IsFaceup() and c:IsAbleToGraveAsCost()
and Duel.GetMZoneCount(tp,c)>0
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.spfilter(c,e,tp)
return c.SetCard_CSDHY and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
---------------------------------------------------------------------------
function cm.descfilter(c,tp)
return bit.band(c:GetPreviousRaceOnField(),RACE_DRAGON)~=0 and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT)
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and eg:IsExists(cm.descfilter,1,nil,tp)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--传说的黑夜 深藏于蛋之龙
local m=17243360
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.ffilter,2,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_GRAVE,0,Duel.Remove,POS_FACEUP,REASON_COST+REASON_MATERIAL)
--add code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_ADD_CODE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(m-20)
c:RegisterEffect(e1)
end
cm.SetCard_CSDHY=true
function cm.ffilter(c)
return c.SetCard_CSDHY and c:IsFusionType(TYPE_MONSTER)
end
\ No newline at end of file
--传说的黑夜 血月洗礼
local m=17243364
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
cm.SetCard_CSDHY=true
function cm.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsLevel(4) and c:IsAbleToRemoveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.tfilter(c,e,tp,tc)
return c.SetCard_CSDHY and c:IsType(TYPE_SYNCHRO) and c:IsLevel(8)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_TUNER)
and Duel.IsExistingMatchingCard(cm.tfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) and Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if Duel.SendtoGrave(tc,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil):GetFirst()
if sc then
Duel.BreakEffect()
sc:SetMaterial(nil)
if Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then
sc:CompleteProcedure()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetValue(cm.actlimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
if e:GetHandler():IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
end
function cm.splimit(e,c)
return not c:IsRace(RACE_DRAGON)
end
function cm.actlimit(e,re,rp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and not rc:IsRace(RACE_DRAGON)
end
\ No newline at end of file
--传说的黑夜 死亡龙骑士
local m=17243365
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_DRAGON),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.descon)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetRange(LOCATION_ONFIELD)
e2:SetTarget(cm.indtg)
e2:SetValue(cm.indval)
c:RegisterEffect(e2)
--indes battle
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(cm.indes)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetChainLimit(cm.chainlm)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function cm.chainlm(e,rp,tp)
return tp==rp or not e:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
---------------------------------------------------------------
function cm.indtg(e,c)
return c:IsRace(RACE_DRAGON)
end
function cm.indval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and re:GetActivateLocation()==LOCATION_MZONE and re:GetHandler():IsRace(RACE_DRAGON)
end
function cm.indes(e,c)
return c:IsRace(RACE_DRAGON)
end
\ No newline at end of file
--传说的黑夜 血月三头龙
local m=17243366
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_DRAGON),1)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.discon)
e3:SetTarget(cm.distg)
e3:SetOperation(cm.disop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
cm.SetCard_CSDHY=true
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.thfilter(c)
return c:IsCode(m-2) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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 cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevel(4) and c:IsType(TYPE_TUNER) and c:IsFaceupEx() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
------------------------------------------------------------------------
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetFlagEffect(tp,m)>0 and not c:IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and Duel.IsChainDisablable(ev)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
if re:GetActivateLocation()==LOCATION_GRAVE then
e:SetCategory(e:GetCategory()|CATEGORY_GRAVE_ACTION)
else
e:SetCategory(e:GetCategory()&~CATEGORY_GRAVE_ACTION)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_REMOVED) and tc:IsType(TYPE_MONSTER) then
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(0,1)
e1:SetLabel(tc:GetCode())
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.splimit(e,c)
return c:IsCode(e:GetLabel())
end
------------------------------------------------------------------------
function cm.ckcfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetOwner()
if eg:IsExists(cm.ckcfilter,1,nil,tp) then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if eg:IsExists(cm.ckcfilter,1,nil,1-tp) then
Duel.RegisterFlagEffect(1-tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
\ No newline at end of file
--传说的黑夜 龙诞生之地
local m=17243368
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
cm.SetCard_CSDHY=true
function cm.filter(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_DISEFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.efilter)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true)
end
end
function cm.efilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler()==e:GetHandler()
end
\ No newline at end of file
--传说的黑夜 火素龙
local m=17243369
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
cm.SetCard_CSDHY=true
function cm.spcfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.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 cm.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 cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.thfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_TUNER) and c:IsLevel(4) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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
\ No newline at end of file
--徐盛
local m=17243371
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.tkcost)
e2:SetTarget(cm.tktg)
e2:SetOperation(cm.tkop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function cm.spcfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function cm.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 cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
----------------------------------------------------------------------------
function cm.tkcfilter(c)
return c:IsRace(RACE_DRAGON) and not c:IsPublic()
end
function cm.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tkcfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.tkcfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+4,0,TYPES_TOKEN_MONSTER,0,0,4,RACE_DRAGON,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,m+4,0,TYPES_TOKEN_MONSTER,0,0,4,RACE_DRAGON,ATTRIBUTE_DARK) then
local tk=Duel.CreateToken(tp,m+4)
Duel.SpecialSummon(tk,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--江东铁壁 界徐盛
local m=17243373
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,cm.sfilter,aux.NonTuner(Card.IsRace,RACE_DRAGON),1,1)
c:EnableReviveLimit()
--turn set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(cm.poscon)
e1:SetTarget(cm.postg)
e1:SetOperation(cm.posop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
end
function cm.sfilter(c)
return c:IsLevel(4) and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK)
end
function cm.poscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.posfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.posfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if g:GetCount()>0 and Duel.ChangePosition(g,POS_FACEDOWN)~=0 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_MZONE)
local tc=og:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=og:GetNext()
end
end
end
--------------------------------------------------------------------------
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--传说的黑夜 毒龙
local m=17243459
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.sprcon)
e1:SetTarget(cm.sprtg)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.sprcfilter(c)
return c:IsFacedown() or not c:IsRace(RACE_DRAGON)
end
function cm.sprcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.sprcfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sprtg(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 cm.sprop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
---------------------------------------------------------------------------
function cm.spfilter(c,e,tp)
return c.SetCard_CSDHY and c:IsLevel(4) and not c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.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,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
--传说的黑夜 白骨幼龙
local m=17243461
local cm=_G["c"..m]
function cm.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
cm.SetCard_CSDHY=true
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.thfilter(c)
return c:IsCode(17243340) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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 cm.spcfilter(c,tp)
return c.SetCard_CSDHY and c:IsType(TYPE_SYNCHRO) and c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsFaceup() and c:IsControler(tp)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spcfilter,1,nil,tp)
end
function cm.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 cm.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
\ No newline at end of file
--谦卑之虫 七星瓢虫
local m=17243463
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.sprcost)
e1:SetTarget(cm.sprtg)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--SynchroSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(2,m+2)
e3:SetCondition(cm.sycon)
e3:SetTarget(cm.sytg)
e3:SetOperation(cm.syop)
c:RegisterEffect(e3)
end
cm.SetCard_QBZC=true
function cm.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
function cm.sprcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTarget(cm.splimit)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function cm.sprtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsCanTurnSet() then
Duel.BreakEffect()
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
----------------------------------------------------------------------------
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.thfilter(c)
return c.SetCard_QBZC and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
-------------------------------------------------------------------------
function cm.sycon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function cm.syncfilter(c,mg)
return c:IsRace(RACE_INSECT) and c:IsSynchroSummonable(nil,mg)
end
function cm.sytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetSynchroMaterial(tp):Filter(Card.IsRace,nil,RACE_INSECT)
return Duel.IsExistingMatchingCard(cm.syncfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.syop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetSynchroMaterial(tp):Filter(Card.IsRace,nil,RACE_INSECT)
local g=Duel.GetMatchingGroup(cm.syncfilter,tp,LOCATION_EXTRA,0,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
\ No newline at end of file
--谦卑之虫 屎壳郎
local m=17243466
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.sprcost)
e1:SetTarget(cm.sprtg)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,m+1)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m+2)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--nontuner
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_NONTUNER)
e4:SetValue(cm.tnval)
c:RegisterEffect(e4)
end
cm.SetCard_QBZC=true
function cm.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
function cm.sprcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTarget(cm.splimit)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function cm.sprtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsCanTurnSet() then
Duel.BreakEffect()
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
----------------------------------------------------------------------------
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.thfilter(c)
return c.SetCard_QBZC and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
-------------------------------------------------------------------------
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function cm.spfilter(c,e,tp)
return c.SetCard_QBZC and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,g)
end
end
---------------------------------------------------------------------
function cm.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler()) and c:IsRace(RACE_INSECT)
end
\ No newline at end of file
--谦卑之虫 蝗虫
local m=17243469
local cm=_G["c"..m]
function cm.initial_effect(c)
--destroy and special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.dspcon)
e1:SetCost(cm.dspcost)
e1:SetTarget(cm.dsptg)
e1:SetOperation(cm.dspop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
--atk down
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.dspcon)
e3:SetTarget(cm.atktg)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
end
cm.SetCard_QBZC=true
function cm.dspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
function cm.dspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTarget(cm.splimit)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function cm.desfilter(c,tp)
return (c:IsRace(RACE_INSECT) or c:IsFacedown()) and Duel.GetMZoneCount(tp,c)>0
end
function cm.dsptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE,0,nil,tp)
if chk==0 then return #g>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.dspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE,0,nil,tp)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
Duel.HintSelection(dg)
if Duel.Destroy(dg,REASON_EFFECT)==0 or not c:IsRelateToEffect(e) then return end
local sg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,0,nil)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 and #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
local tc=sg:Select(tp,1,1,nil):GetFirst()
if tc then
local pos=Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE)
Duel.ChangePosition(tc,pos)
end
end
end
-----------------------------------------------------------------------
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-2000)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetRange(LOCATION_MZONE)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e5:SetValue(1)
tc:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(cm.fuslimit)
tc:RegisterEffect(e6)
local e7=e5:Clone()
e7:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e7)
local e8=e5:Clone()
e8:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e8)
end
end
end
\ No newline at end of file
--谦卑之虫 蚕茧
local m=17243471
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,cm.sfilter,aux.NonTuner(Card.IsRace,RACE_INSECT),1)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetCondition(cm.slcon)
e1:SetValue(cm.slval)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+1)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.poscon)
e4:SetTarget(cm.postg)
e4:SetOperation(cm.posop)
c:RegisterEffect(e4)
end
cm.SetCard_QBZC=true
function cm.sfilter(c)
return c.SetCard_QBZC
end
function cm.slcon(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function cm.slval(e,se,sp,st)
return st&SUMMON_TYPE_SYNCHRO~=SUMMON_TYPE_SYNCHRO
end
-------------------------------------------------------------------------------
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function cm.spfilter(c,e,tp)
return c:IsLevel(2) and c.SetCard_QBZC and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
------------------------------------------------------------------------
function cm.poscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,e:GetHandler(),1-tp)
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local pos=Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE)
Duel.ChangePosition(tc,pos)
end
end
\ No newline at end of file
--谦卑之虫 杀人蜂
local m=17243473
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,cm.sfilter,aux.NonTuner(Card.IsRace,RACE_INSECT),1)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetCondition(cm.slcon)
e1:SetValue(cm.slval)
c:RegisterEffect(e1)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.chcon)
e2:SetTarget(cm.chtg)
e2:SetOperation(cm.chop)
c:RegisterEffect(e2)
--SynchroSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.sycon)
e3:SetTarget(cm.sytg)
e3:SetOperation(cm.syop)
c:RegisterEffect(e3)
end
cm.SetCard_QBZC=true
function cm.sfilter(c)
return c.SetCard_QBZC
end
function cm.slcon(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function cm.slval(e,se,sp,st)
return st&SUMMON_TYPE_SYNCHRO~=SUMMON_TYPE_SYNCHRO
end
-------------------------------------------------------------------------------
function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,rp,0,LOCATION_HAND,1,nil,REASON_EFFECT) end
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local sg=g:RandomSelect(tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
-------------------------------------------------------------------------------
function cm.sycfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsPreviousLocation(LOCATION_EXTRA)
end
function cm.sycon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.sycfilter,1,nil,1-tp)
end
function cm.syncfilter(c,mg)
return c:IsRace(RACE_INSECT) and c:IsSynchroSummonable(nil,mg)
end
function cm.sytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetSynchroMaterial(tp):Filter(Card.IsRace,nil,RACE_INSECT)
return Duel.IsExistingMatchingCard(cm.syncfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.syop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetSynchroMaterial(tp):Filter(Card.IsRace,nil,RACE_INSECT)
local g=Duel.GetMatchingGroup(cm.syncfilter,tp,LOCATION_EXTRA,0,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
\ No newline at end of file
--谦卑之虫 黑寡妇蜘蛛
local m=17243475
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,cm.sfilter,aux.NonTuner(cm.sfilter),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.sprcon)
e1:SetOperation(cm.sprop)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.discon)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
--atk
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(cm.atkval)
c:RegisterEffect(e4)
end
cm.SetCard_QBZC=true
function cm.sfilter(c)
return c.SetCard_QBZC
end
function cm.sprfilter1(c,tp,g,sc)
return c:IsLevel(6) and c.SetCard_QBZC and c:IsType(TYPE_SYNCHRO) and g:IsExists(cm.sprfilter2,1,c,tp,c,sc)
end
function cm.sprfilter2(c,tp,mc,sc)
local sg=Group.FromCards(c,mc)
return c:IsRace(RACE_INSECT) and c:IsType(TYPE_LINK)
and Duel.GetLocationCountFromEx(tp,tp,sg,sc)>0
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON)
return g:IsExists(cm.sprfilter1,1,nil,tp,g,c)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=g:FilterSelect(tp,cm.sprfilter1,1,1,nil,tp,g,c)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=g:FilterSelect(tp,cm.sprfilter2,1,1,mc,tp,mc,c)
g1:Merge(g2)
Duel.Release(g1,REASON_COST)
end
--------------------------------------------------------------------------
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
-------------------------------------------------------------------------
function cm.atkfilter(c)
return c:IsFaceup() and not c:IsCode(m,21208154) and not c:IsHasEffect(21208154)
end
function cm.atkval(e,c)
local g=Duel.GetMatchingGroup(cm.atkfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then
return 0
else
local tg,val=g:GetMaxGroup(Card.GetAttack)
return val
end
end
\ No newline at end of file
--谦卑之虫 昆虫巢穴
local m=17243476
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--remove when chaining
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(2)
e2:SetCondition(cm.poscon)
e2:SetTarget(cm.postg)
e2:SetOperation(cm.posop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsFacedown))
e3:SetValue(aux.indoval)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_INSECT))
e4:SetValue(800)
c:RegisterEffect(e4)
end
cm.SetCard_QBZC=true
function cm.filter(c)
return c.SetCard_QBZC and c:IsType(TYPE_MONSTER) 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.poscon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.GetTurnPlayer()==1-tp
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local pos=Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE)
Duel.ChangePosition(tc,pos)
end
end
-------------------------------------------------------------------------
--天苍青蛰龙
local m=17243540
local cm=_G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,3,cm.ovfilter,aux.Stringid(m,0),3,cm.xyzop)
c:EnableReviveLimit()
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCost(cm.tdcost)
e1:SetCondition(cm.tdcon)
e1:SetTarget(cm.tdtg)
e1:SetOperation(cm.tdop)
c:RegisterEffect(e1)
end
function cm.ovfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsRank(8) and c:GetOverlayCount()>0
end
function cm.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
-------------------------------------------------------------------
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.tdcost(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 tc=Duel.GetOperatedGroup():GetFirst()
e:SetLabelObject(tc)
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,0)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,0)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.ShuffleDeck(tp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
local tc=e:GetLabelObject()
if tc:IsType(TYPE_XYZ) and tc:IsRank(8) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsLocation(LOCATION_GRAVE) and not tc:IsHasEffect(EFFECT_NECRO_VALLEY) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--终墟秽泥
local m=30015000
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--summonproc or overuins
local e0=ors.summonproc(c,5,2,1)
--Effect 1
local e1=ors.atkordef(c,50,2000)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.ccon)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,1))
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SUMMON)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(2)
e6:SetCondition(cm.con)
e6:SetTarget(cm.tg)
e6:SetOperation(cm.op)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e7)
--Effect 3
local e7=ors.monsterle(c)
--all
local e9=ors.alldrawflag(c)
end
c30015000.isoveruins=true
--Effect 2
function cm.drt(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function cm.sumt(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
function cm.set(c,tp)
return ors.setf(c,tp) and ors.stf(c)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetFlagEffect(m)
return not eg:IsContains(e:GetHandler()) and ors.adsumcon(e) and ct<2
end
function cm.ccon(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetFlagEffect(m)
return ors.adsumcon(e) and ct<2
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_REMOVED)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.drt,tp,LOCATION_REMOVED,0,nil)
if #mg==0 then return end
local sg=mg:RandomSelect(tp,1)
local tcc=sg:GetFirst()
if #sg==0 or tcc==nil then return false end
if Duel.SendtoHand(tcc,nil,REASON_EFFECT)==0 then return false end
Duel.ConfirmCards(1-tp,tcc)
Duel.AdjustAll()
local sumg=Duel.GetMatchingGroup(cm.sumt,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local setg=Duel.GetMatchingGroup(cm.set,tp,LOCATION_HAND,0,nil,tp)
local b1=#sumg>0
local b2=#setg>0
if #sumg==0 and #setg==0 then return false end
local op=aux.SelectFromOptions(tp,{b1,1151},{b2,1153})
if op==1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sumc=sumg:Select(tp,1,1,nil):GetFirst()
ors.sumop(e,tp,sumc)
else
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local ssg=setg:Select(tp,1,1,nil)
Duel.SSet(tp,ssg)
end
end
\ No newline at end of file
--终墟之始
local m=30015005
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Effect 1
local e1=ors.atkordef(c,50,1500)
--Effect 2
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,1))
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SUMMON+CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(3)
e6:SetCondition(cm.con)
e6:SetTarget(cm.tg)
e6:SetOperation(cm.op)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e7)
--Effect 3
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.orsmc)
e21:SetTarget(cm.orsmt)
e21:SetOperation(cm.orsmp)
c:RegisterEffect(e21)
end
c30015005.isoveruins=true
--effect 2
function cm.drt(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function cm.sumt(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler())
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_REMOVED)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.drt,tp,LOCATION_REMOVED,0,nil)
if #mg==0 then return end
local sg=mg:RandomSelect(tp,1)
local tcc=sg:GetFirst()
if #sg==0 or tcc==nil then return false end
if Duel.SendtoHand(tcc,nil,REASON_EFFECT)==0 then return false end
Duel.ConfirmCards(1-tp,tcc)
Duel.AdjustAll()
local sumg=Duel.GetMatchingGroup(cm.sumt,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local setg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil,tp,POS_FACEDOWN,REASON_EFFECT)
local b1=#sumg>0
local b2=#setg>0
if #sumg==0 and #setg==0 then return false end
local op=aux.SelectFromOptions(tp,{b1,1151},{b2,1192})
if op==1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sumc=sumg:Select(tp,1,1,nil):GetFirst()
ors.sumop(e,tp,sumc)
else
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rmg=setg:Select(tp,1,1,nil)
Duel.Remove(rmg,POS_FACEDOWN,REASON_EFFECT)
end
end
--Effect 3
function cm.orsmt(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if chk==0 then return true end
local sg=Group.FromCards(c)
if ct>0 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_REMOVED)
end
function cm.orsmp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if ct>0 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,5))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,5))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetTargetRange(0,1)
Duel.RegisterEffect(e1,tp)
end
if not c:IsRelateToEffect(e) or Duel.SendtoHand(c,nil,REASON_EFFECT)==0
or c:GetLocation()~=LOCATION_HAND then return false end
local tg=Duel.GetMatchingGroup(aux.AND(Card.IsFaceup,Card.IsAbleToDeck),tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #tg==0 then return false end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
local m=30015010
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--summonproc or overuins
local e0=ors.summonproc(c,11,6,3)
--Effect 0
local e1=ors.atkordef(c,150,2500)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e7)
--Effect 2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCondition(ors.adsumcon)
e3:SetTarget(cm.rmtg)
e3:SetOperation(cm.rmop)
c:RegisterEffect(e3)
--Effect 3
local e11=ors.monsterleup(c)
--all
local e9=ors.alldrawflag(c)
end
c30015010.isoveruins=true
--all
--Effect 2
function cm.rmcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function cm.kf(c,tp)
local b1=c:IsType(TYPE_SPELL+TYPE_TRAP)
local b2=not c:IsAbleToRemove(tp,POS_FACEDOWN)
return b1 and b2
end
function cm.rmf(c,tp)
local b1=c:IsType(TYPE_SPELL+TYPE_TRAP)
local b2=c:IsAbleToRemove(tp,POS_FACEDOWN)
return b1 and b2
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
local rg=g:Filter(cm.rmf,nil,tp)
if chk==0 then
return #rg>0 and g:FilterCount(cm.kf,nil,tp)==0
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,#rg,0,0)
Duel.SetChainLimit(cm.chainlm)
end
function cm.chainlm(re,rp,tp)
return tp==rp or not re:GetHandler():IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
local rg=g:Filter(cm.rmf,nil,tp)
if #rg==0 then return false end
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
local hg=Duel.GetMatchingGroup(cm.rmf,tp,0,LOCATION_HAND,nil,tp)
if #hg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.ConfirmCards(tp,hg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rmg=hg:Select(tp,1,2,nil)
Duel.Remove(rmg,POS_FACEDOWN,REASON_EFFECT)
Duel.ShuffleHand(1-tp)
end
end
\ No newline at end of file
local m=30015015
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--summonproc or overuins
local e0=ors.summonproc(c,12,6,3)
--Effect 0
local e1=ors.atkordef(c,150,3500)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e7)
--Effect 2
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_BATTLED)
e0:SetOperation(cm.regop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(ors.adsumcon)
e1:SetValue(cm.efilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetCondition(ors.adsumcon)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e3:SetValue(2)
e3:SetCondition(ors.adsumcon)
c:RegisterEffect(e3)
--Effect 3
local e11=ors.monsterleup(c)
--all
local e9=ors.alldrawflag(c)
end
c30015015.isoveruins=true
--all
--Effect 2
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
function cm.efilter(e,re)
local ct=e:GetHandler():GetFlagEffect(m)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() and ct==0
end
\ No newline at end of file
--归墟仲裁·屠破
local m=30015020
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--summonproc or overuins
local e0=ors.summonproc(c,8,4,2)
--Effect 1
local e1=ors.atkordef(c,100,3500)
--Effect 2
local e13=Effect.CreateEffect(c)
e13:SetCategory(CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION+CATEGORY_REMOVE)
e13:SetType(EFFECT_TYPE_QUICK_O)
e13:SetCode(EVENT_FREE_CHAIN)
e13:SetRange(LOCATION_MZONE)
e13:SetCountLimit(1)
e13:SetCondition(ors.adsumcon)
e13:SetTarget(cm.togtg)
e13:SetOperation(cm.togop)
c:RegisterEffect(e13)
--Effect 3
local e7=ors.monsterle(c)
--all
local e9=ors.alldrawflag(c)
end
c30015020.isoveruins=true
--Effect 2
function cm.ff(c,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function cm.togtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,POS_FACEDOWN)
local gap=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return #g>=3 and #gap>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,3,#gap+2,nil)
Duel.Remove(sg,POS_FACEDOWN,REASON_COST)
e:SetLabel(#sg-2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,gap,#sg-2,0,0)
end
function cm.togop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local ec=e:GetHandler()
local gap=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if ct==0 then return end
if #gap>=ct then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=gap:Select(tp,ct,ct,nil)
if Duel.SendtoGrave(tg,REASON_EFFECT)==0 then return false end
local rct=Duel.GetOperatedGroup():GetCount()
local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.ff),0,LOCATION_GRAVE,LOCATION_GRAVE,nil,tp,POS_FACEDOWN)
if #rg>=rct and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local mg=rg:Select(tp,rct,rct,nil)
Duel.Hint(HINT_CARD,0,m)
Duel.BreakEffect()
Duel.Remove(mg,POS_FACEDOWN,REASON_EFFECT)
end
end
end
\ No newline at end of file
--归墟仲裁·聚引
local m=30015025
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--summonproc or overuins
local e0=ors.summonproc(c,9,4,2)
--Effect 1
local e1=ors.atkordef(c,100,2500)
--Effect 2
local e51=Effect.CreateEffect(c)
e51:SetDescription(aux.Stringid(m,0))
e51:SetType(EFFECT_TYPE_QUICK_O)
e51:SetCode(EVENT_FREE_CHAIN)
e51:SetRange(LOCATION_MZONE)
e51:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e51:SetCountLimit(1)
e51:SetCondition(ors.adsumcon)
e51:SetTarget(cm.settg)
e51:SetOperation(cm.setop)
c:RegisterEffect(e51)
--Effect 3
local e7=ors.monsterle(c)
--all
local e9=ors.alldrawflag(c)
end
c30015025.isoveruins=true
--Effect 2
function cm.setf(c)
return ors.setf(c,tp) and ors.stf(c)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setf,tp,LOCATION_DECK,0,1,nil,tp) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.setf,tp,LOCATION_DECK,0,1,1,nil)
if #g==0 then return end
local tc=g:GetFirst()
if Duel.SSet(tp,tc)>0 then
local b1=tc:IsType(TYPE_QUICKPLAY) or tc:IsType(TYPE_TRAP)
if b1 then
if tc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
else
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
else
local te=tc:GetActivateEffect()
local se=te:Clone()
local con_c=te:GetCondition()
se:SetProperty(te:GetProperty(),EFFECT_FLAG2_COF)
se:SetCode(EVENT_CHAIN_END)
se:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()~=0 or not e:GetHandler():IsLocation(LOCATION_SZONE) then return false end
return not con_c or con_c(e,tp,eg,ep,ev,re,r,rp)
end)
se:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(se)
end
end
end
--归墟奇裂点
local m=30015035
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--activate
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_ACTIVATE)
e30:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e30)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(30015035)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetTargetRange(1,0)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(2)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
--Effect 3
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetCategory(CATEGORY_REMOVE)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.orsmc)
e21:SetTarget(ors.orsmtup)
e21:SetOperation(cm.orsop)
c:RegisterEffect(e21)
local e32=Effect.CreateEffect(c)
e32:SetCategory(CATEGORY_REMOVE)
e32:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e32:SetCode(EVENT_CHAIN_NEGATED)
e32:SetProperty(EFFECT_FLAG_DELAY)
e32:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e32:SetCondition(cm.tthcon)
e32:SetTarget(cm.tthtg)
e32:SetOperation(cm.tthop)
c:RegisterEffect(e32)
local e33=e32:Clone()
e33:SetCode(EVENT_CUSTOM+30015500)
e33:SetCondition(cm.tthcon2)
c:RegisterEffect(e33)
--all
local ge1=ors.alldrawflag(c)
end
c30015035.isoveruins=true
--
function cm.ff(c,tp)
return c:IsType(TYPE_FIELD) and c:IsCode(30015037)
and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48934760,0))
local tc=Duel.SelectMatchingCard(tp,cm.ff,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
--Effect 1
--Effect 2
function cm.filter(c)
local b2=c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
return b2
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if #g==0 then return false end
local sumc=g:GetFirst()
ors.sumop(e,tp,sumc)
local res=1
ors.exrmop(e,tp,res)
end
--Effect 3
function cm.orscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.orsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if ct>0 then
cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
--negop--
function cm.tthcon(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
local dc=de:GetHandler()
if de and de~=nil and dc:IsControler(1-tp) then
e:SetLabelObject(dc)
end
return rp==tp and de and de~=nil and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de
end
function cm.tthcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c==re:GetHandler() and c:GetReasonEffect()==nil
end
function cm.tthtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetFlagEffect(30015500)
local dc=e:GetLabelObject()
if chk==0 then return true end
local sg=Group.FromCards(c)
if ct>0 then
Duel.SetTargetParam(1)
end
if dc and dc~=nil then
Duel.SetTargetCard(dc)
sg:AddCard(dc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
end
function cm.tthop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=e:GetLabelObject()
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if dc and dc~=nil then
cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
--归墟熵落点
local m=30015037
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--activate
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_ACTIVATE)
e30:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e30)
--Effect 1
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(cm.itg)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--Effect 2
local e23=Effect.CreateEffect(c)
e23:SetCategory(CATEGORY_TOHAND+CATEGORY_SUMMON)
e23:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e23:SetCode(EVENT_ATTACK_ANNOUNCE)
e23:SetRange(LOCATION_FZONE)
e23:SetCountLimit(2)
e23:SetCondition(cm.spacon)
e23:SetTarget(cm.spatg)
e23:SetOperation(cm.spaop)
c:RegisterEffect(e23)
--Effect 3
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetCategory(CATEGORY_REMOVE)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.orsmc)
e21:SetTarget(ors.orsmtup)
e21:SetOperation(cm.orsop)
c:RegisterEffect(e21)
local e32=Effect.CreateEffect(c)
e32:SetCategory(CATEGORY_REMOVE)
e32:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e32:SetCode(EVENT_CHAIN_NEGATED)
e32:SetProperty(EFFECT_FLAG_DELAY)
e32:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e32:SetCondition(cm.tthcon)
e32:SetTarget(cm.tthtg)
e32:SetOperation(cm.tthop)
c:RegisterEffect(e32)
local e33=e32:Clone()
e33:SetCode(EVENT_CUSTOM+30015500)
e33:SetCondition(cm.tthcon2)
c:RegisterEffect(e33)
--all
local ge1=ors.alldrawflag(c)
end
c30015037.isoveruins=true
--
function cm.ff(c,tp)
return c:IsType(TYPE_FIELD) and c:IsCode(30015035)
and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48934760,0))
local tc=Duel.SelectMatchingCard(tp,cm.ff,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
--Effect 1
function cm.itg(e,c)
local b1=c:IsStatus(STATUS_BATTLE_DESTROYED)
local b2=c:IsStatus(STATUS_ACTIVATE_DISABLED)
local b3=c:IsStatus(STATUS_LEAVE_CONFIRMED)
if b1 or b2 or b3 then return false end
return ors.stf(c) and c:IsFaceup()
end
--Effect 2
function cm.spacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==nil
end
function cm.smf(c)
if not c:IsType(TYPE_MONSTER) or c:IsExtraDeckMonster() then return false end
local b0=ors.stf(c) or c:IsLevelAbove(5)
local b1=c:IsFacedown()
local b2=c:IsSummonableCard()
local b3=c:IsAbleToHand()
return b0 and b1 and b2 and b3
end
function cm.spatg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.smf,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_REMOVED)
end
function cm.spaop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local xg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,0,nil)
local g=xg:Filter(cm.smf,nil)
if #g==0 then return false end
local sg=g:FilterSelect(tp,cm.smf,1,1,nil)
local tc=sg:GetFirst()
if #sg==0 or Duel.SendtoHand(sg,nil,REASON_EFFECT)==0 or tc:GetLocation()~=LOCATION_HAND then return false end
Duel.ConfirmCards(1-tp,tc)
if ors.sumchk(tc) then
ors.sumop(e,tp,tc)
else
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
end
end
--Effect 3
function cm.orscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.orsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if ct>0 then
cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
--negop--
function cm.tthcon(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
local dc=de:GetHandler()
if de and de~=nil and dc:IsControler(1-tp) then
e:SetLabelObject(dc)
end
return rp==tp and de and de~=nil and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de
end
function cm.tthcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c==re:GetHandler() and c:GetReasonEffect()==nil
end
function cm.tthtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetFlagEffect(30015500)
local dc=e:GetLabelObject()
if chk==0 then return true end
local sg=Group.FromCards(c)
if ct>0 then
Duel.SetTargetParam(1)
end
if dc and dc~=nil then
Duel.SetTargetCard(dc)
sg:AddCard(dc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
end
function cm.tthop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=e:GetLabelObject()
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if dc and dc~=nil then
cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
--归墟溃散
local m=30015040
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--activate
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_ACTIVATE)
e30:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e30)
--Effect 1
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PREDRAW)
e0:SetRange(LOCATION_SZONE)
e0:SetCondition(cm.thcon)
e0:SetOperation(cm.thop)
c:RegisterEffect(e0)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(ors.recost)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
local e13=Effect.CreateEffect(c)
e13:SetCategory(CATEGORY_TOGRAVE+CATEGORY_GRAVE_ACTION+CATEGORY_REMOVE)
e13:SetType(EFFECT_TYPE_QUICK_O)
e13:SetCode(EVENT_FREE_CHAIN)
e13:SetRange(LOCATION_SZONE)
e13:SetCountLimit(1)
e13:SetCondition(cm.con)
e13:SetCost(ors.recost)
e13:SetTarget(cm.tg)
e13:SetOperation(cm.op)
c:RegisterEffect(e13)
--Effect 3
local e13=ors.yongxule(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015040.isoveruins=true
--
--Effect 1
function cm.th(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetDrawCount(tp)>0 and Duel.IsExistingMatchingCard(cm.th,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local dt=Duel.GetDrawCount(tp)
if dt>0 then
aux.DrawReplaceCount=0
aux.DrawReplaceMax=dt
end
aux.DrawReplaceCount=aux.DrawReplaceCount+1
if aux.DrawReplaceCount<=aux.DrawReplaceMax then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
local mg=Duel.GetMatchingGroup(cm.th,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #mg>0 then
local ct=ors[tp]+2
if ct>=#mg then
Duel.SendtoHand(mg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,mg)
ors[dp]=0
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=mg:RandomSelect(tp,ct)
if #sg==0 then return false end
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
ors[dp]=0
end
end
end
end
--Effect 2
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetTurnPlayer()~=tp
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,e:GetHandler(),tp,POS_FACEDOWN) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,tp,POS_FACEDOWN)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
local dt=Duel.GetDrawCount(tp)
Debug.Message(dt)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,5,nil,tp,POS_FACEDOWN)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
--Effect 3
\ No newline at end of file
--归墟戮杀波
local m=30015045
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_GRAVE_ACTION+CATEGORY_REMOVE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.xtg)
e1:SetOperation(cm.xop)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015045.isoveruins=true
--all
--Effect 1
function cm.xtg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if chk==0 then return true end
if #mg>0 and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function cm.xop(e,tp,eg,ep,ev,re,r,rp)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISEFFECT)
e1:SetValue(cm.effectfilter)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_INACTIVATE)
e2:SetValue(cm.effectfilter)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(cm.refvengecon)
e3:SetOperation(cm.refvengeop)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_FIELD)
e11:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e11:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e11:SetTarget(aux.TRUE)
e11:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e11,tp)
local e13=e11:Clone()
e13:SetCode(EFFECT_CANNOT_DISABLE_FLIP_SUMMON)
Duel.RegisterEffect(e13,tp)
local res=1
Duel.BreakEffect()
ors.exrmop(e,tp,res)
end
function cm.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return te:IsActiveType(TYPE_TRAP) or ors.stf(tc)
end
function cm.ref(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
and (c:GetPreviousTypeOnField()&TYPE_SPELL~=0 or c:GetPreviousTypeOnField()&TYPE_TRAP~=0)
and c:GetReasonPlayer()==1-tp
end
function cm.refvengecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.ref,1,nil,tp)
end
function cm.refvengeop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler(c)
local xg=eg:Filter(cm.ref,nil,tp)
for tc in aux.Next(xg) do
local sg=Group.CreateGroup()
local rc=tc:GetReasonCard()
local rre=tc:GetReasonEffect()
if not rc and rre then
local sc=rre:GetHandler()
if not rc then
sg:AddCard(sc)
end
end
if rc then
sg:AddCard(rc)
end
if #sg>0 then
local bc=sg:GetFirst()
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(m,1))
ors.removeone(e,tp,bc)
end
end
end
--终墟覆始
local m=30015060
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(cm.hcon)
c:RegisterEffect(e2)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.acttg)
e1:SetOperation(cm.actop)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015060.isoveruins=true
--act in set turn
function cm.ff(c)
return c:IsLevelAbove(5) and c:IsFaceup()
end
function cm.hcon(e)
local g=Duel.GetMatchingGroup(cm.ff,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
return #g>0
end
--Effect 1
function cm.f(c)
return c:IsFacedown() and ors.stf(c) and c:IsAbleToHand()
end
function cm.tf(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.f,tp,LOCATION_REMOVED,0,nil)
if chk==0 then return #g>0 end
local rg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
local ct=1
if #rg>=5 then ct=2 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,ct,tp,LOCATION_REMOVED)
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.f,tp,LOCATION_REMOVED,0,nil)
if #g==0 then return end
local ext=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc==nil or not tc or Duel.SendtoHand(tc,nil,REASON_EFFECT)==0 or tc:GetLocation()~=LOCATION_HAND then return false end
Duel.ConfirmCards(1-tp,tc)
local rg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,0,nil)
rg:RemoveCard(tc)
Duel.AdjustAll()
local rtg=rg:Filter(cm.tf,nil)
ext=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if ext>=5 and #rtg>0 then
Duel.BreakEffect()
tc=rtg:RandomSelect(tp,1):GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
local res=1
ors.exrmop(e,tp,res)
end
--Effect 2
--Effect 3
--Effect 4
--Effect 5
\ No newline at end of file
--终墟消抹
local m=30015065
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.negtg)
e1:SetOperation(cm.negop)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015065.isoveruins=true
--all
--Effect 1
function cm.negfilter(c)
return aux.NegateAnyFilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.negfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,cm.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local res=0
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e,false) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
res=1
end
ors.exrmop(e,tp,res)
end
\ No newline at end of file
--终墟逐退
local m=30015070
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015070.isoveruins=true
--all
--Effect 1
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local loc=LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED
if chkc then return chkc~=e:GetHandler() and chkc:IsLocation(loc) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,loc,loc,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,loc,loc,2,2,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local res=0
local tg=Duel.GetTargetsRelateToChain()
if #tg==0 then return false end
local og=Group.CreateGroup()
if tg==1 then
local yc=tg:GetFirst()
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SendtoHand(yc,nil,REASON_EFFECT)
res=1
else
yc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
og:AddCard(yc)
end
else
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local hg=tg:Select(tp,1,1,nil)
Duel.SendtoHand(hg,nil,REASON_EFFECT)
res=1
Duel.AdjustAll()
local ag=tg-hg
ag:GetFirst():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
og:AddCard(ag:GetFirst())
end
if #og>0 then
og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(og)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
Duel.RegisterEffect(e1,tp)
end
if res==0 then return false end
ors.exrmop(e,tp,res)
end
function cm.thf(c)
return c:GetFlagEffect(m)>0
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if g:FilterCount(cm.thf,nil)==0 then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(cm.thf,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
\ No newline at end of file
--终墟戮反
local m=30015075
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(aux.NegateSummonCondition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(cm.cont)
e4:SetCost(cm.cost)
e4:SetTarget(cm.tgt)
e4:SetOperation(cm.opt)
c:RegisterEffect(e4)
--Effect 2
local e2=ors.redraw(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015075.isoveruins=true
--
function cm.nbcon(tp,re)
local rc=re:GetHandler()
local b1=not rc:IsRelateToEffect(re)
local b2=rc:IsAbleToRemove(tp,POS_FACEDOWN)
return Duel.IsPlayerCanRemove(tp) and (b1 or b2)
end
--cost--
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=daval[0]+daval[1]
if ct==0 then ct=1 end
local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil)
if ct>=#dg then ct=#dg end
local g=Duel.GetDecktopGroup(tp,ct)
if chk==0 then return ct>0 and g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==ct end
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
--Effect 1
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,eg:GetCount(),0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
if not Duel.IsPlayerCanRemove(tp) then return false end
local rg=eg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
--trap and spell
function cm.cont(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function cm.tgt(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
if re:GetActivateLocation()==LOCATION_GRAVE then
e:SetCategory(e:GetCategory()|CATEGORY_GRAVE_ACTION)
else
e:SetCategory(e:GetCategory()&~CATEGORY_GRAVE_ACTION)
end
end
function cm.opt(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEDOWN,REASON_EFFECT)
end
end
--summon
--归墟塌陷
local m=30015080
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--activate
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_ACTIVATE)
e30:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e30)
--maintain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetOperation(cm.mtop)
c:RegisterEffect(e4)
--Effect 1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
--Effect 2
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e12:SetCode(EVENT_PHASE+PHASE_END)
e12:SetRange(LOCATION_SZONE)
e12:SetCountLimit(1)
e12:SetCondition(cm.rstcon)
e12:SetOperation(cm.rstop)
c:RegisterEffect(e12)
--Effect 3
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetCategory(CATEGORY_REMOVE)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.orsmc)
e21:SetTarget(ors.orsmtup)
e21:SetOperation(cm.yleop)
c:RegisterEffect(e21)
local e32=Effect.CreateEffect(c)
e32:SetCategory(CATEGORY_REMOVE)
e32:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e32:SetCode(EVENT_CHAIN_NEGATED)
e32:SetProperty(EFFECT_FLAG_DELAY)
e32:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e32:SetCondition(ors.yycon)
e32:SetTarget(ors.yytg)
e32:SetOperation(cm.yyop)
c:RegisterEffect(e32)
local e33=e32:Clone()
e33:SetCode(EVENT_CUSTOM+30015500)
e33:SetCondition(ors.yycon2)
c:RegisterEffect(e33)
--all
local ge1=ors.alldrawflag(c)
end
c30015080.isoveruins=true
--maintain
function cm.ff(c)
return c:IsFaceup() and (ors.stf(c) or c:IsSummonType(SUMMON_TYPE_ADVANCE))
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.ff,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
if #g==0 then
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
end
--Effect 1
function cm.cff(c)
return not c:IsType(TYPE_TOKEN)
end
function cm.mrf(c,tp)
local b1=c:IsAbleToRemove(tp,POS_FACEDOWN)
local b2=c:IsLocation(LOCATION_GRAVE)
return b1 and b2
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cff,1,nil)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(cm.cff,nil)
local rg=g:Filter(cm.mrf,nil,tp)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,#rg,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local og=Group.CreateGroup()
local g=eg:Filter(cm.cff,nil)
local rg=g:Filter(cm.mrf,nil,tp)
if #rg==0 or Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)==0 then return false end
local og=Duel.GetOperatedGroup()
for tac in aux.Next(og) do
if tac:IsLocation(LOCATION_REMOVED) then
tac:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
end
Duel.Recover(tp,#og*300,REASON_EFFECT)
end
--Effect 2
function cm.rstcon(e,tp,eg,ep,ev,re,r,rp)
local ct=daval[0]+daval[1]
return ct>0
end
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local ct=daval[0]+daval[1]
Duel.Hint(HINT_CARD,0,m)
local dct=ct*50
local rct=ct*100
Duel.SetLP(1-tp,Duel.GetLP(1-tp)-dct)
Duel.Recover(tp,rct,REASON_EFFECT)
end
--Effect 3
function cm.fft(c)
return c:GetFlagEffect(m+100)>0 and c:IsAbleToDeck()
end
function cm.yleop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
local g=Duel.GetMatchingGroup(cm.fft,0,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #g>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if ct>0 then
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
function cm.yyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=e:GetLabelObject()
local g=Duel.GetMatchingGroup(cm.fft,0,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #g>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if dc and dc~=nil then
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
\ No newline at end of file
--终墟殊同
local m=30015081
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(cm.hcon)
c:RegisterEffect(e2)
--activate
local e30=Effect.CreateEffect(c)
e30:SetType(EFFECT_TYPE_ACTIVATE)
e30:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e30)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.rscon)
e1:SetOperation(cm.rsop)
c:RegisterEffect(e1)
--Effect 2
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,1))
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e12:SetCode(EVENT_PHASE+PHASE_END)
e12:SetRange(LOCATION_SZONE)
e12:SetCountLimit(1)
e12:SetCondition(cm.rstcon)
e12:SetOperation(cm.rstop)
c:RegisterEffect(e12)
--Effect 3
local e13=ors.yongxule(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015081.isoveruins=true
--
function cm.ff(c)
return c:IsLevelAbove(5) and c:IsFaceup()
end
function cm.hcon(e)
local g=Duel.GetMatchingGroup(cm.ff,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
return #g>0
end
--Effect 1
function cm.tof(c)
return c:IsAbleToDeck() and c:IsFaceup()
end
function cm.rscon(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.tof,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
return #mg>0
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.tof,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #mg>0 then
Duel.Hint(HINT_CARD,0,m)
local ct=Duel.SendtoDeck(mg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if ct==0 then return false end
Duel.Recover(tp,ct*500,REASON_EFFECT)
end
end
--Effect 2
function cm.dtf(c)
return c:IsFacedown() and c:IsAbleToDeck()
end
function cm.sef(c,tp)
return ors.stf(c) and ors.setf(c,tp)
end
function cm.rstcon(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.dtf,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
return #mg>0
end
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.dtf,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #mg>0 then
Duel.Hint(HINT_CARD,0,m)
local g1=mg:Select(tp,1,#mg,nil)
if #g1>0 then
Duel.SendtoDeck(g1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local ocg=og:Filter(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if #ocg>0 then
Duel.AdjustAll()
local g2=Duel.GetMatchingGroup(cm.sef,tp,LOCATION_DECK,0,nil,tp)
local dct=math.floor(#ocg/5)
if dct>0 and #g2>0 then
local sg=g2:RandomSelect(tp,dct)
for tc in aux.Next(sg) do
if tc==nil then return false end
if tc:IsType(TYPE_FIELD) then
Duel.SSet(tp,tc)
else
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.SSet(tp,tc)
else
Duel.SendtoGrave(tc,REASON_RULE)
end
end
end
end
end
end
end
end
--终墟圣防
local m=30015085
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
--e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local e9=ors.alldrawflag(c)
end
c30015085.isoveruins=true
--Activate
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p1=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local res=0
if #g>0 then
local sg=g:Select(p1,1,2,nil)
--Duel.HintSelection(sg)
if Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)==0 then return false end
res=1
end
ors.exrmop(e,tp,res)
end
--终墟鸟击
local m=30015090
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.postg)
e1:SetOperation(cm.posop)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local e9=ors.alldrawflag(c)
end
c30015090.isoveruins=true
--Activate
function cm.ff(c,tp,loc,e)
local tg=Group.CreateGroup()
tg:AddCard(e:GetHandler())
tg:AddCard(c)
return Duel.IsExistingTarget(nil,tp,loc,loc,2,tg)
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local loc=LOCATION_ONFIELD
local check=Duel.IsExistingTarget(cm.ff,tp,loc,0,1,e:GetHandler(),tp,loc,e)
if chk==0 then return check end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,cm.ff,tp,loc,0,1,1,e:GetHandler(),tp,loc,e)
local tg=Group.CreateGroup()
tg:AddCard(e:GetHandler())
tg:AddCard(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,nil,tp,loc,loc,2,2,tg)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,#g1,0,0)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if Duel.Destroy(sg,REASON_EFFECT)==0 then return false end
local og=Duel.GetOperatedGroup()
local res=1
cm.exrmop(e,tp,res,og)
end
-----
function cm.exrmop(e,tp,res,exg)
if res==0 then return false end
Duel.BreakEffect()
local ec=e:GetHandler()
local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(ors.rf),tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,exg,1-tp)
if #rg>0 and Duel.SelectYesNo(1-tp,aux.Stringid(30015500,4)) and Duel.IsPlayerCanRemove(1-tp) then
Duel.Hint(HINT_CARD,0,ec:GetOriginalCodeRule())
Duel.ConfirmCards(1-tp,rg)
local sg=Group.CreateGroup()
local g2=rg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local g3=rg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local g4=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct=3
if #g2>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,1))
local sg2=g2:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),0,ct,nil,1-tp)
ct=ct-#sg2
sg:Merge(sg2)
end
if #g3>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,2))
local sg3=g3:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),0,ct,nil,1-tp)
ct=ct-#sg3
sg:Merge(sg3)
end
if #g4>0 and ct>0 then
local nt=0
if ct==3 then nt=1 end
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,3))
local sg4=g4:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),nt,ct,nil,1-tp)
ct=ct-#sg4
sg:Merge(sg4)
end
if #sg==0 then return false end
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:FilterCount(Card.IsPreviousLocation,nil,LOCATION_DECK)>0 then
Duel.ShuffleDeck(tp)
end
if og:FilterCount(Card.IsPreviousLocation,nil,LOCATION_EXTRA)>0 then
Duel.ShuffleExtra(tp)
end
end
end
--终墟打落
local m=30015095
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.ddtg)
e1:SetOperation(cm.ddop)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local e9=ors.alldrawflag(c)
end
c30015095.isoveruins=true
--
function cm.selectop(e,tp,mg)
if #mg==0 then return false end
Duel.BreakEffect()
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local sg=mg:RandomSelect(tp,1)
local sgc=sg:GetFirst()
if sgc and Duel.SendtoHand(sgc,tp,REASON_EFFECT)>0
and sgc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,sgc)
end
end
end
--Activate
function cm.ddf(c,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN) and c:IsLocation(LOCATION_HAND)
end
function cm.down(c)
return c:IsFacedown() and c:IsLocation(LOCATION_REMOVED)
end
function cm.tf1(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function cm.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(cm.ddf,nil,tp)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function cm.ddop(e,tp,eg,ep,ev,re,r,rp)
local res=0
local g=eg:Filter(cm.ddf,nil,tp)
if #g>0 and Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)>0 then
res=1
local mg=Duel.GetMatchingGroup(cm.tf1,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #mg<2 then return false end
cm.selectop(e,tp,mg)
Duel.AdjustAll()
mg=Duel.GetMatchingGroup(cm.tf1,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
cm.selectop(e,1-tp,mg)
end
ors.exrmop(e,tp,res)
end
--归墟仲裁·沌涡
local m=30015100
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--not Special Summon
--summonproc or overuins
local e0=ors.summonproc(c,10,6,3)
--Effect 1
local e1=ors.atkordef(c,150,2500)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e7)
--Effect 2
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,0))
e6:SetCategory(CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(cm.con)
e6:SetTarget(cm.tg)
e6:SetOperation(cm.op)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e7)
--Effect 3
local e11=ors.monsterleup(c)
--all
local e9=ors.alldrawflag(c)
end
c30015100.isoveruins=true
--all
--Effect 2
function cm.df(c,rty)
return c:IsType(rty)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and ors.adsumcon(e)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_DECK+LOCATION_EXTRA)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local xg=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
local dg=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if #xg==0 and #dg==0 then return false end
local xc=nil
local dc=nil
if #dg>0 then
dc=Duel.GetDecktopGroup(1-tp,1):GetFirst()
end
local b1= #xg>0 and xg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)>0
local b2= dc~=nil and dc and dc:IsAbleToRemove(tp,POS_FACEDOWN)
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(m,1)},{b2,aux.Stringid(m,2)})
if op==1 then
xc=xg:GetMaxGroup(Card.GetSequence):GetFirst()
Duel.ConfirmCards(tp,xc)
Duel.DisableShuffleCheck()
if Duel.Remove(xc,POS_FACEDOWN,REASON_EFFECT)==0 then return false end
Duel.ShuffleExtra(1-tp)
if c:IsFacedown() or c:GetLocation()~=LOCATION_MZONE then return false end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
else
Duel.ConfirmDecktop(1-tp,1)
Duel.DisableShuffleCheck()
if Duel.Remove(dc,POS_FACEDOWN,REASON_EFFECT)==0 then return false end
local rtype=bit.band(dc:GetType(),0x7)
local rg=Duel.GetMatchingGroup(cm.df,tp,0,LOCATION_ONFIELD,nil,rtype)
if #rg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local xxc=rg:FilterSelect(tp,cm.df,1,1,nil,rtype):GetFirst()
if xxc:IsFacedown() then Duel.ConfirmCards(tp,xxc) end
if xxc==nil or Duel.Remove(xxc,POS_FACEDOWN,REASON_EFFECT)==0 then return false end
end
end
--Effect 3
--终墟解脱
local m=30015105
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015105.isoveruins=true
c30015105[0]=0
c30015105[1]=0
--all
--Effect 1
function cm.nsf(c)
local b1=c:IsSummonType(SUMMON_TYPE_NORMAL)
local b2=c:IsSummonType(SUMMON_TYPE_ADVANCE)
local b3=c:IsSummonType(SUMMON_TYPE_FLIP)
local b4=c:IsSummonType(SUMMON_TYPE_DUAL)
return c:IsFaceup() and (b1 or b2 or b3 or b4)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local p1=e:GetHandlerPlayer()
if Duel.GetTurnPlayer()==p1 then
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(cm.nsf,tp,LOCATION_MZONE,0,1,nil) end
e:SetCategory(CATEGORY_TOGRAVE+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
else
if chk==0 then return true end
e:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p1=e:GetHandlerPlayer()
if Duel.GetTurnPlayer()==p1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
if Duel.SendtoGrave(g,REASON_EFFECT)>0
and Duel.IsExistingMatchingCard(cm.nsf,tp,LOCATION_MZONE,0,1,nil) then
local tag=Duel.GetMatchingGroup(cm.nsf,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(tag) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
else
local e01=Effect.CreateEffect(e:GetHandler())
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e01:SetCode(EVENT_CHAINING)
e01:SetOperation(cm.chainop)
e01:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e01,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(cm.val)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
local res=1
Duel.BreakEffect()
ors.exrmop(e,tp,res)
end
function cm.val(e,re,dam,r,rp,rc)
local tp=e:GetOwnerPlayer()
local ct=daval[0]+daval[1]
local dct
if ct*100>=1500 then
dct=1500
else
dct=ct*100
end
local dval
if dct>=dam then
dval=0
else
dval=dam-dct
end
return dval
end
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if ors.stf(rc) and ep==tp then
Duel.SetChainLimit(cm.chainlm)
end
end
function cm.chainlm(e,ep,tp)
return tp==ep
end
\ No newline at end of file
--终墟戮途
local m=30015110
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SUMMON+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.sumcon)
e1:SetTarget(cm.sumtg)
e1:SetOperation(cm.sumop)
c:RegisterEffect(e1)
--Effect 2
local e2=ors.redraw(c)
--all
local ge1=ors.alldrawflag(c)
end
c30015110.isoveruins=true
--
function cm.excon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler()
return ec:GetFlagEffect(m)==0
end
--Activate
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function cm.sumchk(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function cm.smf(c,e,tp,ph)
local ec=e:GetHandler()
if c:GetOriginalLevel()<5 then return false end
local e11=Effect.CreateEffect(ec)
e11:SetDescription(aux.Stringid(m,0))
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_SUMMON_PROC)
e11:SetCondition(cm.otcontwo)
e11:SetOperation(cm.otoptwo)
e11:SetValue(SUMMON_TYPE_ADVANCE)
e11:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph)
c:RegisterEffect(e11,true)
local e12=e11:Clone()
e12:SetCode(EFFECT_SET_PROC)
e12:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph)
c:RegisterEffect(e12,true)
e11:Reset()
e12:Reset()
local rct
local dmct
local ct=c:GetLevel()
if ct==5 or ct==6 then
rct=1
dmct=2
elseif ct>=7 and ct<10 then
rct=2
dmct=4
elseif ct>=10 then
rct=3
dmct=6
end
local mg=Duel.GetMatchingGroup(ors.srm,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local reg=Duel.GetMatchingGroup(ors.ref,tp,LOCATION_ONFIELD,0,e:GetHandler(),tp)
return c:IsLevelAbove(5) and (#mg>=dmct or #reg>=rct) or cm.sumchk(c)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if chk==0 then return Duel.IsExistingMatchingCard(cm.smf,tp,LOCATION_HAND,0,1,nil,e,tp,ph) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.smf,tp,LOCATION_HAND,0,1,1,nil,e,tp,ph):GetFirst()
if tc then
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(m,0))
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_SUMMON_PROC)
e11:SetCondition(cm.otcontwo)
e11:SetOperation(cm.otoptwo)
e11:SetValue(SUMMON_TYPE_ADVANCE)
e11:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph)
tc:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_SET_PROC)
e12:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph)
tc:RegisterEffect(e12)
--limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetReset(RESET_PHASE+ph)
e1:SetOperation(cm.limitop)
e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp)
--reset when negated
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_NEGATED)
e2:SetOperation(cm.rstop)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE+ph)
Duel.RegisterEffect(e2,tp)
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
end
function cm.cfilter(c,tp)
return c:IsPreviousControler(1-tp)
end
function cm.limitop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
local mg=tc:GetMaterial()
if tc==e:GetLabelObject() and #mg>0 then
local res=1
Duel.BreakEffect()
mg:AddCard(c)
cm.exrmop(e,tp,res,mg)
end
e:Reset()
end
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject()
if e1 then e1:Reset() end
e:Reset()
end
---exremove Check
function cm.exrmop(e,tp,res,exg)
if res==0 then return false end
local ec=e:GetHandler()
local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(ors.rf),tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_ONFIELD,0,exg,1-tp)
if #rg>0 and Duel.SelectYesNo(1-tp,aux.Stringid(30015500,4)) and Duel.IsPlayerCanRemove(1-tp) then
Duel.Hint(HINT_CARD,0,ec:GetOriginalCodeRule())
Duel.ConfirmCards(1-tp,rg)
local sg=Group.CreateGroup()
local g1=rg:Filter(Card.IsLocation,nil,LOCATION_ONFIELD)
local g2=rg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local g3=rg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local g4=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct=3
if #g1>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,0))
local sg1=g1:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),0,ct,exg,1-tp)
ct=ct-#sg1
sg:Merge(sg1)
end
if #g2>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,1))
local sg2=g2:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),0,ct,exg,1-tp)
ct=ct-#sg2
sg:Merge(sg2)
end
if #g3>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,2))
local sg3=g3:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),0,ct,exg,1-tp)
ct=ct-#sg3
sg:Merge(sg3)
end
if #g4>0 and ct>0 then
local nt=0
if ct==3 then nt=1 end
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,3))
local sg4=g4:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),nt,ct,exg,1-tp)
ct=ct-#sg4
sg:Merge(sg4)
end
if #sg==0 then return false end
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
if og:FilterCount(Card.IsPreviousLocation,nil,LOCATION_DECK)>0 then
Duel.ShuffleDeck(tp)
end
if og:FilterCount(Card.IsPreviousLocation,nil,LOCATION_EXTRA)>0 then
Duel.ShuffleExtra(tp)
end
end
end
--proc or overuins II
function cm.procII(c,lv,rmval,reval)
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(30015500,8))
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_SUMMON_PROC)
e11:SetCondition(cm.otcontwo)
e11:SetOperation(cm.otoptwo)
e11:SetValue(SUMMON_TYPE_ADVANCE)
e11:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_SET_PROC)
e12:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e12)
end
function cm.otcontwo(e,c,minc)
if c==nil then return true end
if c:GetLevel()<5 then return false end
local nc=e:GetHandler()
local tp=e:GetHandlerPlayer()
local mg=Duel.GetMatchingGroup(ors.srm,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nc)
local reg=Duel.GetMatchingGroup(ors.ref,tp,LOCATION_ONFIELD,0,nc,tp)
local lv
local rct
local dmct
local ct=c:GetLevel()
if ct==5 or ct==6 then
lv=5
rct=1
dmct=2
elseif ct>=7 and ct<10 then
lv=7
rct=2
dmct=4
elseif ct>=10 then
lv=7
rct=3
dmct=6
end
local exct=math.floor(dmct/2)
local b1=mg:CheckSubGroup(ors.fck,dmct,dmct,tp,exct) and minc<=dmct
local b2=#reg>=rct and minc<=rct
return c:IsLevelAbove(lv) and (b1 or b2)
end
function cm.otoptwo(e,tp,eg,ep,ev,re,r,rp,c)
local code=30015085
local rct
local dmct
local ct=c:GetOriginalLevel()
if ct==5 or ct==6 then
rct=1
dmct=2
elseif ct>=7 and ct<10 then
rct=2
dmct=4
elseif ct>=10 then
rct=3
dmct=6
end
local nc=e:GetHandler()
tp=e:GetHandlerPlayer()
local mg=Duel.GetMatchingGroup(ors.srm,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nc)
local reg=Duel.GetMatchingGroup(ors.ref,tp,LOCATION_ONFIELD,0,nc,tp)
local exct=math.floor(dmct/2)
local b1=mg:CheckSubGroup(ors.fck,dmct,dmct,tp,exct)
local b2=#reg>=rct
if b1 or b2 then
if b1 and (not b2 or Duel.SelectOption(tp,aux.Stringid(code,1),aux.Stringid(code,2))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=mg:SelectSubGroup(tp,ors.fck,false,dmct,dmct,tp,exct)
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEDOWN,REASON_SUMMON+REASON_MATERIAL)
if sg:FilterCount(Card.IsControler,nil,1-tp)>0 then
local te=Duel.IsPlayerAffectedByEffect(tp,30015035)
if te~=nil then te:UseCountLimit(tp) end
end
else
local ssg
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then
ssg=reg:SelectSubGroup(tp,ors.tfck,false,bval,bval,tp)
else
ssg=reg:Select(tp,bval,bval,nil)
end
c:SetMaterial(ssg)
Duel.Release(ssg,REASON_SUMMON+REASON_MATERIAL)
end
end
end
\ No newline at end of file
----
local m=30015115
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
----summonproc or overuins
local e0=ors.summonproc(c,7,4,2)
----Effect 1
local e1=ors.atkordef(c,100,3000)
----Effect 2
local e31=Effect.CreateEffect(c)
e31:SetDescription(aux.Stringid(m,0))
e31:SetCategory(CATEGORY_SUMMON)
e31:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e31:SetCode(EVENT_DAMAGE)
e31:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e31:SetRange(LOCATION_HAND)
e31:SetCountLimit(1)
e31:SetCondition(cm.scon)
e31:SetTarget(cm.stg)
e31:SetOperation(cm.sop)
c:RegisterEffect(e31)
----Effect 3
local e7=ors.monsterle(c)
----all
local e9=ors.alldrawflag(c)
end
c30015115.isoveruins=true
----Effect 2
function cm.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function cm.scon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function cm.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31571902,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(cm.ntcon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local b1=c:IsSummonable(true,nil,1)
local b2=c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
e1:Reset()
if chk==0 then return c:GetLocation(LOCATION_HAND) and (b1 or b2) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
Duel.SetChainLimit(cm.chainlm)
end
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
function cm.sop(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:SetDescription(aux.Stringid(31571902,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(cm.ntcon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
-----
local rt=0
if bit.band(r,REASON_BATTLE)~=0 then rt=1 end
if bit.band(r,REASON_EFFECT)~=0 then rt=2 end
----limit
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e01:SetCode(EVENT_SUMMON_SUCCESS)
e01:SetReset(RESET_PHASE+PHASE_END)
e01:SetOperation(cm.limitop)
e01:SetLabel(rt,ev)
Duel.RegisterEffect(e01,tp)
----reset when negated
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_NEGATED)
e2:SetOperation(cm.rstop)
e2:SetLabelObject(e1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.Summon(tp,c,true,nil)
end
--------
function cm.limitop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
if not tc or tc~=c then return end
local ty,val=e:GetLabel()
if ty==1 then
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_SINGLE)
e01:SetCode(EFFECT_UPDATE_ATTACK)
e01:SetValue(val)
e01:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e01)
Duel.AdjustAll()
local ag=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local dg=Group.CreateGroup()
if #ag==0 then return false end
for tcc in aux.Next(ag) do
local preatk=tcc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tcc:RegisterEffect(e1)
if preatk~=0 and tcc:IsAttack(0) then dg:AddCard(tcc) end
end
if #dg==0 or dg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==0 then return false end
local dmg=dg:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)
Duel.Remove(dmg,POS_FACEDOWN,REASON_EFFECT)
end
if ty==2 then
Duel.Recover(tp,val*3,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(cm.valp)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
e:Reset()
end
function cm.valp(e,re,dam,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then
return math.floor(dam/2)
else return dam end
end
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject()
if e1 then e1:Reset() end
e:Reset()
end
\ No newline at end of file
--终墟落虫
local m=30015120
local cm=_G["c"..m]
if not overuins then dofile("expansions/script/c30015500.lua") end
function cm.initial_effect(c)
--summonproc or overuins
local e0=ors.summonproc(c,6,2,1)
--Effect 1
local e1=ors.atkordef(c,50,2000)
--Effect 2
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_GRAVE_ACTION+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(ors.adsumcon)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW+CATEGORY_GRAVE_ACTION+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(ors.adsumcon)
e3:SetTarget(cm.tg)
e3:SetOperation(cm.op)
c:RegisterEffect(e3)
--Effect 3
local e7=ors.monsterle(c)
--all
local e9=ors.alldrawflag(c)
end
c30015120.isoveruins=true
--Effect 2
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return false end
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,aux.ExceptThisCard(e),tp,POS_FACEDOWN)
if #rg==0 then return false end
local mg=rg:Select(tp,1,2,nil)
if #mg==0 then return false end
local ct=Duel.Remove(mg,POS_FACEDOWN,REASON_EFFECT)
if ct==0 then return false end
ors[tp]=ors[tp]+ct
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetValue(ors[tp]+1)
Duel.RegisterEffect(e1,tp)
end
--终墟库
overuins=overuins or {}
ors=overuins
rkc=rkc or {}
daval=daval or {}
--setname
local cardt,name,exname=GetID()
cardt.isoveruins=true
---------za---------
function ors.stf(c)
return (_G["c"..c:GetCode()]) and _G["c"..c:GetCode()].isoveruins
end
--Release
function ors.recost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
--shangji summon con
function ors.adsumcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
--sumon check
function ors.sumchk(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
--set moxian
function ors.setf(c,tp)
local b1=c:IsType(TYPE_FIELD)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
return c:IsType(TYPE_SPELL+TYPE_TRAP) and (b1 or b2) and c:IsSSetable(true)
end
--summon op
function ors.sumop(e,tp,tcc)
if not tcc or tcc==nil then return false end
if tcc then
local s1=tcc:IsSummonable(true,nil)
local s2=tcc:IsMSetable(true,nil)
if (s1 and s2 and Duel.SelectPosition(tp,tcc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tcc,true,nil)
else
Duel.MSet(tp,tcc,true,nil)
end
end
end
---exremove Check
function ors.rf(c,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function ors.exrmop(e,tp,res)
if res==0 then return false end
Duel.BreakEffect()
local ec=e:GetHandler()
local rg=Duel.GetMatchingGroup(aux.NecroValleyFilter(ors.rf),tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,nil,1-tp)
if #rg>0 and Duel.SelectYesNo(1-tp,aux.Stringid(30015500,4)) and Duel.IsPlayerCanRemove(1-tp) then
Duel.Hint(HINT_CARD,0,ec:GetOriginalCodeRule())
Duel.ConfirmCards(1-tp,rg)
local sg=Group.CreateGroup()
local g2=rg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local g3=rg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local g4=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct=3
if #g2>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,1))
local sg2=g2:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),0,ct,nil,1-tp)
ct=ct-#sg2
sg:Merge(sg2)
end
if #g3>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,2))
local sg3=g3:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),0,ct,nil,1-tp)
ct=ct-#sg3
sg:Merge(sg3)
end
if #g4>0 and ct>0 then
local nt=0
if ct==3 then nt=1 end
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(30015500,3))
local sg4=g4:FilterSelect(1-tp,aux.NecroValleyFilter(ors.rf),nt,ct,nil,1-tp)
ct=ct-#sg4
sg:Merge(sg4)
end
if #sg==0 then return false end
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
Duel.ConfirmCards(tp,og)
if og:FilterCount(Card.IsPreviousLocation,nil,LOCATION_DECK)>0 then
Duel.ShuffleDeck(tp)
end
if og:FilterCount(Card.IsPreviousLocation,nil,LOCATION_EXTRA)>0 then
Duel.ShuffleExtra(tp)
end
end
end
---lechck
function ors.lechk(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp==1-tp and c:GetPreviousControler()==tp then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
--remove flag op
-------ors remove 1 or 3--------
function ors.removeone(e,tp,sc)
local c=e:GetHandler()
if sc and sc~=nil then
local code=sc:GetCode()
loc=LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA
local rrmg=Duel.GetMatchingGroup(ors.coderm,tp,0,loc,nil,tp,code)
if #rrmg==0 then return false end
local rmg=rrmg:RandomSelect(tp,1)
local chka=0
local chkb=0
local chkc=0
if rmg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)>0 then
chka=1
end
if rmg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)>0 then
chkb=1
end
if rmg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)>0 then
chkc=1
end
Duel.Hint(HINT_CARD,0,c:GetOriginalCodeRule())
Duel.BreakEffect()
if Duel.Remove(rmg,POS_FACEDOWN,REASON_EFFECT)==0 then return false end
Duel.ConfirmCards(tp,rmg)
if chka>0 then Duel.ShuffleHand(1-tp) end
if chkb>0 then Duel.ShuffleDeck(1-tp) end
if chkc>0 then Duel.ShuffleExtra(1-tp) end
end
end
function ors.removeall(e,tp,sc)
local c=e:GetHandler()
if sc and sc~=nil then
local code=sc:GetCode()
loc=LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA
local rmg=Duel.GetMatchingGroup(ors.coderm,tp,0,loc,nil,tp,code)
if #rmg==0 then return false end
local chka=0
local chkb=0
local chkc=0
if rmg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)>0 then
chka=1
end
if rmg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)>0 then
chkb=1
end
if rmg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)>0 then
chkc=1
end
Duel.Hint(HINT_CARD,0,c:GetOriginalCodeRule())
Duel.BreakEffect()
if Duel.Remove(rmg,POS_FACEDOWN,REASON_EFFECT)==0 then return false end
Duel.ConfirmCards(tp,rmg)
if chka>0 then Duel.ShuffleHand(1-tp) end
if chkb>0 then Duel.ShuffleDeck(1-tp) end
if chkc>0 then Duel.ShuffleExtra(1-tp) end
end
end
--------ors yongxu yiyan-------
function ors.yongxule(c)
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetCategory(CATEGORY_REMOVE)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.orsmc)
e21:SetTarget(ors.orsmtup)
e21:SetOperation(ors.yleop)
c:RegisterEffect(e21)
local e32=Effect.CreateEffect(c)
e32:SetCategory(CATEGORY_REMOVE)
e32:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e32:SetCode(EVENT_CHAIN_NEGATED)
e32:SetProperty(EFFECT_FLAG_DELAY)
e32:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e32:SetCondition(ors.yycon)
e32:SetTarget(ors.yytg)
e32:SetOperation(ors.yyop)
c:RegisterEffect(e32)
local e33=e32:Clone()
e33:SetCode(EVENT_CUSTOM+30015500)
e33:SetCondition(ors.yycon2)
c:RegisterEffect(e33)
return e20,e21,e32,e33
end
function ors.yleop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if ct>0 then
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
--negop--
function ors.yycon(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
local dc=de:GetHandler()
if de and de~=nil and dc:IsControler(1-tp) then
e:SetLabelObject(dc)
end
return rp==tp and de and de~=nil and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de
end
function ors.yycon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c==re:GetHandler() and c:GetReasonEffect()==nil
end
function ors.yytg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetFlagEffect(30015500)
local dc=e:GetLabelObject()
if chk==0 then return true end
local sg=Group.FromCards(c)
if ct>0 then
Duel.SetTargetParam(1)
end
if dc and dc~=nil then
Duel.SetTargetCard(dc)
sg:AddCard(dc)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,e:GetHandler(),0,0)
end
function ors.yyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dc=e:GetLabelObject()
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if dc and dc~=nil then
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
--------ors monster yiyan-------
function ors.monsterle(c)
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.orsmc)
e21:SetTarget(ors.orsmt)
e21:SetOperation(ors.orsmp)
c:RegisterEffect(e21)
return e20,e21
end
function ors.monsterleup(c)
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.orsmc)
e21:SetTarget(ors.orsmtup)
e21:SetOperation(ors.orsmpup)
c:RegisterEffect(e21)
return e20,e21
end
function ors.coderm(c,tp,code)
return c:IsAbleToRemove(tp,POS_FACEDOWN) and c:IsCode(code)
end
function ors.orsmc(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function ors.orsmt(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if chk==0 then return true end
local sg=Group.FromCards(c)
if ct>0 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
end
if ct>0 then
loc=LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA
local xg=sg:Clone()
xg:RemoveCard(c)
local rmg=Duel.GetMatchingGroup(ors.coderm,tp,0,loc,nil,tp,xg:GetFirst():GetCode())
rmg:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rmg,2,0,0)
else
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
end
end
function ors.orsmp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
local dp=e:GetOwnerPlayer()
if ct>0 then
ors[dp]=ors[dp]+2
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,5))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,5))
else
ors[dp]=ors[dp]+1
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetValue(ors[dp]+1)
Duel.RegisterEffect(e1,dp)
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if ct>0 then
local sc=Duel.GetFirstTarget()
ors.removeone(e,tp,sc)
end
end
function ors.orsmtup(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if chk==0 then return true end
local sg=Group.FromCards(c)
if ct>0 then
local rc=c:GetReasonCard()
local re=c:GetReasonEffect()
if not rc and re then
local sc=re:GetHandler()
if not rc then
Duel.SetTargetCard(sc)
sg:AddCard(sc)
end
end
if rc then
Duel.SetTargetCard(rc)
sg:AddCard(rc)
end
end
if ct>0 then
loc=LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA
local xg=sg:Clone()
xg:RemoveCard(c)
local rmg=Duel.GetMatchingGroup(ors.coderm,tp,0,loc,nil,tp,xg:GetFirst():GetCode())
rmg:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rmg,#rmg,0,0)
else
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,#sg,0,0)
end
end
function ors.orsmpup(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
local dp=e:GetOwnerPlayer()
if ct>0 then
ors[dp]=ors[dp]+2
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,5))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,5))
else
ors[dp]=ors[dp]+1
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetValue(ors[dp]+1)
Duel.RegisterEffect(e1,dp)
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
if ct>0 then
local sc=Duel.GetFirstTarget()
ors.removeall(e,tp,sc)
end
end
--remove flag
--------atkdef or ors-------
function ors.atkordef(c,vala,valb)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ors.atkval)
e1:SetLabel(vala,valb)
c:RegisterEffect(e1)
if not ors.remove then
ors.remove=true
daval[0]=0
daval[1]=0
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetCode(EVENT_REMOVE)
ge0:SetOperation(ors.amp)
Duel.RegisterEffect(ge0,0)
end
end
function ors.ft1(c)
local tc=c:GetReasonCard()
local re=c:GetReasonEffect()
local b1= tc and tc~=nil and ors.stf(tc)
local b2=re and re~=nil and ors.stf(re:GetHandler())
return c:IsLocation(LOCATION_REMOVED) and (b1 or b2)
end
function ors.amp(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(ors.ft1,nil)
if ct>0 then
daval[Duel.GetTurnPlayer()]=daval[Duel.GetTurnPlayer()]+ct
end
end
function ors.atkval(e,c)
local va,vb=e:GetLabel()
--100,2000
local ct=daval[0]+daval[1]
if ct*va<=vb then
return vb
else
return ct*va
end
end
--all or overuins
function ors.alldrawflag(c)
if not ors.counter then
ors.counter=true
ors[0]=0
ors[1]=0
rkc[0]=0
rkc[1]=0
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetCode(EVENT_DRAW)
ge0:SetCondition(ors.exdrcon)
ge0:SetOperation(ors.rmexdr)
Duel.RegisterEffect(ge0,0)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_NEGATED)
ge1:SetOperation(ors.alne)
Duel.RegisterEffect(ge1,0)
--local ge3=Effect.CreateEffect(c)
--ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
--ge3:SetCode(EVENT_ADJUST)
--ge3:SetOperation(ors.rmexdrx)
--Duel.RegisterEffect(ge3,0)
end
end
function ors.exdrcon(e,tp,eg,ep,ev,re,r,rp)
local b2=Duel.GetCurrentPhase()==PHASE_DRAW
return r==REASON_RULE and b2
end
function ors.rmexdr(e,tp,eg,ep,ev,re,r,rp)
ors[ep]=0
end
function ors.rmexdrx(e,tp,eg,ep,ev,re,r,rp)
local ct=rkc[tp]+rkc[1-tp]
local tunp=Duel.GetTurnPlayer()
if Duel.GetTurnCount()==1 and Duel.GetLP(tunp)>=16000 and ct==0 then
rkc[tunp]=rkc[tunp]+1
Debug.Message(rkc[tunp])
end
end
function ors.alne(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local lp=re:GetOwnerPlayer()
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
if de and de~=nil then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetOperation(ors.negevent)
e1:SetLabelObject(re)
Duel.RegisterEffect(e1,re:GetOwnerPlayer())
if dp and rc:GetPreviousControler()==lp and dp==1-lp then
rc:RegisterFlagEffect(30015500,RESET_PHASE+PHASE_END,0,1)
end
end
end
function ors.negevent(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local lp=te:GetOwnerPlayer()
Duel.RaiseEvent(te:GetHandler(),EVENT_CUSTOM+30015500,te,0,lp,lp,0)
e:Reset()
end
--draw or overuins
function ors.redraw(c)
local e20=Effect.CreateEffect(c)
e20:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e20:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e20:SetCode(EVENT_LEAVE_FIELD_P)
e20:SetOperation(ors.lechk)
c:RegisterEffect(e20)
local e21=Effect.CreateEffect(c)
e21:SetDescription(aux.Stringid(30015500,6))
e21:SetCategory(CATEGORY_REMOVE)
e21:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e21:SetProperty(EFFECT_FLAG_DELAY)
e21:SetCode(EVENT_LEAVE_FIELD)
e21:SetLabelObject(e20)
e21:SetCondition(ors.impcon)
e21:SetTarget(ors.imptg)
e21:SetOperation(ors.impop)
c:RegisterEffect(e21)
local e32=Effect.CreateEffect(c)
e32:SetCategory(CATEGORY_REMOVE)
e32:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e32:SetCode(EVENT_CHAIN_NEGATED)
e32:SetProperty(EFFECT_FLAG_DELAY)
e32:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e32:SetCondition(ors.tthcon)
e32:SetTarget(ors.tthtg)
e32:SetOperation(ors.tthop)
c:RegisterEffect(e32)
local e33=e32:Clone()
e33:SetCode(EVENT_CUSTOM+30015500)
e33:SetCondition(ors.tthcon2)
c:RegisterEffect(e33)
return e20,e21,e32,e33
end
--negate--
function ors.tthcon(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
return rp==tp and de and de~=nil and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and e:GetHandler()==re:GetHandler() and e:GetHandler():GetReasonEffect()==de
end
function ors.tthcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c==re:GetHandler() and c:GetReasonEffect()==nil
end
function ors.lechk(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp==1-tp and c:GetPreviousControler()==tp then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function ors.impcon(e,tp,eg,ep,ev,re,r,rp) --rp==1-tp and
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function ors.imptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=e:GetLabelObject():GetLabel()
if chk==0 then return true end
if ct>0 then
Duel.SetTargetParam(1)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function ors.impop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local dp=e:GetOwnerPlayer()
if num>0 then
ors[dp]=ors[dp]+2
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,5))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,5))
else
ors[dp]=ors[dp]+1
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetValue(ors[dp]+1)
Duel.RegisterEffect(e1,dp)
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
end
function ors.tthtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=c:GetFlagEffect(30015500)
if chk==0 then return true end
if ct>0 then
Duel.SetTargetParam(1)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function ors.tthop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local dp=e:GetOwnerPlayer()
if num>0 then
ors[dp]=ors[dp]+2
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(30015500,5))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(30015500,5))
else
ors[dp]=ors[dp]+1
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetValue(ors[dp]+1)
Duel.RegisterEffect(e1,dp)
if c:IsRelateToEffect(e) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
end
----linshi------------
--proc or overuins
function ors.summonproc(c,lv,rmval,reval)
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(30015500,8))
e11:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_SUMMON_PROC)
e11:SetCondition(ors.otcon)
e11:SetOperation(ors.otop)
e11:SetValue(SUMMON_TYPE_ADVANCE)
e11:SetLabel(lv,rmval,reval)
c:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e12)
end
function ors.srm(c)
return c:IsAbleToRemoveAsCost(POS_FACEDOWN) and not c:IsType(TYPE_TOKEN)
end
function ors.ref(c,tp)
local te=c:IsHasEffect(EFFECT_UNRELEASABLE_SUM)
local code=c:GetOriginalCodeRule()
if te~=nil or code==48411997 then return false end
return ors.stf(c)
end
function ors.fck(g,tp,ct)
local b1=g:FilterCount(Card.IsControler,nil,1-tp)<=ct
local b2=Duel.GetMZoneCount(tp,g)>0
return b1 and b2
end
function ors.tfck(g,tp)
local b1=g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0
local b2=Duel.GetMZoneCount(tp,g)>0
return b1 and b2
end
function ors.otcon(e,c,minc)
if c==nil then return true end
local ct,aval,bval=e:GetLabel()
local tp=e:GetHandlerPlayer()
local mg=Duel.GetMatchingGroup(ors.srm,tp,LOCATION_ONFIELD,0,nil)
local reg=Duel.GetMatchingGroup(ors.ref,tp,LOCATION_ONFIELD,0,nil,tp)
if Duel.IsPlayerAffectedByEffect(tp,30015035)
or c:GetFlagEffect(30015035)>0 then
local mg1=Duel.GetMatchingGroup(ors.srm,tp,0,LOCATION_ONFIELD,nil)
mg:Merge(mg1)
end
local lv
local bct
if ct==5 or ct==6 then
lv=5
bct=1
elseif ct>=7 and ct<10 then
lv=7
bct=2
elseif ct>=10 then
lv=10
bct=3
end
local ckval=math.floor(aval/2)
local b1=mg:CheckSubGroup(ors.fck,aval,aval,tp,ckval) and minc<=aval
local b2=#reg>=bval and minc<=bval
return c:IsLevelAbove(lv) and (b1 or b2)
end
function ors.otop(e,tp,eg,ep,ev,re,r,rp,c)
local code=30015085
local ct,aval,bval=e:GetLabel()
tp=e:GetHandlerPlayer()
local mg=Duel.GetMatchingGroup(ors.srm,tp,LOCATION_ONFIELD,0,nil)
local reg=Duel.GetMatchingGroup(ors.ref,tp,LOCATION_ONFIELD,0,nil,tp)
if Duel.IsPlayerAffectedByEffect(tp,30015035)
or c:GetFlagEffect(30015035)>0 then
local mg1=Duel.GetMatchingGroup(ors.srm,tp,0,LOCATION_ONFIELD,nil)
mg:Merge(mg1)
end
local ckval=math.floor(aval/2)
local b1=mg:CheckSubGroup(ors.fck,aval,aval,tp,ckval)
local b2=#reg>=bval
if b1 or b2 then
if b1 and (not b2 or Duel.SelectOption(tp,aux.Stringid(code,1),aux.Stringid(code,2))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=mg:SelectSubGroup(tp,ors.fck,false,aval,aval,tp,ckval)
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEDOWN,REASON_SUMMON+REASON_MATERIAL)
if sg:FilterCount(Card.IsControler,nil,1-tp)>0 then
local te=Duel.IsPlayerAffectedByEffect(tp,30015035)
if te~=nil then te:UseCountLimit(tp) end
end
else
local ssg
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then
ssg=reg:SelectSubGroup(tp,ors.tfck,false,bval,bval,tp)
else
ssg=reg:Select(tp,bval,bval,nil)
end
c:SetMaterial(ssg)
Duel.Release(ssg,REASON_SUMMON+REASON_MATERIAL)
end
end
end
\ No newline at end of file
local m=53721016
local cm=_G["c"..m]
cm.name="悚牢巨擘"
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,cm.matfilter,nil,nil,cm.matfilter2,1,99)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,m)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m+50)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.matfilter(c,syncard)
return c:IsTuner(syncard) or c:IsRace(RACE_FISH)
end
function cm.matfilter2(c,syncard)
return c:IsNotTuner(syncard) and c:IsRace(RACE_FISH)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
local g=Duel.GetOperatedGroup()
e:SetLabelObject(g:GetFirst())
end
function cm.filter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsRace(RACE_SEASERPENT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
if e:GetLabelObject():IsRace(RACE_FISH) then Duel.SetChainLimit(cm.chainlm) end
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetLabelObject():IsAttribute(ATTRIBUTE_WATER) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and e:GetLabelObject():IsRace(RACE_FISH) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetLabelObject(tc)
e1:SetOperation(cm.chainop)
Duel.RegisterEffect(e1,tp)
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_LEAVE_FIELD_P)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e0:SetLabelObject(e1)
e0:SetOperation(cm.chk)
tc:RegisterEffect(e0)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end
end
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler()==e:GetLabelObject() then Duel.SetChainLimit(cm.chainlm) end
end
function cm.chk(e,tp,eg,ep,ev,re,r,rp)
local c,le=e:GetHandler(),e:GetLabelObject()
local te=c:GetReasonEffect()
if c:GetFlagEffect(m)==0 or not te or not te:IsActivated() or te:GetHandler()~=c then le:Reset() else
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_CHAIN_END)
e0:SetLabelObject(le)
e0:SetOperation(cm.resetop)
Duel.RegisterEffect(e0,tp)
end
end
function cm.resetop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject() then e:GetLabelObject():Reset() end
e:Reset()
end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsLevel(7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.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
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