Commit e322df0b authored by 竹中千惠理's avatar 竹中千惠理

8.19修复

parent 3e9b767a
No preview for this file type
No preview for this file type
......@@ -79,7 +79,7 @@ function c60010095.spop(e,tp,eg,ep,ev,re,r,rp)
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
if tc:IsSetCard(0x634) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -111,8 +111,8 @@ function c60010095.cfmop(e,tp,eg,ep,ev,re,r,rp)
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x634) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x634):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
......@@ -127,10 +127,10 @@ function c60010095.cfmop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
end
function c60010095.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010095)
return c:IsSetCard(0x634) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010095)
end
function c60010095.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
return c:IsSetCard(0x634) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010095.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceup()
......
......@@ -78,7 +78,7 @@ function c60010096.spop(e,tp,eg,ep,ev,re,r,rp)
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
if tc:IsSetCard(0x634) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -110,8 +110,8 @@ function c60010096.cfmop(e,tp,eg,ep,ev,re,r,rp)
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x634) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x634):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
......@@ -126,10 +126,10 @@ function c60010096.cfmop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
end
function c60010096.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010096)
return c:IsSetCard(0x634) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010096)
end
function c60010096.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
return c:IsSetCard(0x634) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010096.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceup()
......
......@@ -78,7 +78,7 @@ function c60010097.spop(e,tp,eg,ep,ev,re,r,rp)
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
if tc:IsSetCard(0x634) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -110,8 +110,8 @@ function c60010097.cfmop(e,tp,eg,ep,ev,re,r,rp)
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x634) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x634):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
......@@ -126,10 +126,10 @@ function c60010097.cfmop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
end
function c60010097.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010097)
return c:IsSetCard(0x634) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010097)
end
function c60010097.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
return c:IsSetCard(0x634) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010097.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceup()
......
......@@ -78,7 +78,7 @@ function c60010098.spop(e,tp,eg,ep,ev,re,r,rp)
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
if tc:IsSetCard(0x634) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -110,8 +110,8 @@ function c60010098.cfmop(e,tp,eg,ep,ev,re,r,rp)
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x634) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x634):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
......@@ -126,10 +126,10 @@ function c60010098.cfmop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
end
function c60010098.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010098)
return c:IsSetCard(0x634) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010098)
end
function c60010098.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
return c:IsSetCard(0x634) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010098.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceupEx()
......
......@@ -29,7 +29,7 @@ function c60010099.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c60010099.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
return c:IsSetCard(0x634) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c60010099.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c60010099.thfilter,tp,LOCATION_DECK,0,1,nil) end
......@@ -67,7 +67,7 @@ function c60010099.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
if op==3 then
......@@ -76,9 +76,9 @@ function c60010099.disop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g1:GetCount()>0 then
Duel.HintSelection(g1)
Duel.Destroy(g1,REASON_EFFECT)
end
end
Duel.Destroy(g1,REASON_EFFECT)
end
end
end
end
......@@ -44,7 +44,7 @@ function c60010100.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x634) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010100,RESET_PHASE+PHASE_END,0,1) end
......@@ -72,7 +72,7 @@ function c60010100.cfmop(e,tp,eg,ep,ev,re,r,rp)
end
--
function c60010100.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632)
return c:IsFaceup() and c:IsSetCard(0x634)
end
function c60010100.condition(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c60010100.cfilter,1,nil)
......
......@@ -40,7 +40,7 @@ function c60010101.thcon(e,tp,eg,ep,ev,re,r,rp)
return Card.GetFlagEffect(c,60010095)~=0 and Card.GetFlagEffect(c,60010096)~=0 and Card.GetFlagEffect(c,60010097)~=0
end
function c60010101.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand()
return c:IsSetCard(0x634) and c:IsAbleToHand()
end
function c60010101.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -28,14 +28,14 @@ function c60010102.initial_effect(c)
c:RegisterEffect(e2)
end
function c60010102.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632) and c:IsType(TYPE_RITUAL)
return c:IsFaceup() and c:IsSetCard(0x634) and c:IsType(TYPE_RITUAL)
end
function c60010102.handcon(e)
return Duel.IsExistingMatchingCard(c60010102.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--
function c60010102.cfmfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632)
return c:IsFaceup() and c:IsSetCard(0x634)
end
function c60010102.cfmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -45,7 +45,7 @@ function c60010103.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x634) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010103,RESET_PHASE+PHASE_END,0,1) end
......@@ -123,7 +123,7 @@ function c60010103.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x632))
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x634))
e1:SetValue(c60010103.efilter)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+RESET_CHAIN)
......
......@@ -36,7 +36,7 @@ function c60010104.initial_effect(c)
end
end
function c60010104.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632)
return c:IsFaceup() and c:IsSetCard(0x634)
end
function c60010104.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c60010104.cfilter,tp,LOCATION_MZONE,0,1,nil)
......@@ -68,7 +68,7 @@ function c60010104.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x634) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010104,RESET_PHASE+PHASE_END,0,1) end
......
......@@ -56,7 +56,7 @@ function c60010105.thcon(e,tp,eg,ep,ev,re,r,rp)
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c60010105.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand()
return c:IsSetCard(0x634) and c:IsAbleToHand()
end
function c60010105.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60010105.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
......@@ -76,7 +76,7 @@ function c60010105.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x634) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010105,RESET_PHASE+PHASE_END,0,1) end
......@@ -134,7 +134,7 @@ function c60010105.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x632))
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x634))
e1:SetValue(c60010105.efilter)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+RESET_CHAIN)
......
--贝洛伯格-永屹坚城-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.deftg)
e2:SetValue(cm.defval)
c:RegisterEffect(e2)
--switch locations
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END+TIMING_END_PHASE)
e3:SetTarget(cm.chtg)
e3:SetOperation(cm.chop)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(50,m)
e3:SetCondition(cm.regcon)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
end
function cm.deftg(e,c)
return c:IsPosition(POS_FACEUP_DEFENSE)
end
function cm.defval(e,c)
local num=Duel.GetCounter(c:GetControler(),LOCATION_ONFIELD,0,0x629)
return num*500
end
function cm.chfilter(c)
return aux.TRUE
end
function cm.gcheck(g)
return g:GetClassCount(Card.GetControler)==1
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.chfilter,tp,LOCATION_ONFIELD,0,c)
if chk==0 then return g:CheckSubGroup(cm.gcheck,2,2) and Duel.IsPlayerCanDraw(tp,1) end
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.chfilter,tp,LOCATION_ONFIELD,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,cm.gcheck,false,2,2)
if sg and #sg==2 then
Duel.SendtoGrave(sg,REASON_EFFECT)
if #Duel.GetOperatedGroup()==2 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
return #g~=0 and #g==#g:Filter(Card.IsPosition,nil,POS_DEFENSE)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(c,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=c:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=c:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(c,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
--佩拉-至远雪原-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.spfil(c,tuner)
local g=Duel.GetMatchingGroup(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE):RemoveCard(tuner)
return c:IsSynchroSummonable(tuner,g)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(cm.spfil,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(cm.spfil,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local lg=Duel.GetMatchingGroup(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE):RemoveCard(c)
Duel.SynchroSummon(tp,sg:GetFirst(),c,lg)
end
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)~=0
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=400
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=800
end
for c in aux.Next(Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-i)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-i)
c:RegisterEffect(e1)
end
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
Duel.Damage(1-tp,200,REASON_EFFECT)
end
end
\ No newline at end of file
--晚安与睡颜
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,4,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,4,REASON_COST)
end
function cm.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) 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_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.op(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.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--杰帕德-不屈之盾-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
aux.AddSynchroProcedure(c,cm.synfilter,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--target/atk protection
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetValue(cm.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(cm.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetCondition(cm.icon)
e3:SetTarget(cm.indtg)
e3:SetValue(cm.efilter)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.synfilter(c)
return c:GetCounter(0x629)>0
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
function cm.tglimit(e,c)
return c~=e:GetHandler()
end
function cm.icon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsPlayerAffectedByEffect(tp,m+1)
end
function cm.indtg(e,c)
return c:IsFaceup() and c:GetCounter(0x629)>0
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(300)
e:GetHandler():RegisterEffect(e1)
end
\ No newline at end of file
--制胜的瞬间
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,1,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--布洛妮娅-存护之志-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:SetUniqueOnField(1,0,m)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--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:SetCondition(cm.condition)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(50,m)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=c:GetControler()
local cd=Duel.GetMatchingGroup(Card.IsCode,i,LOCATION_ONFIELD,0,nil,m):GetFirst()
if cd==nil then return end
local nnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)-cd:GetCounter(0x629)
if cm.cnum~=nnum then
cm.cnum=nnum
Duel.RaiseEvent(cd,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsCanRemoveCounter(tp,1,0,0x629,1,REASON_EFFECT)
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_DEFENSE)
c:AddCounter(0x629,1)
end
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=2
end
e:GetHandler():AddCounter(0x629,i)
end
\ No newline at end of file
--但战斗还未结束
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,12,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,12,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return #g==0 and Duel.GetFlagEffect(tp,m)<10
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
--希儿-蝶立锋锷-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCost(cm.spcost)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.plfilter(c)
return Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsFaceup()
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
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
local g=Duel.GetMatchingGroup(cm.plfilter,tp,LOCATION_ONFIELD,0,nil)
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
function cm.filter(c)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsAbleToHand()
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToGrave()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
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.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,3,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,3,REASON_COST)
end
function cm.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and not c:IsCode(m)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return eg:IsExists(cm.spcfilter,1,nil,tp)
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--于夜色中
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.filter(c,e,tp)
return c:IsCode(m-1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,6,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,6,REASON_COST)
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+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.op(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.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--希露瓦-永动强音-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.matfilter,2,true)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.matfilter(c)
return c:GetBaseAttack()==0
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
local num=Duel.GetOperatedGroup()
if num~=0 then
c:AddCounter(0x629,num)
end
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and (Duel.GetFlagEffect(tp,m)<3 or (Duel.GetFlagEffect(tp,m)<5 and Duel.IsPlayerAffectedByEffect(tp,m+1)))
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
if #g~=0 then
Duel.Destroy(g,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
\ No newline at end of file
--别让世界静下来
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,5,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,5,REASON_COST)
end
function cm.filter0(c)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function cm.filter1(c,e)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:GetBaseAttack()==0 and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat:Filter(cm.cfilter,nil):GetCount()>0 then
local cg=mat:Filter(cm.cfilter,nil)
Duel.HintSelection(cg)
end
Duel.SendtoDeck(mat,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function cm.cfilter(c)
return c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup())
end
\ No newline at end of file
--克拉拉-长久陪伴-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.thfilter(c)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) 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
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerCanDraw(tp,1)
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
if tc:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,tc) and tc:IsType(TYPE_MONSTER) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil):GetFirst()
if Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1,true)
end
end
else
Duel.BreakEffect()
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)
end
Duel.ShuffleHand(tp)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(tp,m+1)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON+REASON_DISCARD)
end
\ No newline at end of file
--无可取代的东西
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,8,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,8,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return #Duel.GetDecktopGroup(1-tp,5)==5 end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(1-tp,5)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--虎克-冒险集结-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.mfilter,1)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(cm.drcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.mfilter(c)
return c:GetCounter(0x629)>0
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.filter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToGrave()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (Duel.GetTurnCount()~=c:GetTurnID() or c:IsReason(REASON_RETURN)) and Duel.IsPlayerAffectedByEffect(tp,m+1)
end
function cm.drfilter(c,e)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsAbleToDeck() and c:IsCanBeEffectTarget(e)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(cm.drfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and g:GetClassCount(Card.GetCode)>4 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,5,5)
aux.GCheckAdditional=nil
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--鼹鼠党欢迎你
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,1,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,1000,REASON_EFFECT)
end
--玲可-至远雪原-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,4,2)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.filter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) 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.rmfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.rmfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=400
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=800
end
Duel.Recover(tp,i,REASON_EFFECT)
end
\ No newline at end of file
--暖夜不会漫长
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,2,REASON_COST)
end
function cm.tg(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.op(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
--娜塔莎-遍世仁心-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.rthtg)
e3:SetOperation(cm.rthop)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local u=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
u=3
end
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,u)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,u)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.rthfilter(c)
return c:IsAbleToHand() and c:GetCounter(0x629)>0
end
function cm.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(cm.rthfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,cm.rthfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,g1:GetCount(),0,LOCATION_ONFIELD)
end
function cm.rthop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
local ctable={}
for tc in aux.Next(g) do
if tc:IsControler(tp) then
ctable[tc]=tc:GetCounter(0x629)
end
end
Duel.SendtoHand(g,nil,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local ct=0
for tc,num in pairs(ctable) do
if og:IsContains(tc) and tc:IsLocation(LOCATION_HAND) then
ct=ct+num
end
end
if ct>0 then
Duel.BreakEffect()
e:GetHandler():AddCounter(0x629,ct)
end
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerCanDiscardDeck(tp,1)
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.DiscardDeck(tp,1,REASON_EFFECT)
end
--一场术后对话
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,6,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,6,REASON_COST)
end
function cm.filter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToGrave()
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--卢卡-不休争斗-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--attack twice
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e4:SetCondition(cm.atkcon)
e4:SetValue(1)
c:RegisterEffect(e4)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local u=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
u=3
end
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,u)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,u)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=2
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(Duel.GetCounter(tp,LOCATION_ONFIELD,0,0x629)*100)
e:GetHandler():RegisterEffect(e1)
end
function cm.atkcon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsPlayerAffectedByEffect(tp,m+1)
end
\ No newline at end of file
--决心如汗珠般闪耀
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,5,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,5,REASON_COST)
end
function cm.filter(c)
return c:IsType(TYPE_MONSTER) and not c:IsPosition(POS_FACEUP_ATTACK)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
--桑博-假面幻想-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.desreptg)
e2:SetValue(cm.desrepval)
e2:SetOperation(cm.desrepop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsCanRemoveCounter(tp,1,0,0x629,3,REASON_COST)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
if Duel.RemoveCounter(tp,1,0,0x629,3,REASON_COST)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 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_DEFENSE)
end
end
end
function cm.repfilter(c,tp)
return c:IsControler(tp) and c:IsOnField() and (c:IsPosition(POS_FACEUP_DEFENSE) or c:IsLocation(LOCATION_SZONE))
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.desrepval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.desrepop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(e:GetHandlerPlayer(),m)<3 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),m,RESET_PHASE+PHASE_END,0,1)
end
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
c:AddCounter(0x629,1)
end
Duel.Hint(HINT_CARD,0,m)
end
\ No newline at end of file
--猎物的视线
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,3,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,3,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(0,1)
e3:SetValue(cm.aclimit2)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.aclimit2(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE or re:GetActivateLocation()==LOCATION_HAND
end
\ No newline at end of file
--星-存护-
local cm,m,o=GetID()
function cm.initial_effect(c)
for i=0,0xffff do
c:EnableCounterPermit(i,LOCATION_ONFIELD)
end
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--target/atk protection
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetCondition(cm.atcon)
e2:SetValue(cm.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(cm.atcon)
e3:SetTarget(cm.tglimit)
e3:SetValue(aux.tgoval)
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_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.preservationcheck then
cm.lastcounter=0
cm.counterchange=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=c:GetControler()
local counternum=0
for i=0,0xffff do
counternum=counternum+Duel.GetCounter(p,LOCATION_ONFIELD,0,i)
end
if cm.lastcounter~=counternum then
cm.counterchange=math.abs(cm.lastcounter-counternum)
cm.lastcounter=counternum
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,p,p,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)>=5 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,0,1,nil)
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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.levelchangecon)
e1:SetOperation(cm.levelchangeop)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
for i=0,0xffff do
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(EVENT_ADJUST)
e0:SetLabel(i)
e0:SetCondition(cm.countercon)
e0:SetOperation(cm.counterop)
e0:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e0)
end
end
end
function cm.levelchangecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetLevel()~=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13)
end
function cm.levelchangeop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function cm.countercon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local tf=false
if Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=c:GetCounter(i) and c:GetCounter(i)~=c:GetLevel() and Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=0 then
tf=true
end
return tf
end
function cm.counterop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local lv=c:GetLevel()
local ct=c:GetCounter(i)
if ct>lv then
c:RemoveCounter(tp,i,ct-lv,REASON_RULE)
elseif ct<lv then
c:AddCounter(i,lv-ct)
Debug.Message(i)
end
end
function cm.atcon(e)
return e:GetHandler():GetDefense()~=0
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
function cm.tglimit(e,c)
return c~=e:GetHandler()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.counterchange*400)
c:RegisterEffect(e1)
Duel.Recover(tp,cm.counterchange*400,REASON_EFFECT)
end
--心相笞魔·妮芙
local cm,m,o=GetID()
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_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tdtg)
e1:SetOperation(cm.tdop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--cannot be target/effect indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.dcon)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(aux.indoval)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return false end
local g=Duel.GetDecktopGroup(tp,3)
local result=g:FilterCount(Card.IsAbleToHand,nil)>0
return result
end
Duel.SetTargetPlayer(tp)
end
function cm.tdfilter(c)
return c:IsAbleToHand() and aux.IsCodeListed(c,60010168) and c:IsType(TYPE_TRAP)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.ConfirmDecktop(p,3)
local g=Duel.GetDecktopGroup(p,3)
if not g or #g<3 then return end
g=g:Filter(cm.tdfilter,nil)
local ct=3
if #g>0 and Duel.SelectYesNo(p,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil)
Duel.DisableShuffleCheck()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.ShuffleHand(p)
ct=ct-1
end
Duel.SortDecktop(p,p,ct)
for i=1,ct do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
end
function cm.dcon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c)
end
function cm.setfilter(c)
return aux.IsCodeListed(c,60010168) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function cm.pfilter(c,tp)
return c:IsType(TYPE_CONTINUOUS) and aux.IsCodeListed(c,60010168)
and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,nil)
if #g==0 and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
elseif #g==#g:Filter(Card.IsFaceup,nil) and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
elseif #g==#g:Filter(Card.IsFacedown,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.pfilter,tp,LOCATION_DECK,0,1,nil,tp) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.pfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end
end
end
--无终奇语
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010168)
--e0
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCost(cm.accost)
e2:SetDescription(aux.Stringid(m,1))
c:RegisterEffect(e2)
--e1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
--e0
function cm.accost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if tc and aux.IsCodeListed(tc,60010168) then
if tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_COST,tp,tp,0)
else
Duel.ChangePosition(tc,POS_FACEUP)
local te=tc:GetActivateEffect()
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=tc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
tc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
end
else
Duel.SendtoGrave(tc,REASON_COST)
end
end
--e1
function cm.filter(c,e,tp)
return c:IsCode(m-1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,2,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
--e2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_FIEND or c:GetLevel()<5
end
--e3
function cm.thfilter(c)
return c:IsType(TYPE_MONSTER+TYPE_CONTINUOUS)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,c)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_COST,tp,tp,0)
if Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if not tc:IsImmuneToEffect(e) and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
if tc:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
end
end
end
\ No newline at end of file
--第一类接触
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010168)
--e0
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCost(cm.accost)
e2:SetDescription(aux.Stringid(m,1))
c:RegisterEffect(e2)
--e1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
--e0
function cm.accost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if tc and aux.IsCodeListed(tc,60010168) then
if tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_COST,tp,tp,0)
else
Duel.ChangePosition(tc,POS_FACEUP)
local te=tc:GetActivateEffect()
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=tc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
tc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
end
else
Duel.SendtoGrave(tc,REASON_COST)
end
end
--e1
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
local tc=Duel.CreateToken(tp,60010171+op)
Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
if op==0 then
Duel.Draw(tp,1,REASON_EFFECT)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.actg1)
e3:SetOperation(cm.acop1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
elseif op==1 then
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then Duel.Destroy(g,REASON_EFFECT) end
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.actg2)
e3:SetOperation(cm.acop2)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
end
end
function cm.acfil(c,e,tp)
return c:IsRace(RACE_FIEND) and c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.actg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.acfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.acop1(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.acfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function cm.actg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
end
function cm.acop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.Destroy(c,REASON_EFFECT)
end
end
--e2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_FIEND or c:GetLevel()<5
end
--e3
function cm.thfilter(c)
return c:IsType(TYPE_MONSTER+TYPE_CONTINUOUS)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,c)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_COST,tp,tp,0)
if Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if not tc:IsImmuneToEffect(e) and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
if tc:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
end
end
end
\ No newline at end of file
--希望时代的涂鸦
local cm,m,o=GetID()
function cm.initial_effect(c)
end
--死仇时代的恨意
local cm,m,o=GetID()
function cm.initial_effect(c)
end
--希望之女
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010168)
--e0
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCost(cm.accost)
e2:SetDescription(aux.Stringid(m,1))
c:RegisterEffect(e2)
--e1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
--e0
function cm.accost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if tc and aux.IsCodeListed(tc,60010168) then
if tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_COST,tp,tp,0)
else
Duel.ChangePosition(tc,POS_FACEUP)
local te=tc:GetActivateEffect()
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=tc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
tc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
end
else
Duel.SendtoGrave(tc,REASON_COST)
end
end
--e1
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>4 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.SortDecktop(tp,tp,5)
Duel.SortDecktop(tp,1-tp,5)
end
end
--e2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_FIEND or c:GetLevel()<5
end
--e3
function cm.thfilter(c)
return c:IsType(TYPE_MONSTER+TYPE_CONTINUOUS)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,c)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_COST,tp,tp,0)
if Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if not tc:IsImmuneToEffect(e) and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
if tc:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
end
end
end
--通道
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,60010168)
--e0
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCost(cm.accost)
e2:SetDescription(aux.Stringid(m,1))
c:RegisterEffect(e2)
--e1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
--e0
function cm.accost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if tc and aux.IsCodeListed(tc,60010168) then
if tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_COST,tp,tp,0)
else
Duel.ChangePosition(tc,POS_FACEUP)
local te=tc:GetActivateEffect()
local cos,tg,op=te:GetCost(),te:GetTarget(),te:GetOperation()
if te and (not cos or cos(te,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(te,tp,eg,ep,ev,re,r,rp,0)) then
e:SetProperty(te:GetProperty())
local code=tc:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
te:UseCountLimit(tp,1,true)
tc:CreateEffectRelation(te)
if cos then cos(te,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(te)
tg=g:GetNext()
end
end
if op then op(te,tp,eg,ep,ev,re,r,rp) end
tc:ReleaseEffectRelation(te)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(te)
tg=g:GetNext()
end
end
end
end
else
Duel.SendtoGrave(tc,REASON_COST)
end
end
--e1
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,3,nil)
if Duel.Remove(g,nil,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(g)
e1:SetCountLimit(1)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
local rg=Duel.GetOperatedGroup()
local num={}
local num[0]=0
local num[1]=0
for c in aux.Next(rg) do
num[c:GetOwner()]=num[c:GetOwner()]+1
end
for i=0,1 do
if num[i]~=0 then
Duel.Recover(i,1000*num[i],REASON_EFFECT)
end
end
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
--e2
function cm.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_FIEND or c:GetLevel()<5
end
--e3
function cm.thfilter(c)
return c:IsType(TYPE_MONSTER+TYPE_CONTINUOUS)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,c)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_COST,tp,tp,0)
if Duel.IsExistingMatchingCard(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,c) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if not tc:IsImmuneToEffect(e) and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
if tc:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
end
end
end
\ No newline at end of file
......@@ -49,4 +49,5 @@
0x626 枪火指示物
0x627 指示物(愿母神三度为你阖眼)
0x628 鬼火指示物
\ No newline at end of file
0x628 鬼火指示物
0x629 永屹指示物
\ No newline at end of file
File deleted
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