Commit 4e834832 authored by TanakaKotoha's avatar TanakaKotoha

nbtv

parent e3e19223
......@@ -94,7 +94,7 @@ end
function c11200112.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c11200112.pfilter0,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local mg1=Duel.GetMatchingGroup(c11200112.pfilter0,tp,LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(c11200112.pfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -108,12 +108,12 @@ function c11200112.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED)
end
function c11200112.pspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg1=Duel.GetMatchingGroup(c11200112.pfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local mg1=Duel.GetMatchingGroup(c11200112.pfilter1,tp,LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(c11200112.pfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
......
......@@ -54,38 +54,39 @@ function c11200305.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c11200305.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c11200305.eqfilter(c)
return c:IsFaceup() and c:IsAbleToChangeControler()
end
function c11200305.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToChangeControler() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c11200305.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11200305.eqfilter,tp,0,LOCATION_MZONE,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,c11200305.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c11200305.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
if not Duel.Equip(tp,tc,c,false) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c11200305.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(800)
tc:RegisterEffect(e2)
else Duel.SendtoGrave(tc,REASON_RULE) end
if tc:IsRelateToEffect(e) and Duel.Equip(tp,tc,c) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c11200305.eqlimit)
e1:SetLabelObject(c)
tc:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(800)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function c11200305.eqlimit(e,c)
return e:GetOwner()==c
return c==e:GetLabelObject()
end
function c11200305.costfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
......
......@@ -97,6 +97,7 @@ function c26803006.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
end
function c26803006.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
......
......@@ -101,6 +101,7 @@ function c26806053.asptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c26806053.aspop(e,tp,eg,ep,ev,re,r,rp)
local zone=c26806053.acheckzone(tp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if zone==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c26806053.aspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
......
......@@ -144,6 +144,7 @@ function c26807032.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c26807032.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -161,6 +162,7 @@ function c26807032.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetChainLimit(c26807032.limit(g:GetFirst()))
end
function c26807032.tdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
......
......@@ -75,9 +75,9 @@ end
function c33400008.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c33400008.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -15,22 +15,21 @@ function c33400106.cfilter(c,e,tp)
return c:IsSetCard(0x3341) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33400106.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mc=Duel.GetLocationCount(tp,LOCATION_MZONE)
local sc=Duel.GetMatchingGroupCount(c33400106.cfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c33400106.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33400106.cfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsCanRemoveCounter(tp,1,0,0x34f,2,REASON_COST)
and Duel.IsCanRemoveCounter(tp,1,0,0x34f,2,REASON_COST) and mc>0 and sc>0
end
local sc=Duel.GetMatchingGroupCount(c33400106.cfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return sc>0 end
local cn=Duel.GetCounter(tp,1,0,0x34f)
local lvt={}
if cn>=2 and sc>=1 then lvt[1]=1 end
if cn>=2 and sc>=2 and Duel.GetFlagEffect(tp,33400101)>=2 then lvt[2]=2 end
lvt[1]=1
if sc>1 and mc>1 and Duel.GetFlagEffect(tp,33400101)>=2 then lvt[2]=2 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(33400106,1))
local sc1=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.RemoveCounter(tp,1,0,0x34f,2,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c33400106.cfilter,tp,LOCATION_GRAVE,0,sc1,sc1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
local v=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
end
function c33400106.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
......
......@@ -25,7 +25,6 @@ end
function c33400107.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local tc=tg:GetFirst()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
if Duel.IsExistingMatchingCard(c33400107.filter1,tp,LOCATION_GRAVE,0,3,nil) and Duel.SelectYesNo(tp,aux.Stringid(33400107,0)) then
local c=e:GetHandler()
......@@ -46,7 +45,6 @@ function c33400107.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
Duel.RegisterFlagEffect(tp,33400101,RESET_EVENT+RESET_PHASE+PHASE_END,0,0)
end
function c33400107.filter1(c)
......
......@@ -32,12 +32,12 @@ function c33400112.tdfilter(c)
end
function c33400112.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c33400112.tdfilter,tp,0x5e,0x5e,e:GetHandler())
local g=Duel.GetMatchingGroup(c33400112.tdfilter,tp,0x7e,0x7e,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetChainLimit(aux.FALSE)
end
function c33400112.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c33400112.tdfilter,tp,0x5e,0x5e,aux.ExceptThisCard(e))
local g=Duel.GetMatchingGroup(c33400112.tdfilter,tp,0x7e,0x7e,aux.ExceptThisCard(e))
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.SetLP(1-tp,4000)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
......
......@@ -74,7 +74,7 @@ function c33400474.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc)
e2:SetLabelObject(tc1)
e2:SetCondition(c33400474.descon)
e2:SetOperation(c33400474.desop)
Duel.RegisterEffect(e2,tp)
......@@ -91,5 +91,7 @@ function c33400474.descon(e,tp,eg,ep,ev,re,r,rp)
end
function c33400474.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Remove(tc,REASON_EFFECT)
Duel.Remove(tc,0,REASON_EFFECT)
end
......@@ -150,6 +150,7 @@ function c81010003.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SelectTarget(tp,c81010003.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c81010003.atop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -61,6 +61,7 @@ function c81010004.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,0,0)
end
function c81010004.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
......@@ -86,6 +87,7 @@ function c81010004.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c81010004.sumop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c81010004.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
......
......@@ -75,6 +75,7 @@ function c81010035.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c81010035.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
......
......@@ -154,6 +154,7 @@ function c81010041.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c81010041.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
......@@ -174,6 +175,7 @@ function c81010041.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c81010041.negop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
......
......@@ -30,7 +30,7 @@ function c81011303.initial_effect(c)
c:RegisterEffect(e2)
end
function c81011303.ovfilter(c)
return c:IsFaceup() and c:IsXyzType(TYPE_XYZ) and c:IsRank(7,8,9)
return c:IsFaceup() and c:IsXyzType(TYPE_XYZ) and c:IsRank(7,8,9) and c:IsAttribute(ATTRIBUTE_WIND)
end
function c81011303.xyzop(e,tp,chk,mc)
if chk==0 then return mc:CheckRemoveOverlayCard(tp,2,REASON_COST) end
......
......@@ -65,6 +65,7 @@ function c81014017.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c81014017.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,81014018,0,0x4011,1550,1050,4,RACE_FAIRY,ATTRIBUTE_LIGHT) then return end
local token=Duel.CreateToken(tp,81014018)
......
......@@ -67,7 +67,7 @@ function c81014033.sprfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM) and not c:IsCode(81014033)
end
function c81014033.incon(e)
local tp=c:GetControler()
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(c81014033.sprfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c81014033.cfilter(c)
......
......@@ -43,6 +43,7 @@ function c81016009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c81016009.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,81016999,0x81d,0x4011,765,765,7,RACE_FAIRY,ATTRIBUTE_LIGHT) then return end
local token=Duel.CreateToken(tp,81016999)
......
......@@ -83,6 +83,7 @@ function c81018003.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c81018003.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local sc=g:GetFirst()
......
......@@ -61,6 +61,7 @@ function c81018035.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c81018035.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c81018035.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......@@ -101,6 +102,7 @@ function c81018035.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SelectTarget(tp,c81018035.cbfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c81018035.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -75,6 +75,7 @@ function c81018047.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c81018047.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
......
......@@ -5,13 +5,16 @@ function c81021010.initial_effect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--spsummon
local e1=aux.AddRitualProcGreater2(c,c81021010.filter)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(0)
e1:SetCountLimit(1,81021010)
e1:SetRange(LOCATION_SZONE)
e1:SetCost(c81021010.cost)
e1:SetTarget(c81021010.target)
e1:SetOperation(c81021010.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_RECOVER)
......@@ -35,13 +38,62 @@ function c81021010.initial_effect(c)
e4:SetOperation(c81021010.thop)
c:RegisterEffect(e4)
end
function c81021010.filter(c)
return c:IsSetCard(0x818)
end
function c81021010.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c81021010.qfilter(c,e,tp,m,ft)
if not (c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x818)) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(c81021010.qfilterF,1,nil,tp,mg,c)
end
end
function c81021010.qfilterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function c81021010.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c81021010.qfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c81021010.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c81021010.qfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c81021010.qfilterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c81021010.cfilter(c,tp)
return c:IsSetCard(0x818) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
......@@ -56,6 +108,7 @@ function c81021010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800)
end
function c81021010.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
......
......@@ -66,6 +66,7 @@ function c81041000.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c81041000.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
local e2=Effect.CreateEffect(e:GetHandler())
......
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