Skip to content
Merged
Show file tree
Hide file tree
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
43 changes: 18 additions & 25 deletions official/c11637481.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--Scripted by AlphaKretin
local s,id=GetID()
function s.initial_effect(c)
--Special Summon itself from the hand
--You can Special Summon this card (from your hand) by returning 1 "U.A." monster you control to the hand, except "U.A. Libero Spiker"
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
Expand All @@ -15,39 +15,36 @@ function s.initial_effect(c)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Shuffle monster into the Deck and then Special Summon 1 "U.A." monster from deck
--During your opponent's Main Phase (Quick Effect): You can shuffle 1 Level 5 or higher "U.A." monster from your hand into the Deck, and if you do, Special Summon 1 "U.A." monster from your Deck with a different name, then return this card to the hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
e2:SetCountLimit(1,{id,1})
e2:SetCondition(s.spcon2)
e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase() end)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
s.listed_names={id}
s.listed_series={SET_UA}
function s.spfilter(c,ft)
function s.spfilter(c)
return c:IsFaceup() and c:IsSetCard(SET_UA) and not c:IsCode(id) and c:IsAbleToHandAsCost()
and (ft>0 or c:GetSequence()<5)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,ft)
return ft>-1 and #rg>0 and aux.SelectUnselectGroup(rg,e,tp,1,1,nil,0)
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil)
return #rg>0 and aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),0)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local g=nil
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,ft)
local g=aux.SelectUnselectGroup(rg,e,tp,1,1,nil,1,tp,HINTMSG_RTOHAND,nil,nil,true)
local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil)
local g=aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),1,tp,HINTMSG_RTOHAND,nil,nil,true)
if #g>0 then
g:KeepAlive()
e:SetLabelObject(g)
Expand All @@ -61,9 +58,6 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SendtoHand(g,nil,REASON_COST)
g:DeleteGroup()
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase()
end
function s.tdfilter(c,e,tp)
return c:IsSetCard(SET_UA) and c:IsLevelAbove(5) and c:IsAbleToDeck()
and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
Expand All @@ -79,18 +73,17 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,LOCATION_ONFIELD)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
if Duel.SendtoDeck(tc,tp,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
if not tc then return end
Duel.ConfirmCards(1-tp,tc)
if Duel.SendtoDeck(tc,tp,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
local c=e:GetHandler()
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
end
69 changes: 31 additions & 38 deletions official/c16259549.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,52 @@
--Number 49: Fortune Tune
local s,id=GetID()
function s.initial_effect(c)
--xyz summon
Xyz.AddProcedure(c,nil,3,2)
c:EnableReviveLimit()
--lpup
--Xyz Summon procedure: 2 Level 3 monsters
Xyz.AddProcedure(c,nil,3,2)
--Neither player can target this card on the field with card effects
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(s.reccon)
e1:SetTarget(s.rectg)
e1:SetOperation(s.recop)
e1:SetValue(1)
c:RegisterEffect(e1)
--
--If this card would be destroyed by battle or card effect, you can detach 1 material from this card instead
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
e2:SetTarget(s.reptg)
c:RegisterEffect(e2)
--destroy replace
--Once per turn, during your Standby Phase: Gain 500 LP
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetDescription(aux.Stringid(id,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_PHASE|PHASE_STANDBY)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(s.reptg)
e3:SetCountLimit(1)
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end)
e3:SetTarget(s.rectg)
e3:SetOperation(s.recop)
c:RegisterEffect(e3)
--todeck
--If this card is sent from the field to the GY: Target 2 Level 3 monsters in your GY; shuffle them both into the Deck, and if you do, return this card from your GY to the Extra Deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,id)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(s.tdcon)
e4:SetCondition(function(e,tp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end)
e4:SetTarget(s.tdtg)
e4:SetOperation(s.tdop)
c:RegisterEffect(e4)
end
s.xyz_number=49
function s.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsTurnPlayer(tp)
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Expand All @@ -69,9 +66,6 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
return true
else return false end
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.filter(c,e)
return c:GetLevel()==3 and c:IsCanBeEffectTarget(e) and c:IsAbleToDeck()
end
Expand All @@ -83,17 +77,16 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,2,2,nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,2,tp,0)
end
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=Duel.GetTargetCards(e)
if not g then return end
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if #tg~=2 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and g:FilterCount(Card.IsLocation,nil,LOCATION_DECK|LOCATION_EXTRA)==2 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
4 changes: 2 additions & 2 deletions official/c20049870.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--JP name
--GMX研究員セラン
--GMX Researcher Selande
--scripted by pyrQ
local s,id=GetID()
Expand Down Expand Up @@ -85,7 +85,7 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and c:IsLocation(LOCATION_DECK) then
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and c:IsLocation(LOCATION_DECK|LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
local sc=Duel.SelectMatchingCard(tp,Card.IsNegatable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil):GetFirst()
if sc then
Expand Down
12 changes: 6 additions & 6 deletions official/c2563463.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--Scripted by Hatter
local s,id=GetID()
function s.initial_effect(c)
--Special Summon itself from the hand
--During the Main Phase, if you control no monsters, or control an "Adventurer Token" (Quick Effect): You can Special Summon this card from your hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
Expand All @@ -16,7 +16,7 @@ function s.initial_effect(c)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Negate the activation of a card or effect
-- When a card or effect is activated while you control an "Adventurer Token" (Quick Effect): You can shuffle this card into the Deck, and if you do, negate that activation, and if you do that, destroy that card
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_NEGATE+CATEGORY_DESTROY)
Expand Down Expand Up @@ -51,15 +51,15 @@ end
function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsAbleToDeck() and Duel.IsChainNegatable(ev) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0)
end
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and c:IsLocation(LOCATION_DECK)
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and c:IsLocation(LOCATION_DECK|LOCATION_EXTRA)
and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
Expand Down
Loading