Commit 8215d5e5 authored by Huangnan's avatar Huangnan

物语纪录fix.v1

parent 12ce940a
This diff is collapsed.
......@@ -51,9 +51,9 @@ function c1009029.initial_effect(c)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c1009029.effcon)
e5:SetCost(c1009029.descost)
e5:SetTarget(c1009029.destg)
e5:SetOperation(c1009029.desop)
e5:SetCost(c1009029.remcost)
e5:SetTarget(c1009029.remtg)
e5:SetOperation(c1009029.remop)
c:RegisterEffect(e5)
--pendulum
local e4=Effect.CreateEffect(c)
......@@ -115,20 +115,29 @@ end
function c1009029.effcon(e)
return e:GetHandler():GetFlagEffect(1009029)>0
end
function c1009029.descost(e,tp,eg,ep,ev,re,r,rp,chk)
function c1009029.remcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c1009029.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_SZONE+LOCATION_GRAVE)>0 end
local sg=Duel.GetFieldGroup(tp,0,LOCATION_SZONE+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
function c1009029.th1filter(c,p)
return c:GetOwner()==p and c:IsAbleToRemove()
end
function c1009029.desop(e,tp,eg,ep,ev,re,r,rp)
function c1009029.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,0,0x1c)
local dc=g:FilterCount(c1009029.th1filter,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c1009029.sgfilter(c,p)
return c:IsLocation(LOCATION_REMOVED) and c:IsControler(p)
end
function c1009029.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetFieldGroup(tp,0,LOCATION_SZONE+LOCATION_GRAVE)
local ct=Duel.SendtoDeck(sg,REASON_EFFECT)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local g=Duel.GetFieldGroup(tp,0,0x1c)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(c1009029.sgfilter,nil,1-tp)
if ct>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -56,29 +56,27 @@ end
function c1009030.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x520c) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c1009030.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_EXTRA) and chkc:IsControler(tp) and c1009030.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1009030.thfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c1009030.thfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
function c1009030.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1009030.thfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end
function c1009030.sumfilter(c)
return c:IsSetCard(0x520c) and c:IsType(TYPE_PENDULUM) and c:IsSummonable(true,nil,1)
end
function c1009030.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
local g=Duel.GetMatchingGroup(c1009030.sumfilter,tp,LOCATION_HAND,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(1009030,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sc=g:Select(tp,1,1,nil):GetFirst()
Duel.ShuffleHand(tp)
Duel.Summon(tp,sc,true,nil,1)
else
Duel.ShuffleHand(tp)
end
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c1009030.thfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local asg=Duel.SelectMatchingCard(tp,c1009030.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local astc=asg:GetFirst()
if astc and Duel.SelectYesNo(tp,aux.Stringid(1009030,0)) then
Duel.Summon(tp,astc,true,nil,1)
end
end
function c1009030.spcfilter(c,tp,rp)
......
......@@ -36,7 +36,7 @@ function c1009036.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x20c) and c:IsAbleToRemoveAsCost()
end
function c1009036.condition(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
return Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function c1009036.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1009036.cfilter,tp,LOCATION_EXTRA,0,1,nil) end
......
......@@ -87,10 +87,14 @@ function c1009037.dtop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(c1009037.dircon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ec:RegisterEffect(e1)
end
end
function c1009037.dircon(e)
return e:GetHandler():GetControler()==e:GetOwnerPlayer()
end
function c1009037.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
......
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