Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions unofficial/c511006469.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
--エクシーズ・ダブル・バック (Anime)
--Xyz Double Back (Anime)
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DESTROYED)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cfilter(c,tp)
return c:IsType(TYPE_XYZ) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetPreviousControler()==tp
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.filter1(c,e,tp,turn)
return c:IsType(TYPE_XYZ) and c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c:GetTurnID()==turn and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.filter2,tp,LOCATION_GRAVE,0,1,c,e,tp,c:GetAttack())
end
function s.filter2(c,e,tp,atk)
return c:IsAttackBelow(atk) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp,Duel.GetTurnCount()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,Duel.GetTurnCount())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_GRAVE,0,1,1,g1:GetFirst(),e,tp,g1:GetFirst():GetAttack())
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
local g=Duel.GetTargetCards(e)
if #g~=2 or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local fid=e:GetHandler():GetFieldID()
local tc=g:GetFirst()
for tc in aux.Next(g) do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid)
end
end
Duel.SpecialSummonComplete()
g:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(s.descon)
e1:SetOperation(s.desop)
e1:SetLabelObject(g)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
Duel.RegisterEffect(e1,tp)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()==tp
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Hint(HINT_CARD,0,id)
Duel.Destroy(tc,REASON_EFFECT)
end
Loading