Commit 6293b9e9 authored by Momobako's avatar Momobako

Push by Appveyor

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