Commit 48e07b91 authored by POLYMER's avatar POLYMER

fix

parent 7f9243b6
...@@ -77,7 +77,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,7 +77,7 @@ function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local sg1=g1:SelectSubGroup(tp,cm.fselect,false,1,3) local sg1=g1:SelectSubGroup(tp,cm.fselect,false,1,3)
local sg2=g2:SelectSubGroup(1-tp,cm.fselect,false,1,3) local sg2=g2:SelectSubGroup(1-tp,cm.fselect,false,1,3)
if Duel.SendtoDeck(sg1+sg2,nil,2,REASON_EFFECT)>0 then if Duel.SendtoDeck(sg1+sg2,nil,2,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup() local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
local ct1=#Group.__band(og,sg1) local ct1=#Group.__band(og,sg1)
local ct2=#Group.__band(og,sg2) local ct2=#Group.__band(og,sg2)
if ct1==0 and ct2==0 then return end if ct1==0 and ct2==0 then return end
...@@ -175,7 +175,7 @@ function cm.returntofield(tc) ...@@ -175,7 +175,7 @@ function cm.returntofield(tc)
Duel.BreakEffect() Duel.BreakEffect()
end end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
return return
end end
if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then if tc:GetPreviousTypeOnField()&TYPE_EQUIP>0 then
Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN) Duel.SendtoGrave(tc,REASON_RULE+REASON_RETURN)
......
...@@ -159,7 +159,7 @@ end ...@@ -159,7 +159,7 @@ end
function cm.sop(e,tp,eg,ep,ev,re,r,rp) function cm.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local lk=math.ceil(Duel.SendtoDeck(g,nil,2,REASON_EFFECT)/2) local lk=math.ceil(Duel.SendtoDeck(g,nil,2,REASON_EFFECT):FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)/2)
Debug.Message(lk) Debug.Message(lk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lk):GetFirst()
......
...@@ -53,8 +53,9 @@ end ...@@ -53,8 +53,9 @@ end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local b1=rc:IsAbleToGrave() and not rc:IsLocation(LOCATION_GRAVE) if not rc:IsRelateToEffect(re) then return end
local b2=(Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and rc:IsCanBeSpecialSummoned(e,0,tp,false,false)) local b1=rc:IsAbleToGrave() and not rc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
local b2=(Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and rc:IsCanBeSpecialSummoned(e,0,tp,false,false))
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
if re:GetHandler():IsAttribute(ATTRIBUTE_DARK) then if re:GetHandler():IsAttribute(ATTRIBUTE_DARK) then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
...@@ -75,7 +76,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,7 +76,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if rc:IsRelateToEffect(re) then if rc:IsRelateToEffect(re) then
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local b1=tc:IsAbleToGrave() and not tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) local b1=tc:IsAbleToGrave() and not tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
local b2=(Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)) local b2=(Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false))
local off=1 local off=1
local ops={} local ops={}
local opval={} local opval={}
......
...@@ -4,10 +4,10 @@ function s.initial_effect(c) ...@@ -4,10 +4,10 @@ function s.initial_effect(c)
aux.AddCodeList(c,12866665,12866620) aux.AddCodeList(c,12866665,12866620)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.thtg) e1:SetTarget(s.thtg)
e1:SetOperation(s.thop) e1:SetOperation(s.thop)
...@@ -17,20 +17,22 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -17,20 +17,22 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function s.thfil1(c) function s.thfil1(c,e,tp)
return c:IsCode(12866665) and c:IsAbleToHand() and c:IsAbleToGrave() return c:IsCode(12866665) and c:IsAbleToGrave() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.thfil2(c) function s.thfil2(c,e,tp)
return c:IsCode(12866620) and c:IsAbleToHand() and c:IsAbleToGrave() return c:IsCode(12866620) and c:IsAbleToGrave() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfil1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(s.thfil2,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfil1,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.thfil2,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(s.thfil1,tp,LOCATION_DECK,0,1,nil) local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local g2=Duel.GetMatchingGroup(s.thfil2,tp,LOCATION_DECK,0,1,nil) if not b1 then return end
local g1=Duel.GetMatchingGroup(s.thfil1,tp,LOCATION_DECK,0,nil,e,tp)
local g2=Duel.GetMatchingGroup(s.thfil2,tp,LOCATION_DECK,0,nil,e,tp)
if g1:GetCount()==0 or g2:GetCount()==0 then return end if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg1=g1:Select(tp,1,1,nil) local sg1=g1:Select(tp,1,1,nil)
...@@ -39,11 +41,10 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,11 +41,10 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
sg1:Merge(sg2) sg1:Merge(sg2)
Duel.ConfirmCards(1-tp,sg1) Duel.ConfirmCards(1-tp,sg1)
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local cg=sg1:RandomSelect(1-tp,1,1,nil) local cg=sg1:RandomSelect(1-tp,1,1,nil)
local tc=cg:GetFirst() local tc=cg:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
Duel.ConfirmCards(1-tp,tc)
sg1:RemoveCard(tc) sg1:RemoveCard(tc)
Duel.SendtoGrave(sg1,nil,REASON_EFFECT) Duel.SendtoGrave(sg1,nil,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -47,10 +47,10 @@ function c65899900.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -47,10 +47,10 @@ function c65899900.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function c65899900.activate(e,tp,eg,ep,ev,re,r,rp) function c65899900.activate(e,tp,eg,ep,ev,re,r,rp)
Debug.Message("Tickrate error occured")
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
Duel.BreakEffect() Duel.BreakEffect()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
Debug.Message("Tickrate error occured")
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