Commit 87685ba6 authored by POLYMER's avatar POLYMER

fix

parent dd71faf0
......@@ -106,7 +106,7 @@ function cm.initial_effect(c)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CHAINING)
ge3:SetCondition(function() return not pnfl_adjusting end)
ge3:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and not pnfl_adjusting end)
ge3:SetOperation(cm.adjustop)
Duel.RegisterEffect(ge3,0)
local ge31=ge3:Clone()
......@@ -119,7 +119,7 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge41,1)
local ge5=ge3:Clone()
ge5:SetCode(EVENT_CHAIN_SOLVED)
ge5:SetCondition(function() return Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
ge5:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
Duel.RegisterEffect(ge5,0)
local ge51=ge5:Clone()
Duel.RegisterEffect(ge51,1)
......@@ -136,7 +136,7 @@ function cm.fccon(e,tp,eg,ep,ev,re,r,rp)
local tg=ce:GetTarget() or aux.TRUE
if aux.GetValueType(ce)=="Effect" and aux.GetValueType(tc)=="Card" then
local ccode=tc:GetOriginalCode()
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0xff,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
end
end
return false
......
......@@ -105,7 +105,7 @@ function cm.initial_effect(c)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CHAINING)
ge3:SetCondition(function() return not pnfl_adjusting end)
ge3:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and not pnfl_adjusting end)
ge3:SetOperation(cm.adjustop)
Duel.RegisterEffect(ge3,0)
local ge31=ge3:Clone()
......@@ -118,7 +118,7 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge41,1)
local ge5=ge3:Clone()
ge5:SetCode(EVENT_CHAIN_SOLVED)
ge5:SetCondition(function() return Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
ge5:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
Duel.RegisterEffect(ge5,0)
local ge51=ge5:Clone()
Duel.RegisterEffect(ge51,1)
......@@ -135,7 +135,7 @@ function cm.fccon(e,tp,eg,ep,ev,re,r,rp)
local tg=ce:GetTarget() or aux.TRUE
if aux.GetValueType(ce)=="Effect" and aux.GetValueType(tc)=="Card" then
local ccode=tc:GetOriginalCode()
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0xff,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
end
end
return false
......
......@@ -114,7 +114,7 @@ function cm.initial_effect(c)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CHAINING)
ge3:SetCondition(function() return not pnfl_adjusting end)
ge3:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and not pnfl_adjusting end)
ge3:SetOperation(cm.adjustop)
Duel.RegisterEffect(ge3,0)
local ge31=ge3:Clone()
......@@ -127,7 +127,7 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge41,1)
local ge5=ge3:Clone()
ge5:SetCode(EVENT_CHAIN_SOLVED)
ge5:SetCondition(function() return Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
ge5:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
Duel.RegisterEffect(ge5,0)
local ge51=ge5:Clone()
Duel.RegisterEffect(ge51,1)
......@@ -144,7 +144,7 @@ function cm.fccon(e,tp,eg,ep,ev,re,r,rp)
local tg=ce:GetTarget() or aux.TRUE
if aux.GetValueType(ce)=="Effect" and aux.GetValueType(tc)=="Card" then
local ccode=tc:GetOriginalCode()
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0xff,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
end
end
return false
......
......@@ -101,7 +101,7 @@ function cm.initial_effect(c)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CHAINING)
ge3:SetCondition(function() return not pnfl_adjusting end)
ge3:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and not pnfl_adjusting end)
ge3:SetOperation(cm.adjustop)
Duel.RegisterEffect(ge3,0)
local ge31=ge3:Clone()
......@@ -114,7 +114,7 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge41,1)
local ge5=ge3:Clone()
ge5:SetCode(EVENT_CHAIN_SOLVED)
ge5:SetCondition(function() return Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
ge5:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) and Duel.GetCurrentChain()==1 and not pnfl_adjusting end)
Duel.RegisterEffect(ge5,0)
local ge51=ge5:Clone()
Duel.RegisterEffect(ge51,1)
......@@ -131,7 +131,7 @@ function cm.fccon(e,tp,eg,ep,ev,re,r,rp)
local tg=ce:GetTarget() or aux.TRUE
if aux.GetValueType(ce)=="Effect" and aux.GetValueType(tc)=="Card" then
local ccode=tc:GetOriginalCode()
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0xff,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
if Duel.IsExistingMatchingCard(cm.mfilter,tp,0xff,0,1,nil) then return true end --not PNFL_MIRROR_ACTIVATED[tp][ccode] and
end
end
return false
......
......@@ -196,16 +196,18 @@ function cm.addition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,11451928)>0 then return end
Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--if Duel.GetFlagEffect(tp,11451928)>0 then return end
--Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetDescription(aux.Stringid(11451927,2))
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1-tp)
......@@ -215,26 +217,28 @@ function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.disscon)
e3:SetOperation(cm.dissop)
e3:SetReset(RESET_PHASE+PHASE_END)
--e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(cm.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function cm.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
end
function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(re:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
......
......@@ -205,16 +205,18 @@ function cm.addition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,11451928)>0 then return end
Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--if Duel.GetFlagEffect(tp,11451928)>0 then return end
--Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetDescription(aux.Stringid(11451927,2))
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1-tp)
......@@ -224,26 +226,28 @@ function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.disscon)
e3:SetOperation(cm.dissop)
e3:SetReset(RESET_PHASE+PHASE_END)
--e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(cm.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function cm.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
end
function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(re:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
......
......@@ -229,16 +229,18 @@ function cm.addition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,11451928)>0 then return end
Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--if Duel.GetFlagEffect(tp,11451928)>0 then return end
--Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetDescription(aux.Stringid(11451927,2))
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1-tp)
......@@ -248,26 +250,28 @@ function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.disscon)
e3:SetOperation(cm.dissop)
e3:SetReset(RESET_PHASE+PHASE_END)
--e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(cm.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function cm.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
end
function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(re:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
......
......@@ -196,16 +196,18 @@ function cm.addition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,11451928)>0 then return end
Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--if Duel.GetFlagEffect(tp,11451928)>0 then return end
--Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetDescription(aux.Stringid(11451927,2))
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1-tp)
......@@ -215,26 +217,28 @@ function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.disscon)
e3:SetOperation(cm.dissop)
e3:SetReset(RESET_PHASE+PHASE_END)
--e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(cm.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function cm.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
end
function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(re:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
......
......@@ -227,16 +227,18 @@ function cm.addition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,11451928)>0 then return end
Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--if Duel.GetFlagEffect(tp,11451928)>0 then return end
--Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetDescription(aux.Stringid(11451927,2))
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1-tp)
......@@ -246,26 +248,28 @@ function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.disscon)
e3:SetOperation(cm.dissop)
e3:SetReset(RESET_PHASE+PHASE_END)
--e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(cm.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function cm.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
end
function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(re:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
......
......@@ -302,16 +302,18 @@ function cm.addition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,11451928)>0 then return end
Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--if Duel.GetFlagEffect(tp,11451928)>0 then return end
--Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetDescription(aux.Stringid(11451927,2))
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1-tp)
......@@ -321,26 +323,28 @@ function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(cm.disscon)
e3:SetOperation(cm.dissop)
e3:SetReset(RESET_PHASE+PHASE_END)
--e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(cm.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function cm.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
end
function cm.dissop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(re:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
......
......@@ -574,13 +574,13 @@ function cm.regsop(e,tp,eg,ep,ev,re,r,rp)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(cm.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function cm.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
......
......@@ -3,23 +3,15 @@ local m=35399325
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(35399325,0))
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35399325,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,35399325+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c35399325.target)
e1:SetCountLimit(1,35399325)
e1:SetOperation(c35399325.activate)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35399325,2))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
......@@ -37,31 +29,26 @@ function cm.initial_effect(c)
e3:SetTarget(c35399325.tdtg)
e3:SetOperation(c35399325.tdop)
c:RegisterEffect(e3)
end
function c35399325.thfilter(c)
return ((c:IsLevelBelow(3) and c:IsType(TYPE_TUNER) and (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_FIEND))) or c:IsSetCard(0x1017)) and c:IsAbleToHand()
end
function c35399325.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35399325.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c35399325.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c35399325.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(35399325,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,0,nil)
if #g>0 then
Duel.ConfirmCards(1-tp,sg)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:Select(tp,1,1,nil)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
Duel.SetLP(tp,Duel.GetLP(tp)-1500)
end
end
Duel.ConfirmCards(1-tp,sg)
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,0,nil)
if #g2>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g2:Select(tp,1,1,nil)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
Duel.SetLP(tp,Duel.GetLP(tp)-1500)
end
end
end
end
end
......
......@@ -60,7 +60,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.filter(c,e,tp)
return cm.MagicCombineDemon(c) or (c:IsLevel(6) and c:IsRace(RACE_ZOMBIE)) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
return cm.MagicCombineDemon(c) or (c:IsLevel(6) and c:IsRace(RACE_ZOMBIE)) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -74,7 +74,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP)~=0 then
if Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
......
......@@ -94,6 +94,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetLabelObject(sc)
e1:SetCondition(cm.fpcon)
e1:SetOperation(cm.fpop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
......
......@@ -191,16 +191,18 @@ function c9310055.addition(e,tp,eg,ep,ev,re,r,rp)
end
function c9310055.regsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,11451928)>0 then return end
Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--if Duel.GetFlagEffect(tp,11451928)>0 then return end
--Duel.RegisterFlagEffect(tp,11451928,RESET_PHASE+PHASE_END,0,1)
--activate from hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetDescription(aux.Stringid(11451927,2))
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetReset(RESET_PHASE+PHASE_END)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
Duel.RegisterEffect(e2,1-tp)
......@@ -210,26 +212,28 @@ function c9310055.regsop(e,tp,eg,ep,ev,re,r,rp)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCondition(c9310055.disscon)
e3:SetOperation(c9310055.dissop)
e3:SetReset(RESET_PHASE+PHASE_END)
--e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(function() return Duel.GetTurnPlayer()==tp end)
e4:SetTarget(c9310055.indtg)
e4:SetValue(function() e:SetLabel(1) return 1 end)
e4:SetReset(RESET_PHASE+PHASE_END)
e4:SetValue(function(e) e:SetLabel(1) return 1 end)
--e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function c9310055.indtg(e,c)
local tc=e:GetHandler()
return (c==tc or c==tc:GetBattleTarget()) and c:IsFaceup() and e:GetLabel()==0
return c:IsFaceup() and e:GetLabel()==0
end
function c9310055.disscon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)
return re:IsActiveType(TYPE_SPELL) and Duel.GetTurnPlayer()==tp
end
function c9310055.dissop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(re:GetHandler(),POS_FACEUP,REASON_EFFECT)
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