Commit 59a62912 authored by Nemo Ma's avatar Nemo Ma

fix

parent 4e386dec
......@@ -62,11 +62,14 @@ function cm.initial_effect(c)
e7:SetCategory(CATEGORY_SPECIAL_SUMMON)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetCode(EVENT_FREE_CHAIN)
e7:SetRange(LOCATION_REMOVED+LOCATION_GRAVE)
e7:SetRange(LOCATION_REMOVED)
e7:SetCost(cm.spco1)
e7:SetTarget(cm.sptg1)
--e7:SetTarget(cm.sptg1)
e7:SetOperation(cm.spop1)
c:RegisterEffect(e7)
local e11=e7:Clone()
e11:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e11)
--remove
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,3))
......@@ -158,9 +161,7 @@ function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cosfilter(c,tp)
return c:GetOwner()==1-tp and
c:IsType(TYPE_MONSTER)
and c:IsReleasable()
return c:GetOwner()==1-tp and c:IsType(TYPE_MONSTER) and c:IsReleasable()
and (c:IsSummonType(SUMMON_TYPE_SPECIAL) or c:IsSummonType(SUMMON_TYPE_NORMAL))
end
......@@ -179,7 +180,8 @@ end
function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0)
Duel.SetChainLimit(cm.chlimit)
end
......@@ -219,12 +221,18 @@ end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOGRAVE-RESET_REMOVE,0,1,Duel.GetTurnCount())
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,Duel.GetTurnCount())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetLabel(Duel.GetTurnCount())
if Duel.GetTurnPlayer()==c:GetOwner() and Duel.GetCurrentPhase()==PHASE_END then
e1:SetLabel(Duel.GetTurnCount()+2)
elseif Duel.GetTurnPlayer()==c:GetOwner() then
e1:SetLabel(Duel.GetTurnCount())
else
e1:SetLabel(Duel.GetTurnCount()+1)
end
e1:SetLabelObject(c)
e1:SetCondition(cm.spspcon)
e1:SetOperation(cm.spspop)
......@@ -235,7 +243,7 @@ end
function cm.spspcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()==tp and c:GetFlagEffectLabel(m)==e:GetLabel()
return Duel.GetTurnCount()==e:GetLabel() and Duel.GetTurnPlayer()==tp
end
function cm.spspop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -26,16 +26,16 @@ function c33300362.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
return c:IsCanChangePosition()
end
function cm.filter2(c)
return c:IsSetCard(0x563) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and cm.filter(chkc) and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -47,8 +47,18 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
if tc:IsRelateToEffect(e) then
if tc:IsPosition(POS_FACEDOWN_DEFENSE) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
elseif tc:IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
elseif tc:IsPosition(POS_FACEUP_ATTACK) then
if Duel.SelectOption(tp,aux.Stringid(23912837,2),aux.Stringid(23912837,3))==0 then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
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