Commit 9af73740 authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

fix Earthbound Immortal Uru and so on (#1893)

parent be3209c1
......@@ -34,7 +34,8 @@ function c12836042.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c12836042.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 chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler(),tp,LOCATION_REASON_CONTROL)>0
and Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil,true) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
......@@ -42,11 +42,11 @@ function c15187079.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c15187079.filter(c)
return c:IsFaceup() and c:IsAbleToChangeControler()
function c15187079.filter(c,check)
return c:IsFaceup() and c:IsControlerCanBeChanged(check)
end
function c15187079.costfilter(c,tp)
return Duel.IsExistingTarget(c15187079.filter,tp,0,LOCATION_MZONE,1,c)
return Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 and Duel.IsExistingTarget(c15187079.filter,tp,0,LOCATION_MZONE,1,c,true)
end
function c15187079.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -56,7 +56,7 @@ function c15187079.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c15187079.costfilter,1,c,tp)
else
return Duel.IsExistingTarget(c15187079.filter,tp,0,LOCATION_MZONE,1,nil)
return Duel.IsExistingTarget(c15187079.filter,tp,0,LOCATION_MZONE,1,nil,false)
end
end
if e:GetLabel()==1 then
......@@ -65,7 +65,7 @@ function c15187079.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c15187079.filter,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,c15187079.filter,tp,0,LOCATION_MZONE,1,1,nil,false)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c15187079.ctop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -13,18 +13,18 @@ function c53136004.initial_effect(c)
e1:SetOperation(c53136004.operation)
c:RegisterEffect(e1)
end
function c53136004.cfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToRemoveAsCost()
function c53136004.cfilter1(c,tp)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
end
function c53136004.cfilter2(c)
return c:IsSetCard(0x106e) and c:IsAbleToRemoveAsCost()
end
function c53136004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0
and Duel.IsExistingMatchingCard(c53136004.cfilter1,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(c53136004.cfilter1,tp,LOCATION_MZONE,0,1,e:GetHandler(),tp)
and Duel.IsExistingMatchingCard(c53136004.cfilter2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c53136004.cfilter1,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
local g1=Duel.SelectMatchingCard(tp,c53136004.cfilter1,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c53136004.cfilter2,tp,LOCATION_GRAVE,0,1,1,nil)
g1:Merge(g2)
......@@ -37,7 +37,7 @@ function c53136004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RegisterEffect(e1)
end
function c53136004.filter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged()
return c:IsFaceup() and c:IsControlerCanBeChanged(true)
end
function c53136004.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 c53136004.filter(chkc) end
......
......@@ -80,13 +80,17 @@ function c59255742.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c59255742.costfilter(c,tp,g)
return c59255742.ffilter(c) and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 and g:IsExists(aux.TRUE,1,c)
end
function c59255742.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c59255742.ffilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c59255742.ffilter,1,1,nil)
local g=eg:Filter(c59255742.filter,nil,tp)
if chk==0 then return Duel.CheckReleaseGroup(tp,c59255742.costfilter,1,nil,tp,g) end
local g=Duel.SelectReleaseGroup(tp,c59255742.costfilter,1,1,nil,tp,g)
Duel.Release(g,REASON_COST)
end
function c59255742.filter(c,tp)
return c:IsSummonPlayer(1-tp) and c:IsControlerCanBeChanged()
return c:IsSummonPlayer(1-tp) and c:IsControlerCanBeChanged(true)
end
function c59255742.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c59255742.filter,nil,tp)
......
......@@ -17,13 +17,29 @@ function c72287557.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and tc:IsControler(1-tp) and tc:IsSummonType(SUMMON_TYPE_FUSION)
end
function c72287557.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
e:SetLabel(1)
return true
end
function c72287557.costfilter(c,tp)
return Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
end
function c72287557.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return eg:GetFirst():IsCanBeEffectTarget(e) and eg:GetFirst():IsControlerCanBeChanged() end
local tc=eg:GetFirst()
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c72287557.costfilter,1,tc,tp)
and tc:IsCanBeEffectTarget(e) and tc:IsControlerCanBeChanged(true)
else
return tc:IsCanBeEffectTarget(e) and tc:IsControlerCanBeChanged()
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroup(tp,c72287557.costfilter,1,1,tc,tp)
Duel.Release(sg,REASON_COST)
end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,eg,1,0,0)
end
......
......@@ -6,25 +6,45 @@ function c72621670.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c72621670.cost)
e1:SetTarget(c72621670.target)
e1:SetOperation(c72621670.activate)
c:RegisterEffect(e1)
end
function c72621670.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,2,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,2,2,nil)
Duel.Release(g,REASON_COST)
e:SetLabel(1)
return true
end
function c72621670.filter(c)
return c:IsFaceup() and c:IsAbleToChangeControler()
function c72621670.filter(c,check)
return c:IsFaceup() and c:IsAbleToChangeControler(check)
end
function c72621670.fselect(g,tp)
return Duel.GetMZoneCount(tp,g,tp,LOCATION_REASON_CONTROL)>1
and Duel.CheckReleaseGroup(tp,aux.IsInGroup,g:GetCount(),nil,g)
and Duel.IsExistingTarget(c72621670.filter,tp,0,LOCATION_MZONE,2,g,true)
end
function c72621670.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,1-tp,LOCATION_REASON_CONTROL)>=0
and Duel.IsExistingTarget(c72621670.filter,tp,0,LOCATION_MZONE,2,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c72621670.filter(chkc,false) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
local rg=Duel.GetReleaseGroup(tp)
return rg:CheckSubGroup(c72621670.fselect,2,2,tp)
else
return Duel.IsExistingTarget(c72621670.filter,tp,0,LOCATION_MZONE,2,nil,false)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local rg=Duel.GetReleaseGroup(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,c72621670.fselect,false,2,2,tp)
aux.UseExtraReleaseCount(sg,tp)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c72621670.filter,tp,0,LOCATION_MZONE,2,2,nil)
local g=Duel.SelectTarget(tp,c72621670.filter,tp,0,LOCATION_MZONE,2,2,nil,false)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,2,0,0)
end
function c72621670.tfilter(c,e)
......
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