Commit e181a937 authored by salix5's avatar salix5

fix

parent 51442f48
--Liberating Ariadne
--解放のアリアドネ
function c98301564.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
......@@ -16,25 +16,25 @@ function c98301564.initial_effect(c)
e2:SetTargetRange(1,0)
e2:SetValue(c98301564.costchange)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISCARD_COST_CHANGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c98301564.regcon)
e3:SetTarget(c98301564.regtg)
e3:SetOperation(c98301564.regop)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISCARD_COST_CHANGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_PZONE)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c98301564.regcon)
e4:SetTarget(c98301564.regtg)
e4:SetOperation(c98301564.regop)
c:RegisterEffect(e4)
end
function c98301564.costchange(e,re,rp,val)
if re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsType(TYPE_COUNTER) then
if re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsType(TYPE_TRAP) and re:GetHandler():IsType(TYPE_COUNTER) then
return 0
else
return val
......@@ -42,16 +42,17 @@ function c98301564.costchange(e,re,rp,val)
end
function c98301564.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE)))
return bit.band(r,REASON_EFFECT+REASON_BATTLE)
end
function c98301564.cfilter(c)
return c:IsType(TYPE_TRAP) and c:IsType(TYPE_COUNTER) and c:IsAbleToHand()
end
function c98301564.regtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,3,nil,TYPE_TRAP) end
if chk==0 then return Duel.IsExistingMatchingCard(c98301564.cfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c98301564.regop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_DECK,0,nil,TYPE_TRAP)
local g=Duel.GetMatchingGroup(c98301564.cfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,3,3,nil)
......@@ -59,9 +60,7 @@ function c98301564.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tg=sg:Select(1-tp,1,1,nil)
local tc=tg:GetFirst()
if tc:IsAbleToHand() then Duel.SendtoHand(tc,nil,REASON_EFFECT)
else Duel.SendtoGrave(tc,REASON_EFFECT) end
Duel.ShuffleDeck(tp)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
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