Commit daaf7017 authored by Uytrewq's avatar Uytrewq Committed by GitHub

fix (#2384)

parent bc1b1692
...@@ -88,8 +88,8 @@ function s.cfilter(c,g) ...@@ -88,8 +88,8 @@ function s.cfilter(c,g)
end end
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup() local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,s.cfilter,1,nil,lg) end if chk==0 then return Duel.CheckReleaseGroup(tp,s.cfilter,1,nil,lg) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,s.cfilter,1,1,nil,lg) local g=Duel.SelectReleaseGroup(tp,s.cfilter,1,1,nil,lg)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function s.rmfilter(c,e,tp) function s.rmfilter(c,e,tp)
......
...@@ -25,10 +25,10 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -25,10 +25,10 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0) e:SetLabel(0)
local res=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local res=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp)
if Duel.CheckReleaseGroup(REASON_COST,tp,s.cfilter,1,nil,tp) if Duel.CheckReleaseGroup(tp,s.cfilter,1,nil,tp)
and (not res or Duel.SelectYesNo(tp,aux.Stringid(id,1))) then and (not res or Duel.SelectYesNo(tp,aux.Stringid(id,1))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(REASON_COST,tp,s.cfilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(tp,s.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
e:SetLabel(LOCATION_DECK) e:SetLabel(LOCATION_DECK)
end end
...@@ -36,7 +36,7 @@ end ...@@ -36,7 +36,7 @@ end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp)
or e:IsCostChecked() and e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.CheckReleaseGroup(REASON_COST,tp,s.cfilter,1,nil,tp) or e:IsCostChecked() and e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.CheckReleaseGroup(tp,s.cfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)) end
if not e:IsCostChecked() then e:SetLabel(0) end if not e:IsCostChecked() then e:SetLabel(0) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND+e:GetLabel()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND+e:GetLabel())
......
...@@ -6,34 +6,27 @@ function c88654892.initial_effect(c) ...@@ -6,34 +6,27 @@ function c88654892.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88654892+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,88654892+EFFECT_COUNT_CODE_OATH)
e1:SetLabel(0)
e1:SetCost(c88654892.cost) e1:SetCost(c88654892.cost)
e1:SetTarget(c88654892.target) e1:SetTarget(c88654892.target)
e1:SetOperation(c88654892.activate) e1:SetOperation(c88654892.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c88654892.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c88654892.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100) if chk==0 then return Duel.CheckReleaseGroup(tp,c88654892.filter1,1,nil,e,tp) end
return true local rg=Duel.SelectReleaseGroup(tp,c88654892.filter1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetLevel())
Duel.Release(rg,REASON_COST)
end end
function c88654892.filter1(c,e,tp,ft) function c88654892.filter1(c,e,tp)
local lv=c:GetLevel() local lv=c:GetLevel()
return lv>0 and c:IsReleasable() and (c:IsType(TYPE_FUSION) or c:IsType(TYPE_SYNCHRO)) and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup()) return lv>0 and (c:IsType(TYPE_FUSION) or c:IsType(TYPE_SYNCHRO)) and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c88654892.filter2,tp,LOCATION_DECK,0,1,nil,lv,e,tp) and Duel.IsExistingMatchingCard(c88654892.filter2,tp,LOCATION_DECK,0,1,nil,lv,e,tp)
end end
function c88654892.filter2(c,lv,e,tp) function c88654892.filter2(c,lv,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_MONSTER) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c88654892.target(e,tp,eg,ep,ev,re,r,rp,chk) function c88654892.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return e:IsCostChecked() end
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return ft>-1 and Duel.CheckReleaseGroup(REASON_COST,tp,c88654892.filter1,1,nil,e,tp,ft)
end
local rg=Duel.SelectReleaseGroup(REASON_COST,tp,c88654892.filter1,1,1,nil,e,tp,ft)
e:SetLabel(rg:GetFirst():GetLevel())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c88654892.activate(e,tp,eg,ep,ev,re,r,rp) function c88654892.activate(e,tp,eg,ep,ev,re,r,rp)
......
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