Commit 9521c3a2 authored by wind2009's avatar wind2009

Fix Yulmina, Statue of the Sacred Dragon

parent 67fd0aca
......@@ -5,7 +5,7 @@ function s.initial_effect(c)
--place and NegateAttack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
......@@ -13,7 +13,7 @@ function s.initial_effect(c)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--pendulum
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
......@@ -23,7 +23,7 @@ function s.initial_effect(c)
e2:SetCondition(s.pencon)
e2:SetTarget(s.pentg)
e2:SetOperation(s.penop)
c:RegisterEffect(e2)
c:RegisterEffect(e2)
--special Summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
......@@ -36,7 +36,7 @@ function s.initial_effect(c)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
c:RegisterEffect(e3)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
......@@ -44,15 +44,15 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.GetAttacker()
if chk==0 then return at:IsRelateToBattle() and at:IsAbleToHand() and Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
if chk==0 then return at:IsRelateToBattle() and at:IsAbleToHand() and Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
Duel.SetTargetCard(at)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,at,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
local at=Duel.GetAttacker()
if at:IsRelateToBattle() then
if c:IsRelateToEffect(e) and Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) and c:IsLocation(LOCATION_PZONE) then
local at=Duel.GetFirstTarget()
if at:IsControler(1-tp) and at:IsType(TYPE_MONSTER) then
Duel.SendtoHand(at,nil,REASON_EFFECT)
end
end
......@@ -63,6 +63,10 @@ function s.pencon(e,tp,eg,ep,ev,re,r,rp)
end
function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
local c=e:GetHandler()
if c:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
end
function s.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -89,8 +93,9 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc and tc:IsRelateToEffect(e) then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRelateToEffect(e) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
if tc and tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_PZONE) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
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