Commit 214ecad2 authored by Tachibana's avatar Tachibana

eme

parent 8e369d2b
...@@ -91,7 +91,7 @@ end ...@@ -91,7 +91,7 @@ end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:GetFlagEffect(m+1)~=0 and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) return c:GetFlagEffect(m+1)~=0 and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and c:IsReason(REASON_DESTROY)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
......
...@@ -8,7 +8,7 @@ function cm.initial_effect(c) ...@@ -8,7 +8,7 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCounterLimit(1,m+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
......
...@@ -27,6 +27,10 @@ function cm.initial_effect(c) ...@@ -27,6 +27,10 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop) e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not cm.Decla then
cm.Decla=true
cm.Declatable={}
end
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -54,6 +58,7 @@ end ...@@ -54,6 +58,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler() local c=e:GetHandler()
cm.Declatable[#cm.Declatable+1]=ac
--damage --damage
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -68,10 +73,20 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,10 +73,20 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.rmfilter(c,code) function cm.rmfilter(c,code)
return c:IsAbleToRemoveAsCost() and c:IsCode(code) local code1,code2=c:GetOriginalCodeRule()
return c:IsAbleToRemoveAsCost() and (cm.include(code1,cm.Declatable) or cm.include(code2,cm.Declatable))
end
function cm.include(value,tab)
if not value then return false end
if tab==nil then return false end
for k,v in ipairs(tab) do
if v == value then
return true
end
end
return false
end end
function cm.effcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.effcost(e,tp,eg,ep,ev,re,r,rp,chk)
local code=e:GetLabelObject():GetLabel()
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil,code) and not e:GetHandler():IsControler(tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil,code) and not e:GetHandler():IsControler(tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,1,1,nil,code) local rg=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,1,1,nil,code)
......
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