Commit 1add2a52 authored by Chen Bill's avatar Chen Bill

fix 始祖の守護者ティラス

parent 18c97d84
...@@ -9,7 +9,7 @@ function c31386180.initial_effect(c) ...@@ -9,7 +9,7 @@ function c31386180.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetCondition(c31386180.incon) e1:SetCondition(c31386180.condition)
e1:SetValue(1) e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroy --destroy
...@@ -21,7 +21,6 @@ function c31386180.initial_effect(c) ...@@ -21,7 +21,6 @@ function c31386180.initial_effect(c)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE) e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c31386180.descon)
e2:SetTarget(c31386180.destg) e2:SetTarget(c31386180.destg)
e2:SetOperation(c31386180.desop) e2:SetOperation(c31386180.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -36,21 +35,18 @@ function c31386180.initial_effect(c) ...@@ -36,21 +35,18 @@ function c31386180.initial_effect(c)
e3:SetOperation(c31386180.rmop) e3:SetOperation(c31386180.rmop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c31386180.incon(e) function c31386180.condition(e)
return e:GetHandler():GetOverlayCount()>0 return e:GetHandler():GetOverlayCount()>0
end end
function c31386180.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0
end
function c31386180.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c31386180.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c31386180.desop(e,tp,eg,ep,ev,re,r,rp) function c31386180.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetOverlayCount()==0 then return end if not c31386180.condition(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then if tc and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
...@@ -60,8 +56,7 @@ function c31386180.rmcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,8 +56,7 @@ function c31386180.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c31386180.rmop(e,tp,eg,ep,ev,re,r,rp) function c31386180.rmop(e,tp,eg,ep,ev,re,r,rp)
if not c31386180.condition(e) then return end
local c=e:GetHandler() local c=e:GetHandler()
if c:GetOverlayCount()>0 then
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
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