Commit 6293b9e9 authored by Momobako's avatar Momobako

Push by Appveyor

parent b09a5e3d
......@@ -4,86 +4,87 @@ local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_rabbit=true
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,function(c)
return mil.is_series(c,'rabbit')
end,2,2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(function(e) return e:GetHandler():IsLinkState() end)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=e:GetHandler():GetLinkedZone()
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>1
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.SelectOption(tp,70,71,72))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end)
e4:SetOperation(
function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<=1 then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,g)
local sgnum=0
local opt=e:GetLabel()
if opt==0 then
sgnum=g:Filter(Card.IsType,nil,TYPE_MONSTER):GetCount()
elseif opt==1 then
sgnum=g:Filter(Card.IsType,nil,TYPE_SPELL):GetCount()
elseif opt==2 then
sgnum=g:Filter(Card.IsType,nil,TYPE_TRAP):GetCount()
end
if sgnum>1 then
local zone=e:GetHandler():GetLinkedZone()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
local sc=sg:GetFirst()
local effectnum=0
if sc then
if zone~=0 and sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
and (not sc:IsAbleToHand() or Duel.SelectYesNo(tp,aux.Stringid(m,1))) then
effectnum=Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP,zone)
else
effectnum=Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
end
local rthg=Duel.GetMatchingGroup(cm.rthfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
if effectnum~=0 and rthg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rthgs=rthg:Select(tp,1,1,nil)
Duel.SendtoHand(rthgs,nil,REASON_EFFECT)
end
end
end
end)
c:RegisterEffect(e4)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,function(c)
return mil.is_series(c,'rabbit')
end,2,2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(function(e) return e:GetHandler():IsLinkState() end)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=e:GetHandler():GetLinkedZone()
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>1
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.SelectOption(tp,70,71,72))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end)
e4:SetOperation(
function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<=1 then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,g)
local sgnum=0
local opt=e:GetLabel()
if opt==0 then
sgnum=g:Filter(Card.IsType,nil,TYPE_MONSTER):GetCount()
elseif opt==1 then
sgnum=g:Filter(Card.IsType,nil,TYPE_SPELL):GetCount()
elseif opt==2 then
sgnum=g:Filter(Card.IsType,nil,TYPE_TRAP):GetCount()
end
if sgnum>1 then
Duel.ShuffleHand(1-tp)
local zone=e:GetHandler():GetLinkedZone()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
local sc=sg:GetFirst()
local effectnum=0
if sc then
if zone~=0 and sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
and (not sc:IsAbleToHand() or Duel.SelectYesNo(tp,aux.Stringid(m,1))) then
effectnum=Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP,zone)
else
effectnum=Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
end
local rthg=Duel.GetMatchingGroup(cm.rthfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
if effectnum~=0 and rthg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rthgs=rthg:Select(tp,1,1,nil)
Duel.SendtoHand(rthgs,nil,REASON_EFFECT)
end
end
end
end)
c:RegisterEffect(e4)
end
function cm.spfilter(c,e,tp,zone)
return mil.is_series(c,'rabbit') and c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or (zone~=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)))
return mil.is_series(c,'rabbit') and c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or (zone~=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)))
end
function cm.rthfilter(c)
return c:IsFaceup() and mil.is_series(c,'rabbit')
end
\ No newline at end of file
return c:IsFaceup() and mil.is_series(c,'rabbit')
end
......@@ -4,94 +4,94 @@ local cm=_G["c"..m]
local mil=require("expansions/script/Millux")
cm.is_series_with_rabbit=true
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,function(c)
return mil.is_series(c,'rabbit')
end,2,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>2 and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
e:SetLabel(op)
end)
e1:SetOperation(
function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(1-tp,g)
local tpe=0
if e:GetLabel()==0 then
tpe=TYPE_FUSION
elseif e:GetLabel()==1 then
tpe=TYPE_SYNCHRO
elseif e:GetLabel()==2 then
tpe=TYPE_XYZ
else tpe=TYPE_LINK
end
local sg=g:Filter(Card.IsType,nil,tpe)
local ct=sg:GetClassCount(Card.GetCode)
if ct>2 then
local drmum = Duel.Draw(tp,1,REASON_EFFECT)
local rthg=Duel.GetMatchingGroup(cm.rthfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
if drmun~=0 and rthg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rthgs=rthg:Select(tp,1,1,nil)
Duel.SendtoHand(rthgs,nil,REASON_EFFECT)
end
end
end)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,5))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,3,e:GetHandler) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
end)
e2:SetOperation(
function(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)~=3 then return end
Duel.SendtoHand(tg,nil,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_HAND+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(tp,2,2,nil)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
Duel.SortDecktop(tp,tp,2)
else
local hg=Duel.GetFieldGroup(p,LOCATION_HAND,0)
local ct=Duel.SendtoDeck(hg,nil,0,REASON_EFFECT)
Duel.SortDecktop(tp,tp,ct)
end
end
end)
c:RegisterEffect(e2)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,function(c)
return mil.is_series(c,'rabbit')
end,2,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>2 and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
e:SetLabel(op)
end)
e1:SetOperation(
function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(1-tp,g)
local tpe=0
if e:GetLabel()==0 then
tpe=TYPE_FUSION
elseif e:GetLabel()==1 then
tpe=TYPE_SYNCHRO
elseif e:GetLabel()==2 then
tpe=TYPE_XYZ
else tpe=TYPE_LINK
end
local sg=g:Filter(Card.IsType,nil,tpe)
local ct=sg:GetClassCount(Card.GetCode)
if ct>2 then
local drmum = Duel.Draw(tp,1,REASON_EFFECT)
local rthg=Duel.GetMatchingGroup(cm.rthfilter,tp,LOCATION_ONFIELD,0,e:GetHandler())
if drmun~=0 and rthg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rthgs=rthg:Select(tp,1,1,nil)
Duel.SendtoHand(rthgs,nil,REASON_EFFECT)
end
end
end)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,5))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(
function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,3,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
end)
e2:SetOperation(
function(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)~=3 then return end
Duel.SendtoHand(tg,nil,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_HAND+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(tp,2,2,nil)
Duel.SendtoDeck(sg,nil,0,REASON_EFFECT)
Duel.SortDecktop(tp,tp,2)
else
local hg=Duel.GetFieldGroup(p,LOCATION_HAND,0)
local ct=Duel.SendtoDeck(hg,nil,0,REASON_EFFECT)
Duel.SortDecktop(tp,tp,ct)
end
end
end)
c:RegisterEffect(e2)
end
function cm.rthfilter(c)
return c:IsFaceup() and mil.is_series(c,'rabbit')
return c:IsFaceup() and mil.is_series(c,'rabbit')
end
function cm.filter(c)
return mil.is_series(c,'rabbit') and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
\ No newline at end of file
return mil.is_series(c,'rabbit') and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
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