Commit 2fb0eec1 authored by mercury233's avatar mercury233

fix

parent f2847f53
...@@ -22,7 +22,7 @@ function c15187079.initial_effect(c) ...@@ -22,7 +22,7 @@ function c15187079.initial_effect(c)
e6:SetType(EFFECT_TYPE_SINGLE) e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_DIRECT_ATTACK) e6:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--damage --control
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(15187079,0)) e7:SetDescription(aux.Stringid(15187079,0))
e7:SetCategory(CATEGORY_CONTROL) e7:SetCategory(CATEGORY_CONTROL)
...@@ -43,16 +43,31 @@ function c15187079.sdcon(e) ...@@ -43,16 +43,31 @@ function c15187079.sdcon(e)
return ((f1==nil or not f1:IsFaceup()) and (f2==nil or not f2:IsFaceup())) return ((f1==nil or not f1:IsFaceup()) and (f2==nil or not f2:IsFaceup()))
end end
function c15187079.ctcost(e,tp,eg,ep,ev,re,r,rp,chk) function c15187079.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,e:GetHandler()) end e:SetLabel(1)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,e:GetHandler()) return true
Duel.Release(g,REASON_COST)
end end
function c15187079.filter(c) function c15187079.filter(c)
return c:IsFaceup() and c:IsAbleToChangeControler() return c:IsFaceup() and c:IsAbleToChangeControler()
end end
function c15187079.costfilter(c,tp)
return Duel.IsExistingTarget(c15187079.filter,tp,0,LOCATION_MZONE,1,c)
end
function c15187079.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c15187079.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c15187079.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c15187079.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c15187079.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c15187079.costfilter,1,c,tp)
else
return Duel.IsExistingTarget(c15187079.filter,tp,0,LOCATION_MZONE,1,nil)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroup(tp,c15187079.costfilter,1,1,c,tp)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) 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)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
...@@ -27,19 +27,34 @@ function c89538537.initial_effect(c) ...@@ -27,19 +27,34 @@ function c89538537.initial_effect(c)
e2:SetOperation(c89538537.thop) e2:SetOperation(c89538537.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c89538537.rthcfilter(c) function c89538537.rthcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c89538537.rthcfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x103) and c:IsAbleToHandAsCost() return c:IsFaceup() and c:IsSetCard(0x103) and c:IsAbleToHandAsCost()
and Duel.IsExistingTarget(c89538537.rthtgfilter,tp,0,LOCATION_ONFIELD,1,c,c)
end end
function c89538537.rthcost(e,tp,eg,ep,ev,re,r,rp,chk) function c89538537.rthtgfilter(c,tc)
local c=e:GetHandler() return c:IsAbleToHand() and c:GetEquipTarget()~=tc
if chk==0 then return Duel.IsExistingMatchingCard(c89538537.rthcfilter,tp,LOCATION_ONFIELD,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c89538537.rthcfilter,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoHand(g,nil,REASON_COST)
end end
function c89538537.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c89538537.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToHand() end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c89538537.rthcfilter,tp,LOCATION_ONFIELD,0,1,c,tp)
else
return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c89538537.rthcfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.SendtoHand(g,nil,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
......
...@@ -12,13 +12,31 @@ function c99004752.initial_effect(c) ...@@ -12,13 +12,31 @@ function c99004752.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c99004752.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c99004752.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end e:SetLabel(1)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil) return true
Duel.Release(g,REASON_COST) end
function c99004752.tgfilter(c,tc,ec)
return c:IsFaceup() and c:GetEquipTarget()~=tc and c~=ec
end
function c99004752.costfilter(c,ec,tp)
return Duel.IsExistingTarget(c99004752.tgfilter,tp,0,LOCATION_MZONE,1,c,c,ec)
end end
function c99004752.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c99004752.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c99004752.costfilter,1,c,c,tp)
else
return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroup(tp,c99004752.costfilter,1,1,c,c,tp)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end 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