Commit 2dabf14c authored by mercury233's avatar mercury233

fix

parent 4d60696e
...@@ -16,6 +16,7 @@ function c32036866.initial_effect(c) ...@@ -16,6 +16,7 @@ function c32036866.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c32036866.condition2) e2:SetCondition(c32036866.condition2)
e2:SetCost(aux.bfgcost) e2:SetCost(aux.bfgcost)
e2:SetTarget(c32036866.target2)
e2:SetOperation(c32036866.activate2) e2:SetOperation(c32036866.activate2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -51,17 +52,27 @@ end ...@@ -51,17 +52,27 @@ end
function c32036866.condition2(e,tp,eg,ep,ev,re,r,rp) function c32036866.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldCard(tp,LOCATION_SZONE,5)==nil return Duel.GetFieldCard(tp,LOCATION_SZONE,5)==nil
end end
function c32036866.filter2(c,e,tp) function c32036866.filter2(c,tp)
return c:IsSetCard(0x107) and c:IsType(TYPE_FIELD) return c:IsSetCard(0x107) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c32036866.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32036866.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp) end
end end
function c32036866.activate2(e,tp,eg,ep,ev,re,r,rp) function c32036866.activate2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c32036866.filter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
if g:GetCount()>0 then local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c32036866.filter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) if tc then
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c32036866.filter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst() local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if tc then if fc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.SendtoGrave(fc,REASON_RULE)
Duel.RaiseEvent(tc,4179255,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain()) Duel.BreakEffect()
end end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end 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