--不相通的悲欣 local m=33701422 local cm=_G["c"..m] function cm.initial_effect(c) c:SetUniqueOnField(1,0,m) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --activate limit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EFFECT_CANNOT_ACTIVATE) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0,1) e2:SetCondition(cm.actcona) e2:SetValue(cm.actlimit) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EFFECT_CANNOT_ACTIVATE) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(1,0) e3:SetCondition(cm.actconb) e3:SetValue(cm.actlimit) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_CONTROL) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetRange(LOCATION_SZONE) e4:SetCountLimit(1) e4:SetCost(cm.ctcost) e4:SetCondition(cm.ctcon) e4:SetTarget(cm.cttg) e4:SetOperation(cm.ctop) c:RegisterEffect(e4) if not cm.global_check then cm.global_check=true cm[0]=0 cm[1]=0 cm[2]=0 cm[3]=0 local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_DESTROY) ge1:SetOperation(cm.checkop) Duel.RegisterEffect(ge1,0) local ge2=ge1:Clone() ge2:SetOperation(cm.checkop1) Duel.RegisterEffect(ge2,0) local ge3=Effect.CreateEffect(c) ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW) ge3:SetOperation(cm.clear) Duel.RegisterEffect(ge3,0) end end function cm.actcona(e) return cm[tp]>0 end function cm.actconb(e) return cm[1-tp]<=0 end function cm.actlimit(e,re,tp) if re:GetHandler() then return re:GetHandler()~=e:GetHandler() else return re:GetOwner()~=e:GetHandler() end function cm.ctcon(e,tp,eg,ep,ev,re,r,rp) return cm[2]>0 and cm[3]>0 end function cm.ctcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLPCost(tp,2000) else Duel.PayLPCost(tp,2000) end end function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp,LOCATION_REASON_CONTROL) end Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0) end function cm.ctop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.GetControl(c,1-tp) end end function cm.checkop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() while tc do local p=tc:GetPreviousControler() if tc:IsPreviousLocation(LOCATION_MZONE) and rp~=p then cm[p]=cm[p]+1 end tc=eg:GetNext() end end function cm.checkop1(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() while tc do if tc:IsPreviousLocation(LOCATION_MZONE) then cm[tc:GetPreviousControler()+2]=cm[tc:GetPreviousControler()+2]+1 end tc=eg:GetNext() end end function cm.clear(e,tp,eg,ep,ev,re,r,rp) cm[0]=0 cm[1]=0 cm[2]=0 cm[3]=0 end