Commit aef1f5a0 authored by DailyShana's avatar DailyShana

fix

parent 17acb1b9
...@@ -10,17 +10,19 @@ function c30426226.initial_effect(c) ...@@ -10,17 +10,19 @@ function c30426226.initial_effect(c)
e1:SetOperation(c30426226.activate) e1:SetOperation(c30426226.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c30426226.filter(c)
return not c:IsAbleToChangeControler()
end
function c30426226.target(e,tp,eg,ep,ev,re,r,rp,chk) function c30426226.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToChangeControler,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE)
local g1=g:Filter(Card.IsControler,nil,tp) local g1=g:Filter(Card.IsControler,nil,tp)
local g2=g:Filter(Card.IsControler,nil,1-tp) local g2=g:Filter(Card.IsControler,nil,1-tp)
if chk==0 then return g1:GetCount()==g2:GetCount() end if chk==0 then return g1:GetCount()==g2:GetCount()
and g:FilterCount(c30426226.filter,nil)==0 end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,g:GetCount(),0,0)
end end
function c30426226.activate(e,tp,eg,ep,ev,re,r,rp) function c30426226.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToChangeControler,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g1=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local g1=g:Filter(Card.IsControler,nil,tp) local g2=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
local g2=g:Filter(Card.IsControler,nil,1-tp)
if g1:GetCount()~=g2:GetCount() then return end
Duel.SwapControl(g1,g2) Duel.SwapControl(g1,g2)
end end
...@@ -13,7 +13,7 @@ function c48605591.initial_effect(c) ...@@ -13,7 +13,7 @@ function c48605591.initial_effect(c)
e2:SetCode(EFFECT_MAX_MZONE) e2:SetCode(EFFECT_MAX_MZONE)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetValue(3) e2:SetValue(c48605591.mvalue)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
...@@ -45,7 +45,12 @@ function c48605591.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +45,12 @@ function c48605591.condition(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)<=3 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)<=3
and Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)<=3 and Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)<=3
end end
function c48605591.mvalue(e,fp,rp,r)
if r~=LOCATION_REASON_TOFIELD then return 5 end
return 3
end
function c48605591.svalue(e,fp,rp,r) function c48605591.svalue(e,fp,rp,r)
if r~=LOCATION_REASON_TOFIELD then return 5 end
local ct=3 local ct=3
for i=5,7 do for i=5,7 do
if Duel.GetFieldCard(fp,LOCATION_SZONE,i) then ct=ct-1 end if Duel.GetFieldCard(fp,LOCATION_SZONE,i) then ct=ct-1 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