Commit 82fd47e0 authored by POLYMER's avatar POLYMER

fix

parent 703dad6a
No preview for this file type
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
for _,te in pairs(eset) do if te:GetLabel()~=m then return true end end
return false
end)
c:RegisterEffect(e1)
--c:RegisterEffect(e1)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_ACTIVATE_COST)
......@@ -139,7 +139,7 @@ function cm.fccon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.mfilter(c)
local code=c:GetOriginalCode()
return code>=11451031 and code<=11451033
return code>=11451031 and code<=11451037
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
pnfl_adjusting=true
......@@ -234,9 +234,10 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
else
local loc=te:GetHandler():GetLocation()
if te:GetHandler():IsFaceup() and te:GetHandler():IsOnField() then loc=te:GetHandler():GetPreviousLocation() end
ce:SetRange(loc)
local g=Duel.GetMatchingGroup(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) end,0,0xff,0xff,nil)
local og=Duel.GetOverlayGroup(0,1,1):Filter(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) end,nil)
ce:SetDescription(aux.Stringid(m,1))
ce:SetRange(loc|LOCATION_SZONE|LOCATION_HAND)
local g=Duel.GetMatchingGroup(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_PENDULUM) end,0,0xff,0xff,nil)
local og=Duel.GetOverlayGroup(0,1,1):Filter(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_PENDULUM) end,nil)
g:Merge(og)
for oc in aux.Next(g) do
local ce2=ce:Clone()
......@@ -315,7 +316,7 @@ function cm.spcop(e,tp,eg,ep,ev,re,r,rp)
local sc=g:Select(tp,1,1,nil):GetFirst()
if not sc then return end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,2))
Duel.ConfirmCards(1-tp,Group.FromCards(sc))
if not sc:IsOnField() then Duel.ConfirmCards(1-tp,Group.FromCards(sc)) end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -138,7 +138,7 @@ function cm.fccon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.mfilter(c)
local code=c:GetOriginalCode()
return code>=11451031 and code<=11451033
return code>=11451031 and code<=11451037
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
pnfl_adjusting=true
......@@ -231,9 +231,10 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
else
local loc=te:GetHandler():GetLocation()
if te:GetHandler():IsFaceup() and te:GetHandler():IsOnField() then loc=te:GetHandler():GetPreviousLocation() end
ce:SetRange(loc)
local g=Duel.GetMatchingGroup(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) end,0,0xff,0xff,nil)
local og=Duel.GetOverlayGroup(0,1,1):Filter(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) end,nil)
ce:SetDescription(aux.Stringid(m,1))
ce:SetRange(loc|LOCATION_SZONE|LOCATION_HAND)
local g=Duel.GetMatchingGroup(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_PENDULUM) end,0,0xff,0xff,nil)
local og=Duel.GetOverlayGroup(0,1,1):Filter(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_PENDULUM) end,nil)
g:Merge(og)
for oc in aux.Next(g) do
local ce2=ce:Clone()
......
......@@ -147,7 +147,7 @@ function cm.fccon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.mfilter(c)
local code=c:GetOriginalCode()
return code>=11451031 and code<=11451033
return code>=11451031 and code<=11451037
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
pnfl_adjusting=true
......@@ -240,9 +240,10 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
else
local loc=te:GetHandler():GetLocation()
if te:GetHandler():IsFaceup() and te:GetHandler():IsOnField() then loc=te:GetHandler():GetPreviousLocation() end
ce:SetRange(loc)
local g=Duel.GetMatchingGroup(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) end,0,0xff,0xff,nil)
local og=Duel.GetOverlayGroup(0,1,1):Filter(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) end,nil)
ce:SetDescription(aux.Stringid(m,1))
ce:SetRange(loc|LOCATION_SZONE|LOCATION_HAND)
local g=Duel.GetMatchingGroup(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_PENDULUM) end,0,0xff,0xff,nil)
local og=Duel.GetOverlayGroup(0,1,1):Filter(function(c) return cm.mfilter(c) and c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_PENDULUM) end,nil)
g:Merge(og)
for oc in aux.Next(g) do
local ce2=ce:Clone()
......
......@@ -37,7 +37,7 @@ function cm.initial_effect(c)
local _NegateActivation=Duel.NegateActivation
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_FZONE
return LOCATION_FZONE+LOCATION_SZONE
end
return _GetActivateLocation(e)
end
......@@ -93,7 +93,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -105,7 +105,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -29,7 +29,7 @@ function cm.initial_effect(c)
local _NegateActivation=Duel.NegateActivation
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
if e:GetHandler():IsType(TYPE_FIELD) then return LOCATION_FZONE end
if e:GetHandler():IsType(TYPE_FIELD) then return LOCATION_FZONE+LOCATION_SZONE end
return LOCATION_SZONE
end
return _GetActivateLocation(e)
......@@ -114,7 +114,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -126,7 +126,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -83,7 +83,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
g1=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
if #g1==3 then
g1=g1:FilterSelect(Card.IsAbleToHand,tp,1,1,nil)
g1=g1:FilterSelect(tp,Card.IsAbleToHand,1,1,nil)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
end
end
......
......@@ -47,16 +47,16 @@ function c28323723.rmfilter(c)
return c:IsSetCard(0x283) and c:IsAbleToRemove()
end
function c28323723.stfilter(c)
return c:IsSetCard(0x288) and not c:IsPublic()
return c:IsSetCard(0x288) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c28323723.nofilter(c)
return c:IsSetCard(0x289) and not c:IsPublic()
return c:IsSetCard(0x289) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c28323723.shfilter(c)
return c:IsSetCard(0x28a) and not c:IsPublic()
return c:IsSetCard(0x28a) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c28323723.cofilter(c)
return c:IsSetCard(0x28b) and not c:IsPublic()
return c:IsSetCard(0x28b) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c28323723.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -65,51 +65,30 @@ function c28323723.thop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c28323723.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil)
if Duel.SendtoHand(tg,nil,REASON_EFFECT)==0 then return end
Duel.ConfirmCards(1-tp,tg)
Duel.ShuffleHand(tp)
if tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end
local b1,b2,b3,b4=false
local b5=true
if Duel.IsExistingMatchingCard(c28323723.stfilter,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(c28323723.ctfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) then b1=true end
if Duel.IsExistingMatchingCard(c28323723.nofilter,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(c28323723.sefilter,tp,LOCATION_DECK,0,1,nil) then b2=true end
if Duel.IsExistingMatchingCard(c28323723.shfilter,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(c28323723.exfilter,tp,LOCATION_EXTRA,0,1,nil) then b3=true end
if Duel.IsExistingMatchingCard(c28323723.cofilter,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(c28323723.rmfilter,tp,LOCATION_GRAVE,0,1,nil) then b4=true end
if not (b1 or b2 or b3 or b4) then return end
local off=1
local ops,opval={},{}
if b1 then
ops[off]=aux.Stringid(28323723,0)
opval[off]=0
off=off+1
end
if b2 then
ops[off]=aux.Stringid(28323723,1)
opval[off]=1
off=off+1
end
if b3 then
ops[off]=aux.Stringid(28323723,2)
opval[off]=2
off=off+1
end
if b4 then
ops[off]=aux.Stringid(28323723,3)
opval[off]=3
off=off+1
end
if true then
ops[off]=aux.Stringid(28323723,4)
opval[off]=4
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
if sel~=4 then Duel.BreakEffect() end
if sel==0 then
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(28323723,0)},
{b2,aux.Stringid(28323723,1)},
{b3,aux.Stringid(28323723,2)},
{b4,aux.Stringid(28323723,3)},
{b5,aux.Stringid(28323723,4)})
if op~=5 then Duel.BreakEffect() end
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28323723.stfilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c28323723.ctfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
if #g>0 then g:GetFirst():AddCounter(0x1283,1) end
elseif sel==1 then
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28323723.nofilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
......@@ -122,7 +101,7 @@ function c28323723.thop(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.SelectMatchingCard(tp,c28323723.sefilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
elseif sel==2 then
elseif op==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28323723.shfilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
......@@ -132,7 +111,7 @@ function c28323723.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
elseif sel==3 then
elseif op==4 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28323723.cofilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
......
......@@ -58,58 +58,37 @@ function c28381214.thop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c28381214.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil)
if Duel.SendtoHand(tg,nil,REASON_EFFECT)==0 then return end
Duel.ConfirmCards(1-tp,tg)
Duel.ShuffleHand(tp)
if tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end
local b1,b2,b3,b4=false
local b5=true
if Duel.IsExistingMatchingCard(c28381214.ilfilter,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(c28381214.tgfilter,tp,LOCATION_DECK,0,1,nil) then b1=true end
if Duel.IsExistingMatchingCard(c28381214.anfilter,tp,LOCATION_HAND,0,2,nil) then b2=true end
if Duel.IsExistingMatchingCard(c28381214.hkfilter,tp,LOCATION_HAND,0,2,nil) and Duel.IsExistingMatchingCard(c28381214.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then b3=true end
if Duel.IsExistingMatchingCard(c28381214.alfilter,tp,LOCATION_HAND,0,2,nil) then b4=true end
if not (b1 or b2 or b3 or b4) then return end
local off=1
local ops,opval={},{}
if b1 then
ops[off]=aux.Stringid(28381214,0)
opval[off]=0
off=off+1
end
if b2 then
ops[off]=aux.Stringid(28381214,1)
opval[off]=1
off=off+1
end
if b3 then
ops[off]=aux.Stringid(28381214,2)
opval[off]=2
off=off+1
end
if b4 then
ops[off]=aux.Stringid(28381214,3)
opval[off]=3
off=off+1
end
if true then
ops[off]=aux.Stringid(28381214,4)
opval[off]=4
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))+1
local sel=opval[op]
if sel~=4 then Duel.BreakEffect() end
if sel==0 then
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(28381214,0)},
{b2,aux.Stringid(28381214,1)},
{b3,aux.Stringid(28381214,2)},
{b4,aux.Stringid(28381214,3)},
{b5,aux.Stringid(28381214,4)})
if op~=5 then Duel.BreakEffect() end
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28381214.ilfilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c28381214.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end
elseif sel==1 then
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28381214.anfilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
Duel.Damage(tp,500,REASON_EFFECT,true)
Duel.Damage(1-tp,500,REASON_EFFECT,true)
Duel.RDComplete()
elseif sel==2 then
elseif op==3 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28381214.hkfilter,tp,LOCATION_HAND,0,2,2,nil)
......@@ -118,7 +97,7 @@ function c28381214.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c28381214.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end
elseif sel==3 then
elseif op==4 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28381214.alfilter,tp,LOCATION_HAND,0,2,2,nil)
Duel.BreakEffect()
......
--东风幼龙
function c871100001.initial_effect(c)
--special summon
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100001,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,81275020)
e2:SetTarget(c871100001.thtg)
e2:SetOperation(c871100001.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c871100001.thfilter(c)
return c:IsSetCard(0xfec1) and not c:IsCode(871100001) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c871100001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c871100001.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c871100001.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c871100001.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--北风幼龙
local m=871100002
local cm=_G["c"..m]
function cm.initial_effect(c)
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+LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.hspcost)
e1:SetTarget(cm.hsptg)
e1:SetOperation(cm.hspop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1000)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(cm.retcon)
e2:SetTarget(cm.rettg)
e2:SetOperation(cm.retop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m+2000)
e3:SetCost(cm.descost)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+3000)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
end
function cm.rfilter(c)
return c:IsSetCard(0xfec1) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.rfilter2(c)
return c:IsSetCard(0xfec1) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function cm.hspcost(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetHandler():IsHasEffect(114620011) then
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter2,tp,LOCATION_REMOVED,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.rfilter2,tp,LOCATION_REMOVED,0,2,2,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
else
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
function cm.hsptg(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.hspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function cm.dfilter(c)
return c:IsSetCard(0xfec1) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() and e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.dfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function cm.thfilter(c)
return c:IsSetCard(0xfec1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--スクラップ・ゴーレム
function c871100003.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(871100003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c871100003.sptg)
e1:SetOperation(c871100003.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100003,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,871101003)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c871100003.spcost)
e2:SetTarget(c871100003.sptg)
e2:SetOperation(c871100003.spop)
c:RegisterEffect(e2)
end
function c871100003.filter(c,e,tp)
return c:IsLevelBelow(8) and c:IsSetCard(0xfec1) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false)
or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp))
end
function c871100003.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c871100003.filter(chkc,e,tp) end
if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0)
and Duel.IsExistingTarget(c871100003.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c871100003.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c871100003.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local s1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local s2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
local op=0
Duel.Hint(HINT_SELECTMSG,tp,0)
if s1 and s2 then op=Duel.SelectOption(tp,aux.Stringid(871100003,1),aux.Stringid(871100003,2))
elseif s1 then op=Duel.SelectOption(tp,aux.Stringid(871100003,1))
elseif s2 then op=Duel.SelectOption(tp,aux.Stringid(871100003,2))+1
else return end
if op==0 then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP) end
end
-----
function c871100003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c871100003.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToRemoveAsCost()
end
function c871100003.spfilter(c,e,tp,lv)
return c:IsRace(RACE_DRAGON) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c871100003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
local cg=Duel.GetMatchingGroup(c871100003.cfilter,tp,LOCATION_GRAVE,0,nil)
return c:IsAbleToRemoveAsCost()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c871100003.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,cg:GetCount())
end
local cg=Duel.GetMatchingGroup(c871100003.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c871100003.spfilter,tp,LOCATION_DECK,0,nil,e,tp,cg:GetCount())
local lvt={}
local tc=tg:GetFirst()
while tc do
local tlv=0
tlv=tlv+tc:GetLevel()
lvt[tlv]=tlv
tc=tg:GetNext()
end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(871100003,2))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
local rg1=Group.CreateGroup()
if lv>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg2=cg:Select(tp,lv-1,lv-1,c)
rg1:Merge(rg2)
end
rg1:AddCard(c)
Duel.Remove(rg1,POS_FACEUP,REASON_COST)
e:SetLabel(lv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c871100003.sfilter(c,e,tp,lv)
return c:IsRace(RACE_DRAGON) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c871100003.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c871100003.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(38572779,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c871100003.descon)
e1:SetOperation(c871100003.desop)
Duel.RegisterEffect(e1,tp)
end
end
function c871100003.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(871100003)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function c871100003.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--南风幼龙
function c871100004.initial_effect(c)
--recycle
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(871100004,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,871100004)
e1:SetCost(c871100004.cost)
e1:SetTarget(c871100004.target)
e1:SetOperation(c871100004.operation)
c:RegisterEffect(e1)
c871100004.discard_effect=e1
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100004,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,871101004)
e2:SetTarget(c871100004.sptg)
e2:SetOperation(c871100004.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c871100004.spcon)
c:RegisterEffect(e3)
end
function c871100004.cost(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 c871100004.filter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0xfec1) and not c:IsCode(29596581) and c:IsAbleToHand()
end
function c871100004.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c871100004.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c871100004.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c871100004.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c871100004.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c871100004.spfilter(c,e,tp)
return c:IsSetCard(0xfec1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c871100004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c871100004.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c871100004.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c871100004.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(871100004,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c871100004.thcon)
e1:SetOperation(c871100004.thop)
Duel.RegisterEffect(e1,tp)
end
end
function c871100004.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(871100004)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c871100004.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
--四风幼龙
--転生炎獣ガゼル
function c871100005.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(871100005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,871100005)
e1:SetCondition(c871100005.spcon)
e1:SetTarget(c871100005.sptg)
e1:SetOperation(c871100005.spop)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100005,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,871101005)
e2:SetTarget(c871100005.tgtg)
e2:SetOperation(c871100005.tgop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c871100005.cfilter(c,tp)
return c:IsSetCard(0xfec1) and c:IsType(TYPE_MONSTER) and not c:IsCode(871100005) and c:IsControler(tp)
end
function c871100005.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c871100005.cfilter,1,nil,tp)
end
function c871100005.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 c871100005.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c871100005.tgfilter(c)
return c:IsSetCard(0xfec1) and not c:IsCode(871100005) and c:IsAbleToHand()
end
function c871100005.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c871100005.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c871100005.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c871100005.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--白色幼龙
function c871100006.initial_effect(c)
--send to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(871100006,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c871100006.target)
e1:SetOperation(c871100006.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c871100006.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_DRAGON) and c:IsAbleToGrave()
end
function c871100006.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c871100006.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c871100006.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c871100006.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--碧蓝幼龙
function c871100007.initial_effect(c)
--Negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(871100007,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c871100007.discon)
e1:SetCost(c871100007.discost)
e1:SetTarget(c871100007.distg)
e1:SetOperation(c871100007.disop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100007,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,871100007)
e2:SetTarget(c871100007.thtg)
e2:SetOperation(c871100007.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c871100007.thcon)
c:RegisterEffect(e3)
end
function c871100007.discon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE) )and Duel.IsChainNegatable(ev)
end
function c871100007.costfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end
function c871100007.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and
Duel.IsExistingMatchingCard(c871100007.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c871100007.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
end
function c871100007.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c871100007.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
---
function c871100007.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c871100007.thfilter(c)
return c:IsSetCard(0xfec1) and not c:IsCode(871100007) and c:IsAbleToHand()
end
function c871100007.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c871100007.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c871100007.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c871100007.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--翡翠幼龙
function c871100008.initial_effect(c)
---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+LOCATION_GRAVE)
e1:SetCondition(c871100008.spcon)
e1:SetOperation(c871100008.spop)
c:RegisterEffect(e1)
end
function c871100008.spfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsDiscardable()
end
function c871100008.spcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(c871100008.spfilter,tp,LOCATION_HAND,0,nil)
if not c:IsAbleToGraveAsCost() or Duel.IsPlayerAffectedByEffect(tp,EFFECT_NECRO_VALLEY) then
g:RemoveCard(c)
end
return g:CheckWithSumGreater(Card.GetLevel,2)
end
function c871100008.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c871100008.spfilter,c:GetControler(),LOCATION_HAND,0,nil)
if not c:IsAbleToGraveAsCost() or Duel.IsPlayerAffectedByEffect(tp,EFFECT_NECRO_VALLEY) then
g:RemoveCard(c)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=g:SelectWithSumGreater(tp,Card.GetLevel,2)
Duel.SendtoGrave(sg,REASON_COST+REASON_DISCARD)
end
--黑色幼龙
function c871100009.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCountLimit(1,871100009)
e1:SetCondition(c871100009.thcon)
e1:SetTarget(c871100009.thtg)
e1:SetOperation(c871100009.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,871101009)
e2:SetCost(c871100009.spcost)
e2:SetTarget(c871100009.sptg)
e2:SetOperation(c871100009.spop)
c:RegisterEffect(e2)
end
function c871100009.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_LINK
end
function c871100009.filter(c)
return c:IsSetCard(0xfec1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c871100009.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c871100009.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c871100009.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c871100009.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 c871100009.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end
function c871100009.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 c871100009.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
\ No newline at end of file
--红色幼龙
function c871100010.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(871100010,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c871100010.spcostt)
e1:SetTarget(c871100010.sptgg)
e1:SetOperation(c871100010.spopp)
c:RegisterEffect(e1)
----
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100010,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,871101010)
e2:SetCost(c871100010.spcost)
e2:SetTarget(c871100010.sptg)
e2:SetOperation(c871100010.spop)
c:RegisterEffect(e2)
end
function c871100010.costfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c871100010.spcostt(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c871100010.costfilter2,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c871100010.costfilter2,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c871100010.filter(c,e,tp)
return c:IsLevelBelow(8) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c871100010.sptgg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c871100010.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c871100010.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c871100010.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c871100010.spopp(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsRace(RACE_DRAGON) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
-----
function c871100010.costfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsDiscardable()
end
function c871100010.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable()
and Duel.IsExistingMatchingCard(c871100010.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c871100010.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c871100010.spfilter(c,e,tp)
return not c:IsCode(871100010) and c:IsSetCard(0xfec1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c871100010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c871100010.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c871100010.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c871100010.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--青铜幼龙
function c871100011.initial_effect(c)
c:SetSPSummonOnce(871100011)
--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(c871100011.spcon)
c:RegisterEffect(e1)
------
function c871100011.spfilter(c)
return c:IsFaceup() and c:IsSetCard(0xfec1)
end
function c871100011.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c871100011.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
------
--暮光幼龙
function c871100012.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_DRAGON),2,2)
c:EnableReviveLimit()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100012,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,871100012)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c871100012.sptg)
e2:SetOperation(c871100012.spop)
c:RegisterEffect(e2)
end
function c871100012.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and not c:IsCode(871100012) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c871100012.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c871100012.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c871100012.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c871100012.filter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--永恒幼龙
--暮光幼龙
function c871100013.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_DRAGON),2,99)
c:EnableReviveLimit()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(871100013,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,871100012+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(c871100013.sptg)
e2:SetOperation(c871100013.spop)
c:RegisterEffect(e2)
end
function c871100013.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and not c:IsCode(871100013) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c871100013.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c871100013.filter,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_DECK)
end
function c871100013.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c871100013.filter),tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--多元魔导冥士 拉莫尔
function c978210027.initial_effect(c)
--effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(978210027,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c978210027.efftg)
e1:SetOperation(c978210027.effop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_HAND)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_DRAW_PHASE+TIMING_CHAIN_END+TIMING_END_PHASE)
e3:SetCost(c978210027.spcost)
e3:SetTarget(c978210027.sptg)
e3:SetOperation(c978210027.spop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e4)
end
function c978210027.cfilter(c)
return c:IsSetCard(0x306e) and c:IsType(TYPE_SPELL)
end
function c978210027.filter1(c)
return c:IsSetCard(0x306e) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c978210027.filter2(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_DARK)
and c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c978210027.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c978210027.cfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=1 end
local ct=g:GetClassCount(Card.GetCode)
if ct>=2 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
if ct>=3 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function c978210027.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c978210027.cfilter,tp,LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
if ct>=1 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
if ct>=2 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c978210027.filter1,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
if ct>=3 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c978210027.filter2,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 c978210027.cffilter(c)
return c:IsSetCard(0x306e) and c:IsType(TYPE_SPELL) and not c:IsPublic()
end
function c978210027.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c978210027.cffilter,tp,LOCATION_HAND,0,3,nil)
and c:GetFlagEffect(978210027)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c978210027.cffilter,tp,LOCATION_HAND,0,3,3,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
c:RegisterFlagEffect(978210027,RESET_CHAIN,0,1)
end
function c978210027.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 c978210027.spop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
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