Commit b30c8035 authored by TanakaKotoha's avatar TanakaKotoha

fix

parent 9035a3bb
......@@ -7,7 +7,9 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target1)
--e1:SetTarget(cm.target1)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
......@@ -25,37 +27,50 @@ end
function cm.spfilter(c,e,tp)
return c:IsLevelBelow(2) and c:IsSetCard(0xa82) and c:IsAbleToHand() --or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return true end
if Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
-- e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e:SetCategory(CATEGORY_TOHAND)
e:SetOperation(cm.activate)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,0,0,0)
--Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,0,0,0)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetOperation(nil)
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
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.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsAbleToHand() then
--function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
-- if chkc then return chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
-- if chk==0 then return true end
-- if Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp)
-- and Duel.SelectYesNo(tp,aux.Stringid(m,1))
-- then
-- e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
-- e:SetCategory(CATEGORY_TOHAND)
-- e:SetOperation(cm.activate)
-- Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,0,0,0)
--Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,0,0,0)
-- else
-- e:SetCategory(0)
-- e:SetProperty(0)
-- e:SetOperation(nil)
-- end
--end
--function cm.activate(e,tp,eg,ep,ev,re,r,rp)
-- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
-- local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
-- local tc=g:GetFirst()
-- if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsAbleToHand() then
--if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
-- and not tc:IsHasEffect(EFFECT_NECRO_VALLEY)
-- and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
-- Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
-- and not tc:IsHasEffect(EFFECT_NECRO_VALLEY)
-- and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
-- Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
--else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
-- Duel.SendtoHand(tc,nil,REASON_EFFECT)
-- Duel.ConfirmCards(1-tp,tc)
--end
end
end
-- end
--end
--e2
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0xa82) end
......
......@@ -14,14 +14,14 @@ function cm.initial_effect(c)
e1:SetCost(cm.diuka)
e1:SetOperation(cm.tezhao1)
c:RegisterEffect(e1)
--copy--
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,m+10000)
e2:SetCountLimit(1,m+1)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.target)
e2:SetCost(cm.tgcost)
--e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
......@@ -45,22 +45,22 @@ function cm.tezhao1(e,tp,eg,ep,ev,re,r,rp)
end
--e2
function cm.cpfilter(c)
return c:IsSetCard(0xa85) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
return c:IsSetCard(0xa85) and c:IsType(TYPE_MONSTER+TYPE_EFFECT) and c:IsAbleToRemoveAsCost()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_EXTRA and cm.cpfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.cpfilter,tp,LOCATION_EXTRA,LOCATION_EXTRA,1,nil) end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cpfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cpfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetOriginalCode())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=1 then return end
local code=tc:GetOriginalCode()
local code=e:GetLabel()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local reset_flag=RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END
c:CopyEffect(code, reset_flag, 1)
local e1=Effect.CreateEffect(c)
......
......@@ -46,7 +46,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c)
return c:IsSetCard(0xa85) and c:IsAbleToHand()
return c:IsSetCard(0xa84) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
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