Commit 77a6dd0a authored by wind2009's avatar wind2009

Fix DDエクストラ・サーベイヤー

parent 8e25f825
Pipeline #32023 passed with stages
in 1 minute and 27 seconds
...@@ -11,9 +11,9 @@ function s.initial_effect(c) ...@@ -11,9 +11,9 @@ function s.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.atkcon) e1:SetCondition(s.dacon)
e1:SetTarget(s.atktg) e1:SetTarget(s.datg)
e1:SetOperation(s.atkop) e1:SetOperation(s.daop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -26,7 +26,7 @@ function s.initial_effect(c) ...@@ -26,7 +26,7 @@ function s.initial_effect(c)
e2:SetTarget(s.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(s.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tohand --remove
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE) e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
...@@ -37,48 +37,32 @@ function s.initial_effect(c) ...@@ -37,48 +37,32 @@ function s.initial_effect(c)
e3:SetOperation(s.rmop) e3:SetOperation(s.rmop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.thfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0xaf) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.sfilter(c,tp) function s.sfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(1-tp) return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(1-tp)
and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.dacon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.sfilter,1,nil,tp) and not eg:IsContains(e:GetHandler()) return eg:IsExists(s.sfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
and aux.bpcon(e,tp,eg,ep,ev,re,r,rp) and Duel.IsTurnPlayer(tp)
end end
function s.atkfilter(c) function s.dafilter(c)
return c:IsFaceup() and c:IsSetCard(0x10af) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) return c:IsFaceup() and c:IsSetCard(0x10af) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
end end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.datg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.atkfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.dafilter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_PZONE,0,2,nil) and Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_PZONE,0,2,nil)
and Duel.IsExistingTarget(s.dafilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,s.dafilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_PZONE)
end end
function s.atkop(e,tp,eg,ep,ev,re,r,rp) function s.daop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() if not Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_PZONE,0,2,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_PZONE,0,2,2,nil) local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_PZONE,0,2,2,nil)
if rg:GetCount()>0 and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)~=0 and rg:FilterCount(Card.IsLocation,nil,LOCATION_REMOVED)>0 local tc=Duel.GetFirstTarget()
if rg:GetCount()>0 and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)~=0 and rg:FilterCount(Card.IsLocation,nil,LOCATION_REMOVED)==2
and tc:IsRelateToEffect(e) then and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -88,6 +72,26 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,6 +72,26 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.thfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0xaf) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceup,Card.IsType),tp,0,LOCATION_EXTRA,nil,TYPE_PENDULUM) local ct=Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceup,Card.IsType),tp,0,LOCATION_EXTRA,nil,TYPE_PENDULUM)
local tg=Duel.GetDecktopGroup(1-tp,ct) local tg=Duel.GetDecktopGroup(1-tp,ct)
...@@ -107,12 +111,17 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -107,12 +111,17 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp)
if atk>0 and Duel.IsExistingMatchingCard(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) if atk>0 and Duel.IsExistingMatchingCard(s.atkfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) local sg=Duel.SelectMatchingCard(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
local e1=Effect.CreateEffect(e:GetHandler()) local sc=sg:GetFirst()
e1:SetType(EFFECT_TYPE_SINGLE) if sc then
e1:SetCode(EFFECT_UPDATE_ATTACK) Duel.HintSelection(tg)
e1:SetValue(atk*200) Duel.BreakEffect()
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) local e1=Effect.CreateEffect(e:GetHandler())
tc:RegisterEffect(e1) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
sc:RegisterEffect(e1)
end
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