Commit 5aeea846 authored by Tachibana's avatar Tachibana

eme

parent 4c402fac
Pipeline #6197 passed with stages
in 23 minutes and 56 seconds
...@@ -17,7 +17,7 @@ function cm.initial_effect(c) ...@@ -17,7 +17,7 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_HAND) e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_PZONE) e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(cm.ddcon) e2:SetCondition(cm.ddcon)
e2:SetTarget(cm.ddtg) e2:SetTarget(cm.ddtg)
e2:SetOperation(cm.ddop) e2:SetOperation(cm.ddop)
...@@ -74,21 +74,24 @@ end ...@@ -74,21 +74,24 @@ end
function cm.ddcon(e,tp,eg,ep,ev,re,r,rp) function cm.ddcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW return Duel.GetCurrentPhase()~=PHASE_DRAW
end end
function cm.posfilter(c)
return c:IsCanChangePosition()
end
function cm.ddfilter(c,tp)
return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function cm.ddtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end local rg=eg:Filter(cm.ddfilter,nil,tp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil) if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.posfilter(chkc) and rg:GetCount()~=0 end
if chk==0 then return Duel.IsExistingTarget(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.ddop(e,tp,eg,ep,ev,re,r,rp) function cm.ddop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local tc=Duel.GetFirstTarget()
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) if not tc:IsRelateToEffect(e) then return end
local tc=g:GetFirst() Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
if g:GetCount()>0 and tc:GetPosition()==POS_FACEDOWN_DEFENSE then
Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP)
elseif g:GetCount()>0 and tc:GetPosition()==POS_FACEUP then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp) function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -9,25 +9,25 @@ function cm.initial_effect(c) ...@@ -9,25 +9,25 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(aux.bfgcost) e1:SetCost(aux.bfgcost)
e1:SetTarget(cm.thtg) e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop) e1:SetOperation(cm.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.posfilter(c)
return c:IsCanChangePosition()
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 true end if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.posfilter(chkc) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil) if chk==0 then return Duel.IsExistingTarget(cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,cm.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local tc=Duel.GetFirstTarget()
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) if not tc:IsRelateToEffect(e) then return end
local tc=g:GetFirst() Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
if g:GetCount()>0 and tc:GetPosition()==POS_FACEDOWN_DEFENSE then
Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP)
elseif g:GetCount()>0 and tc:GetPosition()==POS_FACEUP then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
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