Commit 2361d1f6 authored by Tachibana's avatar Tachibana

eme

parent 820a3d9f
Pipeline #8369 passed with stages
in 36 minutes and 26 seconds
...@@ -6,11 +6,11 @@ function cm.initial_effect(c) ...@@ -6,11 +6,11 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
...@@ -21,11 +21,10 @@ function cm.initial_effect(c) ...@@ -21,11 +21,10 @@ function cm.initial_effect(c)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_DESTROYED) e4:SetCode(EVENT_DESTROY)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e4:SetTarget(cm.ovtg) e4:SetTarget(cm.ovtg)
e4:SetOperation(cm.ovop) e4:SetOperation(cm.ovop)
e4:SetCountLimit(2) e4:SetCountLimit(2)
...@@ -61,28 +60,45 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,28 +60,45 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function cm.target1(e,c) function cm.target1(e,c)
return c:IsSetCard(0x8a72) or c:IsSetCard(0x7a72) return c:IsSetCard(0x8a72) or c:IsSetCard(0x7a72)
end end
function cm.mfilter(c,e,tp) function cm.mfilter(c,e,tp)
return Duel.IsExistingMatchingCard(function(c,mc) return Duel.GetFlagEffect(tp,m)<2 and Duel.IsExistingMatchingCard(function(c,mc)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8a72) and mc:IsCanBeXyzMaterial(c) and ((mc:IsReason(REASON_BATTLE) and mc:GetReasonPlayer()==tp and (mc:GetReasonCard():IsSetCard(0x8a72) or mc:GetReasonCard():IsSetCard(0x7a72))) return c:IsType(TYPE_MONSTER) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsSetCard(0x8a72) and mc:IsCanBeXyzMaterial(c) and
or (mc:IsReason(REASON_EFFECT) and mc:GetReasonPlayer()==tp and (re:GetHandler():IsSetCard(0x8a72) or re:GetHandler():IsSetCard(0x7a72)))) ((mc:IsReason(REASON_BATTLE) and mc:GetReasonPlayer()==tp and mc:GetReasonCard():IsSetCard(0x8a72,0x7a72))
or (mc:IsReason(REASON_EFFECT) and mc:GetReasonEffect():GetHandlerPlayer()==tp and mc:GetReasonEffect():GetHandler():IsSetCard(0x8a72,0x7a72)))
end,tp,LOCATION_MZONE,0,1,nil,c) end,tp,LOCATION_MZONE,0,1,nil,c)
end end
function cm.ovtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.mfilter,1,nil,e,tp) end if chk==0 then return eg:IsExists(cm.mfilter,1,nil,e,tp) end
end end
function cm.ovop(e,tp,eg,ep,ev,re,r,rp) function cm.ovop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local g=eg:Filter(cm.mfilter,e:GetHandler(),e,tp) local g=eg:Filter(cm.mfilter,e:GetHandler(),e,tp)
local tc=Duel.SelectMatchingCard(tp,function(c,sg) local tc=Duel.SelectMatchingCard(tp,
return c:IsType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8a72) and sg:IsExists(function(c,sc) function(c,sg)
return c:IsCanBeXyzMaterial(sc) end,1,nil,c) end,tp,LOCATION_MZONE,0,1,1,nil,g):GetFirst() return c:IsType(TYPE_XYZ) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x8a72)
and sg:IsExists(
function(c,sc)
return c:IsCanBeXyzMaterial(sc)
end
,1,nil,c)
end,tp,LOCATION_MZONE,0,1,1,nil,g):GetFirst()
if g==nil then return end if g==nil then return end
if tc==nil then return end if tc==nil then return end
if g:GetCount()>0 then for rc in aux.Next(g) do
Duel.Overlay(tc,g) local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Overlay(tc,rc)
return true
end)
e1:SetValue(function() return true end)
rc:RegisterEffect(e1,true)
end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1,0)
end end
end
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