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)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_OATH)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
......@@ -21,11 +21,10 @@ function cm.initial_effect(c)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROY)
e4:SetTarget(cm.ovtg)
e4:SetOperation(cm.ovop)
e4:SetCountLimit(2)
......@@ -61,28 +60,45 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.target1(e,c)
return c:IsSetCard(0x8a72) or c:IsSetCard(0x7a72)
end
function cm.target1(e,c)
return c:IsSetCard(0x8a72) or c:IsSetCard(0x7a72)
end
function cm.mfilter(c,e,tp)
return 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)))
or (mc:IsReason(REASON_EFFECT) and mc:GetReasonPlayer()==tp and (re:GetHandler():IsSetCard(0x8a72) or re:GetHandler():IsSetCard(0x7a72))))
return Duel.GetFlagEffect(tp,m)<2 and Duel.IsExistingMatchingCard(function(c,mc)
return c:IsType(TYPE_MONSTER) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsSetCard(0x8a72) and mc:IsCanBeXyzMaterial(c) and
((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
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
end
function cm.ovop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local g=eg:Filter(cm.mfilter,e:GetHandler(),e,tp)
local tc=Duel.SelectMatchingCard(tp,function(c,sg)
return c:IsType(TYPE_XYZ) 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 Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local g=eg:Filter(cm.mfilter,e:GetHandler(),e,tp)
local tc=Duel.SelectMatchingCard(tp,
function(c,sg)
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 tc==nil then return end
if g:GetCount()>0 then
Duel.Overlay(tc,g)
for rc in aux.Next(g) do
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
\ 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