Commit b30c8035 authored by TanakaKotoha's avatar TanakaKotoha

fix

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