Commit 8c5ec0d7 authored by Nemo Ma's avatar Nemo Ma

fix

parent e1588070
......@@ -153,13 +153,14 @@ function cm.scop(e,tp,eg,ep,ev,re,r,rp)
local ac=g:GetFirst()
local bc=g:GetNext()
local e1=Effect.CreateEffect(e:GetHandler())
local eid=e1:GetFieldID()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabel(eid)
e1:SetCondition(cm.con)
Duel.RegisterEffect(e1,tp)
local eid=e1:GetFieldID()
e1:SetLabel(eid)
if ac:IsAttribute(bc:GetAttribute()) and (ac:GetAttribute()==bc:GetAttribute() or Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))==0) then
ac:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,2))
bc:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,2))
......@@ -169,7 +170,6 @@ function cm.scop(e,tp,eg,ep,ev,re,r,rp)
bc:RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,3))
e1:SetTarget(cm.sumlimit2)
end
Duel.RegisterEffect(e1,tp)
end
function cm.cfilter2(c,eid)
return c:IsFaceup() and c:GetFlagEffect(m+1)~=0 and c:GetFlagEffectLabel(m+1)==eid
......
......@@ -43,12 +43,13 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetOperation(cm.spop)
Duel.RegisterEffect(e2,tp)
local e1=Effect.CreateEffect(c)
local eid=e1:GetFieldID()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetLabel(eid)
e1:SetLabelObject(e2)
Duel.RegisterEffect(e1,tp)
local eid=e1:GetFieldID()
e1:SetLabel(eid)
e1:SetCondition(function(e)
local eid=e:GetLabel()
local sg=Duel.GetMatchingGroup(cm.cfilter2,0,LOCATION_MZONE,LOCATION_MZONE,nil,eid)
......@@ -80,7 +81,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(tg) do
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,0))
end
Duel.RegisterEffect(e1,tp)
end
function cm.cfilter2(c,eid)
return c:IsFaceup() and c:GetFlagEffect(m)~=0 and c:GetFlagEffectLabel(m)==eid
......
......@@ -32,14 +32,14 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(sg,REASON_RULE)
else
local e1=Effect.CreateEffect(e:GetHandler())
local eid=e1:GetFieldID()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(function(e,re,tp) return re:GetHandler():GetFlagEffect(m)==0 or re:GetHandler():GetFlagEffectLabel(m)==eid end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local eid=e1:GetFieldID()
e1:SetValue(function(e,re,tp) return re:GetHandler():GetFlagEffect(m)==0 or re:GetHandler():GetFlagEffectLabel(m)==eid end)
for tc in aux.Next(sg) do
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,eid,aux.Stringid(m,2))
end
......
......@@ -136,12 +136,13 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if lab>0 then
--adjust
local e1=Effect.CreateEffect(e:GetHandler())
local eid=e1:GetFieldID()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetLabel(lab,eid)
e1:SetOperation(cm.adjustop)
Duel.RegisterEffect(e1,tp)
local eid=e1:GetFieldID()
--Debug.Message(eid)
e1:SetLabel(lab,eid)
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(m,lab))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,lab))
end
......@@ -151,7 +152,7 @@ function cm.nfilter(c,eid)
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local lab,eid=e:GetLabel()
if lab==100 then e:Reset() return end
if lab==100 then return end
local g=Duel.GetMatchingGroup(cm.nfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,eid)
if g and #g>0 then
for tc in aux.Next(g) do
......@@ -197,7 +198,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -209,7 +210,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
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