Commit 3700616e authored by Tachibana's avatar Tachibana

1145141919810

parent 27eb3967
Pipeline #15072 passed with stage
in 9 minutes and 33 seconds
No preview for this file type
--奥空心白
local m=81009004
local cm=_G["c"..m]
Duel.LoadScript("c81000000.lua")
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,cm.lcheck)
c:EnableReviveLimit()
--todeck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_LINK))
e2:SetValue(500)
c:RegisterEffect(e2)
end
function cm.lcheck(g,lc)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.spfilter(c,e,tp,zone)
return c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
if e:GetHandler():GetMutualLinkedGroupCount()>0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e:SetLabel(1)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetLabel(0)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and zone~=0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)~=0 and e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
......@@ -45,8 +45,8 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2)
c:RegisterEffect(e3)
end
--spfunctions
......@@ -64,26 +64,28 @@ function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
end
--functions e2 needs
function cm.filter(c,e,tp)
return c:IsSetCard(0x852) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x852) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_MONSTER)
end
function cm.filter2(c)
function cm.filter21(c)
return c:IsSetCard(0x852) and c:IsAbleToDeck()
end
function cm.filter11(c)
return c:IsAbleToRemoveAsCost()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetExtraTopGroup(tp,1)
if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEUP)>=1
and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return g:FilterCount(cm.filter11,nil)~=0 end
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.ShuffleExtra(tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.filter21,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local g2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_REMOVED,0,nil)
local g2=Duel.GetMatchingGroup(cm.filter21,tp,LOCATION_REMOVED,0,nil)
local tc=g:GetFirst()
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -131,7 +133,7 @@ end
function cm.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter0,nil)
......@@ -152,7 +154,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_GRAVE,0,nil)
......
......@@ -60,8 +60,8 @@ function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF and Duel.GetTurnPlayer()==e:GetHandler():GetOwner()
end
--functions e2 needs
function cm.filter(c,e,tp)
return c:IsSetCard(0x5852) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function cm.filter(c)
return c:IsSetCard(0x5852) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.filter2(c)
return c:IsAbleToRemove()
......@@ -70,19 +70,20 @@ function cm.filter3(c,e)
return c:IsAttackAbove(2500) and e:GetHandler()~=c
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,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.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g2=Duel.GetExtraTopGroup(tp,1):Filter(cm.filter2,nil)
local g3=Duel.GetExtraTopGroup(1-tp,1):Filter(cm.filter2,nil)
local g4=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_MZONE,0,nil,e)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if g2:GetCount()>0 and g3:GetCount()>0 and g4:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_ATOHAND)
local g1=g:Select(tp,1,1,nil)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
if (g2:GetCount()>0 or g3:GetCount()>0) and g4:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
g2:Merge(g3)
Duel.BreakEffect()
Duel.Remove(g2,POS_FACEUP,REASON_EFFECT)
......
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