Commit ad730e38 authored by songtongtong's avatar songtongtong

fixed

parent 1444dfb5
...@@ -74,12 +74,12 @@ function cm.con1(e,tp) ...@@ -74,12 +74,12 @@ function cm.con1(e,tp)
Duel.DisableActionCheck(true) Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m+1) local dc=Duel.CreateToken(tp,m+1)
Duel.DisableActionCheck(false) Duel.DisableActionCheck(false)
return Duel.GetTurnPlayer()==tp and dc:GetActivateEffect():IsActivatable(tp,false,false) and Duel.IsExistingMatchingCard(cm.rlfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,c,tp) and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) return Duel.GetTurnPlayer()==tp and dc:GetActivateEffect():IsActivatable(tp,false,false) and Duel.IsExistingMatchingCard(cm.rlfilter,tp,LOCATION_HAND,0,1,c,tp) and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end end
function cm.opdo(e,tp,eg,ep,ev,re,r,rp) function cm.opdo(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.rlfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,c,tp) local g=Duel.SelectMatchingCard(tp,cm.rlfilter,tp,LOCATION_HAND,0,1,1,c,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
local sidecode=c.side_code local sidecode=c.side_code
c:SetEntityCode(sidecode) c:SetEntityCode(sidecode)
...@@ -116,7 +116,6 @@ function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -116,7 +116,6 @@ function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.spop1(e,tp,eg,ep,ev,re,r,rp) function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
local dg=eg:Filter(cm.cfilter,nil) local dg=eg:Filter(cm.cfilter,nil)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local atk=dg:GetSum(Card.GetAttack) local atk=dg:GetSum(Card.GetAttack)
if Duel.Damage(tp,atk,REASON_EFFECT)>0 then if Duel.Damage(tp,atk,REASON_EFFECT)>0 then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -16,7 +16,7 @@ function cm.initial_effect(c) ...@@ -16,7 +16,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e0) c:RegisterEffect(e0)
-- --
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
...@@ -70,18 +70,14 @@ function cm.doit(e,tp) ...@@ -70,18 +70,14 @@ function cm.doit(e,tp)
e:Reset() e:Reset()
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetDecktopGroup(tp,5) if chk==0 then return true end
if chk==0 then return rg:GetCount()==5 and rg:FilterCount(Card.IsAbleToRemove,nil,POS_FACEDOWN,REASON_EFFECT)==5 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,5,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.thcheck(c) function cm.thcheck(c)
return aux.IsCodeListed(c,16172004) and c:IsAbleToHand() return aux.IsCodeListed(c,16172004) and c:IsAbleToHand()
end end
function cm.activate(e,tp) function cm.activate(e,tp)
local rg=Duel.GetDecktopGroup(tp,5) if Duel.IsExistingMatchingCard(cm.thcheck,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
if rg:GetCount()==5 and rg:FilterCount(Card.IsAbleToRemove,nil,POS_FACEDOWN,REASON_EFFECT)==5 then
if Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)==5 and Duel.IsExistingMatchingCard(cm.thcheck,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,cm.thcheck,tp,LOCATION_DECK,0,1,1,nil) local tg=Duel.SelectMatchingCard(tp,cm.thcheck,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT) Duel.SendtoHand(tg,tp,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