Commit b55fd0bb authored by VanillaSalt's avatar VanillaSalt

fix

parent 3fd3b4cd
......@@ -7,7 +7,7 @@ function c18235309.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c18235309.cost1)
e1:SetTarget(c18235309.target1)
e1:SetOperation(c18235309.activate1)
e1:SetOperation(c18235309.activate)
c:RegisterEffect(e1)
--instant
local e3=Effect.CreateEffect(c)
......@@ -16,13 +16,15 @@ function c18235309.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1)
e3:SetCondition(c18235309.condition2)
e3:SetTarget(c18235309.target2)
e3:SetOperation(c18235309.activate2)
e3:SetOperation(c18235309.activate)
e3:SetLabel(1)
c:RegisterEffect(e3)
end
function c18235309.filter(c)
local mi,ma=c:GetTributeRequirement()
local mi,ma=c:GetTributeRequirement()
return c:IsSummonable(true,nil) and mi>0
end
function c18235309.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -30,55 +32,35 @@ function c18235309.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
if (tn==tp or ph==PHASE_DRAW or ph==PHASE_STANDBY or ph==PHASE_END) then return false end
if Duel.IsExistingMatchingCard(c18235309.filter,tp,LOCATION_HAND,0,1,nil)
if (tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or ph==PHASE_BATTLE))
and Duel.IsExistingMatchingCard(c18235309.filter,tp,LOCATION_HAND,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(18235309,1)) then
e:SetLabel(1)
end
end
function c18235309.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(18235309)==0 end
if chk==0 then return true end
if e:GetLabel()~=1 then return end
e:GetHandler():RegisterFlagEffect(18235309,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c18235309.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
function c18235309.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if e:GetLabel()~=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c18235309.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsSummonable(true,nil) then
Duel.Summon(tp,tc,true,nil)
end
Duel.Summon(tp,tc,true,nil)
end
end
function c18235309.condition2(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return (tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or ph==PHASE_BATTLE))
return tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or ph==PHASE_BATTLE)
end
function c18235309.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetHandler():GetFlagEffect(18235309)~=0 then return false end
if not e:GetHandler():IsStatus(STATUS_CHAINING) then
local ct=Duel.GetMatchingGroupCount(c18235309.filter,tp,LOCATION_HAND,0,nil)
e:SetLabel(ct)
return ct>0
else return e:GetLabel()>0 end
end
e:GetHandler():RegisterFlagEffect(18235309,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:SetLabel(e:GetLabel()-1)
if chk==0 then return e:GetHandler():GetFlagEffect(18235309)==0
and Duel.IsExistingMatchingCard(c18235309.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c18235309.activate2(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,c18235309.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
--アーティファクト-サイズ
--Artifact Scythe
function c20292186.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
......@@ -16,7 +16,7 @@ function c20292186.initial_effect(c)
e2:SetTarget(c20292186.sptg)
e2:SetOperation(c20292186.spop)
c:RegisterEffect(e2)
--indes
--cannot spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(20292186,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
......@@ -54,4 +54,4 @@ function c20292186.dop(e,tp,eg,ep,ev,re,r,rp)
end
function c20292186.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
\ No newline at end of file
end
......@@ -17,7 +17,7 @@ function c20579538.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,20579538)
e2:SetCountLimit(1,20579539)
e2:SetCondition(c20579538.spcon)
e2:SetTarget(c20579538.sptg)
e2:SetOperation(c20579538.spop)
......@@ -31,22 +31,20 @@ function c20579538.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c20579538.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and c:IsSetCard(0xa6)
return c:IsSetCard(0xa6) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c20579538.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
local dg=Duel.GetMatchingGroup(c20579538.tdfilter,tp,LOCATION_GRAVE,0,nil)
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
and dg:GetCount()>0
and Duel.SelectYesNo(tp,aux.Stringid(20579538,2)) then
if Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)==0 then return end
local dg=Duel.GetMatchingGroup(c20579538.tdfilter,tp,LOCATION_GRAVE,0,nil)
if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(20579538,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.SendtoDeck(dg:Select(tp,1,1,nil),nil,0,REASON_EFFECT)
local tg=dg:Select(tp,1,1,nil)
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
end
end
function c20579538.spcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -60,18 +58,19 @@ function c20579538.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local t={}
local i=1
for i=1,8 do t[i]=i end
e:SetLabel(Duel.AnnounceNumber(tp,table.unpack(t)))
Duel.Hint(HINT_SELECTMSG,tp,567)
local lv=Duel.AnnounceNumber(tp,table.unpack(t))
e:SetLabel(lv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c20579538.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetHandler():IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) then
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_CHANGE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
end
......@@ -53,22 +53,21 @@ end
function c29357956.spfilter(c)
local tpe=c:GetOriginalType()
return c:IsSetCard(0x19) and c:IsCanBeFusionMaterial() and
((bit.band(tpe,TYPE_FUSION)>0 and c:IsAbleToExtraAsCost()) or
((bit.band(tpe,TYPE_FUSION)>0 and c:IsAbleToExtraAsCost()) or
(bit.band(tpe,TYPE_FUSION)==0 and c:IsAbleToDeckAsCost()))
end
function c29357956.sprcon(e,c)
if c==nil then return true end
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c29357956.spfilter,tp,LOCATION_MZONE,0,2,nil)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c29357956.spfilter,tp,LOCATION_MZONE,0,3,nil)
end
function c29357956.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c29357956.spfilter,tp,LOCATION_MZONE,0,2,2,nil)
local tc=g:GetFirst()
while tc do
if not tc:IsFaceup() then Duel.ConfirmCards(1-tp,tc) end
tc=g:GetNext()
local g=Duel.SelectMatchingCard(tp,c29357956.spfilter,tp,LOCATION_MZONE,0,3,3,nil)
local cg=g:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
......@@ -91,7 +90,7 @@ function c29357956.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(c,nil,0,REASON_COST)
end
function c29357956.filter(c,e,tp)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,120,tp,false,false)
return c:IsSetCard(0x19) and c:IsCanBeSpecialSummoned(e,122,tp,false,false)
end
function c29357956.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -99,25 +98,17 @@ function c29357956.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c29357956.spop(e,tp,eg,ep,ev,re,r,rp)
local zc=Duel.GetLocationCount(tp,LOCATION_MZONE)
if zc==0 then return end
if not Duel.IsExistingMatchingCard(c29357956.filter,tp,LOCATION_DECK,0,2,nil,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c29357956.filter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
if zc==1 then
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
g:RemoveCard(sc)
Duel.SpecialSummon(sc,120,tp,tp,false,false,POS_FACEUP)
sc:RegisterFlagEffect(sc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
Duel.Destroy(g,REASON_EFFECT)
else
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,120,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
tc=g:GetNext()
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c29357956.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
local tc=sg:GetFirst()
Duel.SpecialSummonStep(tc,122,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
tc=sg:GetNext()
Duel.SpecialSummonStep(tc,122,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
end
......@@ -105,25 +105,17 @@ function c48156348.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c48156348.spop(e,tp,eg,ep,ev,re,r,rp)
local zc=Duel.GetLocationCount(tp,LOCATION_MZONE)
if zc==0 then return end
if not Duel.IsExistingMatchingCard(c48156348.filter,tp,LOCATION_DECK,0,2,nil,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c48156348.filter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
if zc==1 then
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
g:RemoveCard(sc)
Duel.SpecialSummon(sc,120,tp,tp,false,false,POS_FACEUP)
sc:RegisterFlagEffect(sc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
Duel.Destroy(g,REASON_EFFECT)
else
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,120,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
tc=g:GetNext()
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c48156348.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
local tc=sg:GetFirst()
Duel.SpecialSummonStep(tc,120,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
tc=sg:GetNext()
Duel.SpecialSummonStep(tc,120,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
Duel.SpecialSummonComplete()
end
end
......@@ -8,6 +8,7 @@ function c54407825.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c54407825.condition)
......@@ -15,34 +16,37 @@ function c54407825.initial_effect(c)
e2:SetOperation(c54407825.activate)
c:RegisterEffect(e2)
end
function c54407825.filter(c,tp)
function c54407825.filter(c)
return c:IsPreviousLocation(LOCATION_DECK) and c:IsLocation(LOCATION_GRAVE)
end
function c54407825.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c5851097.filter,1,nil,tp)
return eg:IsExists(c54407825.filter,1,nil)
end
function c54407825.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsAbleToDeck() end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c54407825.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_GRAVE)
e1:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
e1:SetReset(RESET_PHASE+RESET_END)
Duel.RegisterEffect(e1,tp)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_DISCARD_DECK)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+RESET_END)
Duel.RegisterEffect(e2,tp)
end
\ No newline at end of file
end
......@@ -25,4 +25,4 @@ end
function c54629413.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
end
......@@ -52,17 +52,17 @@ function c55742055.initial_effect(c)
e5:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetLabel(12)
e5:SetCountLimit(1)
e5:SetCondition(c55742055.effcon)
e5:SetCondition(c55742055.condition4)
e5:SetTarget(c55742055.target4)
e5:SetOperation(c55742055.operation4)
c:RegisterEffect(e5)
end
function c55742055.confilter(c)
return c:IsSetCard(0x107a) and c:IsFaceup()
return c:IsFaceup() and c:IsSetCard(0x107a)
end
function c55742055.effcon(e)
function c55742055.effcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return false end
local g=Duel.GetMatchingGroup(c55742055.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE+LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>=e:GetLabel()
end
......@@ -96,13 +96,13 @@ function c55742055.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c55742055.filter2,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local tg=Duel.GetMatchingGroup(c55742055.eqfilter,tp,LOCATION_HAND,0,nil,tc)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
and tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(55742055,4))
then
local ec=tg:Select(tp,1,1,nil):GetFirst()
if tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(55742055,4)) then
Duel.BreakEffect()
Duel.Equip(tp,ec,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=tg:Select(tp,1,1,nil)
Duel.Equip(tp,sg:GetFirst(),tc,true)
end
end
function c55742055.thfilter(c)
......@@ -121,7 +121,12 @@ function c55742055.operation3(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
function c55742055.condition4(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return false end
local g=Duel.GetMatchingGroup(c55742055.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE+LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)==12
end
function c55742055.target4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
......@@ -129,4 +134,4 @@ end
function c55742055.operation4(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Draw(tp,1,REASON_EFFECT)
end
\ No newline at end of file
end
......@@ -31,27 +31,23 @@ end
function c56574543.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not a:IsRelateToBattle() or not d:IsRelateToBattle() then return end
if a:GetControler()~=tp then
a,d=d,a
end
if not a:IsRelateToBattle() or a:IsFacedown() or not d:IsRelateToBattle() or a:IsFacedown() then return end
if a:GetControler()~=tp then a,d=d,a end
if not a:IsImmuneToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetOwnerPlayer(tp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(d:GetAttack())
if a:RegisterEffect(e1) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e2:SetCondition(c56574543.rdcon)
e2:SetOperation(c56574543.rdop)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
Duel.RegisterEffect(e2,tp)
end
a:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e2:SetCondition(c56574543.rdcon)
e2:SetOperation(c56574543.rdop)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
Duel.RegisterEffect(e2,tp)
end
function c56574543.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
......
......@@ -9,9 +9,10 @@ function c57690191.initial_effect(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(57690191,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c57690191.sptg)
e2:SetTarget(c57690191.sptg)
e2:SetOperation(c57690191.spop)
c:RegisterEffect(e2)
--ret&draw
......@@ -26,11 +27,12 @@ function c57690191.initial_effect(c)
e3:SetCountLimit(1)
c:RegisterEffect(e3)
end
function c57690191.atcon(e,c)
return not(Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==3 and Duel.GetMatchingGroupCount(c57690191.atkfilter,tp,LOCATION_MZONE,0,nil)==3)
function c57690191.atcon(e)
local g=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)
return g:GetCount()~=3 or g:IsExists(c57690191.atkfilter,1,nil)
end
function c57690191.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x107a)
return c:IsFacedown() or not c:IsSetCard(0x107a)
end
function c57690191.spfilter(c,e,tp)
return c:IsSetCard(0x107a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -38,7 +40,7 @@ end
function c57690191.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c57690191.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c57690191.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
......@@ -51,7 +53,7 @@ function c57690191.spop(e,tp,eg,ep,ev,re,r,rp)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
......@@ -82,4 +84,4 @@ function c57690191.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
\ No newline at end of file
end
......@@ -11,37 +11,34 @@ function c80802524.initial_effect(c)
e1:SetOperation(c80802524.activate)
c:RegisterEffect(e1)
end
function c54149433.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsSetCard(0x8d)
end
function c54149433.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:IsExists(c54149433.cfilter,1,nil,tp) and rp~=tp
function c80802524.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
e:SetLabel(tc:GetCode())
return rp~=tp and eg:GetCount()==1
and tc:IsPreviousLocation(LOCATION_MZONE) and tc:GetPreviousControler()==tp and tc:IsSetCard(0x8d)
end
function c80802524.filter(c,e,tp,code)
return c:IsSetCard(0x8d) and c:GetCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c80802524.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local code=eg:GetFirst():GetCode()
if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_GRAVE and c80802524.filter(chkc,e,tp) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c80802524.filter(chkc,e,tp,e:GetLabel()) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c80802524.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp,code) end
and Duel.IsExistingTarget(c80802524.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp,e:GetLabel()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c80802524.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp,code)
local g=Duel.SelectTarget(tp,c80802524.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp,e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c80802524.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg0=g:Filter(Card.IsRelateToEffect,nil,e)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if sg0:GetCount()==0 or ft<=0 then return end
if ft<sg0:GetCount() then
if sg:GetCount()==0 or ft<=0 then return end
if ft<sg:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg0:FilterSelect(tp,c21007444.filter,ft,ft,nil,e,tp)
else
sg=sg0:Clone()
sg=sg:FilterSelect(tp,c80802524.filter,ft,ft,nil,e,tp,e:GetLabel())
end
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENCE)
Duel.ConfirmCards(1-tp,g)
Duel.ConfirmCards(1-tp,sg)
end
end
\ No newline at end of file
end
......@@ -3,10 +3,10 @@ function c81028112.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81028112,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,81028112)
e1:SetTarget(c81028112.tg)
e1:SetOperation(c81028112.op)
......@@ -16,17 +16,17 @@ function c81028112.initial_effect(c)
c:RegisterEffect(e2)
end
function c81028112.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbletoDeck() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c81028112.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
local opt=Duel.SelectOption(tp,aux.Stringid(30126992,1),aux.Stringid(30126992,2))
local opt=Duel.SelectOption(tp,aux.Stringid(81028112,1),aux.Stringid(81028112,2))
Duel.SendtoDeck(sg,nil,opt,REASON_EFFECT)
end
end
\ No newline at end of file
end
......@@ -2,51 +2,43 @@
function c82410600.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c82410600.target)
e1:SetOperation(c82410600.activate)
c:RegisterEffect(e1)
end
function c82410600.filter(c,set)
return c:IsSetCard(0x107a) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and (not set or c:IsSetCard(set))
function c82410600.filter(c,e)
return c:IsSetCard(0x107a) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and c:IsCanBeEffectTarget(e)
end
function c82410600.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and Duel.IsExistingTarget(c82410600.filter,tp,LOCATION_GRAVE,0,5,nil)
and Duel.IsExistingTarget(c82410600.filter,tp,LOCATION_GRAVE,0,1,nil,0xa7)
and Duel.IsExistingTarget(c82410600.filter,tp,LOCATION_GRAVE,0,1,nil,0xa8)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectTarget(tp,c82410600.filter,tp,LOCATION_GRAVE,0,1,1,nil,0xa7)
local g2=Duel.SelectTarget(tp,c82410600.filter,tp,LOCATION_GRAVE,0,1,1,nil,0xa8)
local g=Duel.GetMatchingGroup(c82410600.filter,tp,LOCATION_GRAVE,0,nil)
local g=Duel.GetMatchingGroup(c82410600.filter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:GetCount()>4
and g:IsExists(Card.IsSetCard,1,nil,0xa7) and g:IsExists(Card.IsSetCard,1,nil,0xa8)
and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,Card.IsSetCard,1,1,nil,0xa7)
g:Sub(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=g:FilterSelect(tp,Card.IsSetCard,1,1,nil,0xa8)
g:Sub(g2)
local tg=g:Select(tp,3,3,nil)
local tc=g:GetFirst()
while tc do
Duel.SetTargetCard(tc)
tc=g:GetNext()
end
tg:Merge(g1)
tg:Merge (g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=g:Select(tp,3,3,nil)
g1:Merge(g2)
g1:Merge(g3)
Duel.SetTargetCard(g1)
local dg=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,tg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,dg:GetCount(),0,0)
end
function c82410600.activate(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)==0 then return end
if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) then
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==5 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 then
local dg=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
\ No newline at end of file
end
......@@ -4,25 +4,43 @@ function c82962242.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(82962242,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c82962242.eqcon)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetTarget(c82962242.eqtg)
e1:SetOperation(c82962242.eqop)
c:RegisterEffect(e1)
--
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(82962242,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c82962242.spcon)
e2:SetTarget(c82962242.sptg)
e2:SetOperation(c82962242.spop)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(c82962242.eqcon)
e2:SetTarget(c82962242.eqtg)
e2:SetOperation(c82962242.eqop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(c82962242.checkop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(82962242,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c82962242.spcon)
e4:SetTarget(c82962242.sptg)
e4:SetOperation(c82962242.spop)
e4:SetLabelObject(e4)
c:RegisterEffect(e4)
end
function c82962242.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x8e) and c:IsControler(tp)
......@@ -31,67 +49,64 @@ function c82962242.eqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) or eg:IsExists(c82962242.cfilter,1,nil,tp)
end
function c82962242.eqfilter(c,atk)
return c:IsAbleToChangeControler() and c:IsFaceup() and c:IsAttackAbove(atk+1)
return c:IsFaceup() and c:GetAttack()>atk and c:IsAbleToChangeControler()
end
function c82962242.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local atk=e:GetHandler():GetAttack()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c82962242.eqfilter(chkc,atk) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c82962242.eqfilter(chkc,e:GetHandler():GetAttack()) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c82962242.eqfilter,tp,0,LOCATION_MZONE,1,nil,atk) end
and Duel.IsExistingTarget(c82962242.eqfilter,tp,0,LOCATION_MZONE,1,nil,e:GetHandler():GetAttack()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c82962242.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,atk)
local g=Duel.SelectTarget(tp,c82962242.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,e:GetHandler():GetAttack())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c82962242.eqlimit(e,c)
return e:GetOwner()==c
end
function c82962242.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
local def=tc:GetTextDefence()
if tc:IsFacedown() or atk<0 then atk=0 end
if tc:IsFacedown() or def<0 then def=0 end
if not Duel.Equip(tp,tc,c,false) then return end
tc:RegisterFlagEffect(82962242,RESET_EVENT+0x1fe0000,0,0)
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c82962242.eqlimit)
tc:RegisterEffect(e1)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(atk)
tc:RegisterEffect(e2)
end
else Duel.SendtoGrave(tc,REASON_EFFECT) end
end
if not tc:IsRelateToEffect(e) then return end
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
if tc:IsFacedown() or atk<0 then atk=0 end
if Duel.Equip(tp,tc,c)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c82962242.eqlimit)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc:RegisterFlagEffect(82962242,RESET_EVENT+0x1fe0000,0,1)
else Duel.SendtoGrave(tc,REASON_EFFECT) end
end
function c82962242.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled()
end
function c82962242.eqfilter1(c)
function c82962242.spfilter(c)
return c:GetFlagEffect(82962242)~=0
end
function c82962242.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetEquipGroup():IsExists(c82962242.spfilter,1,nil) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c82962242.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetEquipGroup():IsExists(c82962242.eqfilter1,1,nil) and c:IsLocation(LOCATION_GRAVE)
return e:GetLabel()==1 and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c82962242.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
--somehow doesnt summon without this
e:GetHandler():CreateEffectRelation(e)
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 c82962242.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)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
end
......@@ -115,26 +115,17 @@ function c90957527.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c90957527.spop(e,tp,eg,ep,ev,re,r,rp)
local zc=Duel.GetLocationCount(tp,LOCATION_MZONE)
if zc==0 then return end
if not Duel.IsExistingMatchingCard(c90957527.filter,tp,LOCATION_DECK,0,2,nil,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c90957527.filter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
if zc==1 then
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
g:RemoveCard(sc)
Duel.SpecialSummon(sc,121,tp,tp,false,false,POS_FACEUP)
sc:RegisterFlagEffect(sc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
Duel.Destroy(g,REASON_EFFECT)
else
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,121,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
tc=g:GetNext()
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c90957527.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
local tc=sg:GetFirst()
Duel.SpecialSummonStep(tc,121,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
tc=sg:GetNext()
Duel.SpecialSummonStep(tc,121,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+0x1ff0000,0,0)
Duel.SpecialSummonComplete()
end
Duel.ShuffleDeck(tp)
end
......@@ -17,14 +17,14 @@ function c93085839.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c93085839.effcon)
e2:SetOperation(c93085839.effop)
e2:SetOperation(c93085839.effop1)
c:RegisterEffect(e2)
--effect gain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_PRE_MATERIAL)
e3:SetCondition(c93085839.effcon)
e3:SetOperation(c93085839.effop1)
e3:SetOperation(c93085839.effop2)
c:RegisterEffect(e3)
end
function c93085839.spfilter(c)
......@@ -48,19 +48,21 @@ function c93085839.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c93085839.effcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_XYZ+REASON_SYNCHRO)~=0 and e:GetHandler():GetReasonCard():IsSetCard(0x107a)
end
function c93085839.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
return (r==REASON_XYZ or r==REASON_SYNCHRO) and e:GetHandler():GetReasonCard():IsSetCard(0x107a)
end
function c93085839.effop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c93085839.chainlm)
end
function c93085839.chainlm(e,rp,tp)
return tp==rp
end
function c93085839.effop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
\ No newline at end of file
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment