From 559fba9082740b66095df11b461f4f2440ba7cfb Mon Sep 17 00:00:00 2001 From: Naim Date: Sun, 27 Apr 2025 07:26:19 -0300 Subject: [PATCH 01/57] initial update: The Fang of Critias --- official/c11082056.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/official/c11082056.lua b/official/c11082056.lua index d4c89b1a2b..d5df443b9f 100644 --- a/official/c11082056.lua +++ b/official/c11082056.lua @@ -4,14 +4,15 @@ local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOGRAVE|CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --add code + --This card is also always treated as "Legendary Dragon Critias" local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_CODE) @@ -23,26 +24,29 @@ function s.tgfilter(c,e,tp,rp) return c:IsTrap() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode(),rp) end function s.spfilter(c,e,tp,code,rp) - return c:IsType(TYPE_FUSION) and c.material_trap and Duel.GetLocationCountFromEx(tp,rp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and code==c.material_trap + return c:IsType(TYPE_FUSION) and c.material_trap and code==c.material_trap + and Duel.GetLocationCountFromEx(tp,rp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND|LOCATION_SZONE,0,1,nil,e,tp,rp) end + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) - local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_SZONE,0,1,1,nil,e,tp,rp) - local tc=g:GetFirst() + local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_SZONE,0,1,1,nil,e,tp,rp):GetFirst() if tc and not tc:IsImmuneToEffect(e) then - if tc:IsOnField() and tc:IsFacedown() then Duel.ConfirmCards(1-tp,tc) end + if tc:IsOnField() and tc:IsFacedown() then + Duel.ConfirmCards(1-tp,tc) + end Duel.SendtoGrave(tc,REASON_EFFECT) if not tc:IsLocation(LOCATION_GRAVE) then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetCode()) + local code=tc:GetCode() if tc:IsPreviousLocation(LOCATION_SZONE) and tc:IsPreviousPosition(POS_FACEUP) then - sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetPreviousCodeOnField()) + code=tc:GetPreviousCodeOnField() end - local sc=sg:GetFirst() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,code):GetFirst() if sc then Duel.BreakEffect() Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP) From 326369824e96e1ac78bebde11e2ccd7bff607904 Mon Sep 17 00:00:00 2001 From: Naim Date: Sun, 27 Apr 2025 07:52:56 -0300 Subject: [PATCH 02/57] batch 1 + fix for "Sprind the Irondash Dragon" It was making the player select the zones during the activation, not during the resolution --- official/c11082056.lua | 2 +- official/c12292422.lua | 4 +++- official/c18478530.lua | 12 ++++++------ official/c1906812.lua | 41 ++++++++++++++++------------------------- 4 files changed, 26 insertions(+), 33 deletions(-) diff --git a/official/c11082056.lua b/official/c11082056.lua index d5df443b9f..763bfe9862 100644 --- a/official/c11082056.lua +++ b/official/c11082056.lua @@ -5,7 +5,7 @@ function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOGRAVE|CATEGORY_SPECIAL_SUMMON) + e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) diff --git a/official/c12292422.lua b/official/c12292422.lua index da102ebba9..cecb943104 100644 --- a/official/c12292422.lua +++ b/official/c12292422.lua @@ -5,6 +5,7 @@ local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) @@ -38,6 +39,7 @@ function s.filter(c,typ,lv) return c:IsRace(typ) and c:IsLevel(lv) and c:IsAbleToGrave() end function s.activate(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local tc=Duel.SelectMatchingCard(tp,s.tgyfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst() if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE) @@ -46,7 +48,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) local lv=Duel.AnnounceLevel(tp,1,12) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(1-tp,s.filter,1-tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,typ,lv) - if #g>0 then + if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end diff --git a/official/c18478530.lua b/official/c18478530.lua index 122f0d6b62..a075efb66f 100644 --- a/official/c18478530.lua +++ b/official/c18478530.lua @@ -8,7 +8,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) - --Cannot attack + --Monsters your opponent controls with 2000 or less ATK cannot attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_ATTACK) @@ -17,7 +17,7 @@ function s.initial_effect(c) e2:SetCondition(s.atkcon) e2:SetTarget(aux.TargetBoolFunction(Card.IsAttackBelow,2000)) c:RegisterEffect(e2) - --Special Summon 1 "Valkyrie" monster from Deck or hand + --Special Summon 1 Level 5 or higher "Valkyrie" monster from your hand or Deck local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) @@ -33,7 +33,7 @@ function s.atkcon(e,c) local tp=e:GetHandlerPlayer() return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_VALKYRIE),tp,LOCATION_MZONE,0,1,nil) end -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsLevelAbove(5) and c:IsSetCard(SET_VALKYRIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) @@ -42,13 +42,13 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK|LOCATION_HAND,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,e,tp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end diff --git a/official/c1906812.lua b/official/c1906812.lua index 4b37815dcc..3bf234c41b 100644 --- a/official/c1906812.lua +++ b/official/c1906812.lua @@ -1,16 +1,16 @@ --灰燼竜バスタード --Sprind the Irondash Dragon ---Logical Nonsense ---Substitute ID +--scripted by Logical Nonsense local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() - --Fusion summon procedure + --Fusion Materials: "Fallen of Albaz" + 1 Effect Monster Special Summoned this turn Fusion.AddProcMix(c,true,true,CARD_ALBAZ,aux.FilterBoolFunctionEx(s.filter)) - --Move itself to 1 of your unused MMZ + --Move this card you control to another of your Main Monster Zones, then you can destroy all other face-up cards in this card's column local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) @@ -25,38 +25,32 @@ function s.initial_effect(c) e2:SetOperation(s.regop) c:RegisterEffect(e2) end - --Lists "Sprigguns" archetype s.listed_series={SET_SPRINGANS} - --Specifically lists "Fallen of Albaz" s.listed_names={CARD_ALBAZ} - --Check for an effect that was special summoned this turn function s.filter(c) return c:IsLocation(LOCATION_MZONE) and c:IsType(TYPE_EFFECT) and c:IsStatus(STATUS_SPSUMMON_TURN) end - --Activation legality function s.seqtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) - local seq=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0) - Duel.Hint(HINT_ZONE,tp,seq) - e:SetLabel(math.log(seq,2)) + Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD) end - --Move itself to 1 of your unused MMZ, then destroy all face-up cards in its new column function s.seqop(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - local seq=e:GetLabel() - if not c:IsRelateToEffect(e) or c:IsControler(1-tp) or not Duel.CheckLocation(tp,LOCATION_MZONE,seq) then return end + if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) - Duel.MoveSequence(c,seq) - local dg=c:GetColumnGroup():Filter(Card.IsFaceup,c,nil) --Check for face-up cards in its current column, except itself - if #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then - Duel.BreakEffect() - Duel.Destroy(dg,REASON_EFFECT) + local seq=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0) + if seq then + Duel.MoveSequence(c,math.log(seq,2)) + local dg=c:GetColumnGroup():Filter(Card.IsFaceup,c,nil) + if #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + Duel.BreakEffect() + Duel.Destroy(dg,REASON_EFFECT) + end end end - --Add or special summon 1 "Sprigguns" monster or "Fallen of Albaz" from deck function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() + --Add to your hand, or Special Summon, 1 "Springans" monster or 1 "Fallen of Albaz" from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) @@ -69,22 +63,19 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end - --Check for a "Sprigguns" monster or "Fallen of Albaz" function s.thfilter(c,e,tp,ft) return c:IsMonster() and (c:IsSetCard(SET_SPRINGANS) or c:IsCode(CARD_ALBAZ)) and (c:IsAbleToHand() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0)) end - --Activation legality function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ft) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end - --Add or special summon 1 "Sprigguns" monster or "Fallen of Albaz" from deck function s.thop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft):GetFirst() if tc then aux.ToHandOrElse(tc,tp,function(c) From 1229e6820ade2c223b2e3be0259bf562b6df1478 Mon Sep 17 00:00:00 2001 From: Naim Date: Sun, 27 Apr 2025 13:19:33 -0300 Subject: [PATCH 03/57] batch 2 --- official/c19307353.lua | 4 +- official/c21147203.lua | 2 +- official/c23020408.lua | 6 +-- official/c23912837.lua | 87 ++++++++++++++++++++---------------------- official/c26495087.lua | 18 +++------ 5 files changed, 53 insertions(+), 64 deletions(-) diff --git a/official/c19307353.lua b/official/c19307353.lua index d782b3bd91..a7ea01d61f 100644 --- a/official/c19307353.lua +++ b/official/c19307353.lua @@ -3,7 +3,7 @@ --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) - --Search + --Add 1 monster from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) @@ -42,8 +42,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local total=e:GetLabel() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,total) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) diff --git a/official/c21147203.lua b/official/c21147203.lua index fc1e0ebf8c..9d81cb7646 100644 --- a/official/c21147203.lua +++ b/official/c21147203.lua @@ -66,8 +66,8 @@ function s.decksptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.deckspop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local rac,att,lvl=e:GetLabel() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.deckspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,rac,att,lvl) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) diff --git a/official/c23020408.lua b/official/c23020408.lua index 9e082dc7c4..c0766a867a 100644 --- a/official/c23020408.lua +++ b/official/c23020408.lua @@ -3,7 +3,7 @@ --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) - --Activate + --Place 1 card on top of the Deck from your hand, Deck, or GY, that is "Dark Magician" or mentions "Dark Magician" or "Dark Magician Girl" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TODECK) @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --Draw + --Draw cards equal to the number of "Palladium" monsters, "Dark Magician", and/or "Dark Magician Girl" with different names local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW) @@ -36,8 +36,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,ct):GetFirst() if tc then if tc:IsLocation(LOCATION_DECK) then diff --git a/official/c23912837.lua b/official/c23912837.lua index 5aeee31e15..a0804d11f2 100644 --- a/official/c23912837.lua +++ b/official/c23912837.lua @@ -3,91 +3,86 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Activate + --Special Summon 1 "Shaddoll" monster from your GY local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.activate) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) c:RegisterEffect(e1) - --change position + --Activate one of these effects local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) - e2:SetCost(s.poscost) - e2:SetTarget(s.postg) + e2:SetCost(s.effcost) + e2:SetTarget(s.efftg) + e2:SetOperation(s.effop) c:RegisterEffect(e2) end s.listed_series={SET_SHADDOLL} -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(SET_SHADDOLL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_DEFENSE) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) + local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end -function s.activate(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_DEFENSE)~=0 then - if tc:IsFacedown() then - Duel.ConfirmCards(1-tp,tc) - end + if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_DEFENSE)>0 then + if tc:IsFacedown() then + Duel.ConfirmCards(1-tp,tc) end end end function s.cfilter(c) return c:IsSetCard(SET_SHADDOLL) and c:IsAbleToRemoveAsCost() end -function s.poscost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) + if chk==0 then return Cost.SelfBanish(e,tp,eg,ep,ev,re,r,rp,0) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,c) g:AddCard(c) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.postg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) local b2=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCanTurnSet),tp,LOCATION_MZONE,0,1,nil) if chk==0 then return b1 or b2 end - local op=0 - if b1 and b2 then - op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) - elseif b1 then - op=Duel.SelectOption(tp,aux.Stringid(id,0)) - else - op=Duel.SelectOption(tp,aux.Stringid(id,1))+1 - end - if op==0 then - e:SetOperation(s.posop1) - else - e:SetOperation(s.posop2) - end + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,2)}, + {b2,aux.Stringid(id,3)}) + e:SetLabel(op) Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0) end -function s.posop1(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil) - if #g>0 then - Duel.HintSelection(g) - Duel.ChangePosition(g,POS_FACEUP_DEFENSE) - end -end -function s.posop2(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsCanTurnSet),tp,LOCATION_MZONE,0,1,1,nil) - if #g>0 then - Duel.HintSelection(g) - Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) +function s.effop(e,tp,eg,ep,ev,re,r,rp) + if op==1 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.ChangePosition(g,POS_FACEUP_DEFENSE) + end + elseif op==2 + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsCanTurnSet),tp,LOCATION_MZONE,0,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) + end end end \ No newline at end of file diff --git a/official/c26495087.lua b/official/c26495087.lua index 0fac4b84e3..6f1489a375 100644 --- a/official/c26495087.lua +++ b/official/c26495087.lua @@ -2,37 +2,31 @@ --Vampire Lady local s,id=GetID() function s.initial_effect(c) - --to grave + --Your opponent sends 1 card of the declared type from their Deck to the GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLE_DAMAGE) - e1:SetCondition(s.tgcon) + e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp end) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) c:RegisterEffect(e1) end -function s.tgcon(e,tp,eg,ep,ev,re,r,rp) - return ep~=tp -end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPTION) - local op=Duel.SelectOption(tp,70,71,72) - e:SetLabel(op) + local op=Duel.SelectOption(tp,DECLTYPE_MONSTER,DECLTYPE_SPELL,DECLTYPE_TRAP) + e:SetLabel(1<0 then Duel.SendtoGrave(g,REASON_EFFECT) end end \ No newline at end of file From d83d9bc497603019bce9f88bfad67fa0c72f3b79 Mon Sep 17 00:00:00 2001 From: Naim Date: Sun, 27 Apr 2025 13:27:10 -0300 Subject: [PATCH 04/57] batch 3 --- official/c23912837.lua | 2 +- official/c28126717.lua | 9 +++++---- official/c28534130.lua | 15 +++++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/official/c23912837.lua b/official/c23912837.lua index a0804d11f2..98e62e4593 100644 --- a/official/c23912837.lua +++ b/official/c23912837.lua @@ -77,7 +77,7 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) Duel.HintSelection(g) Duel.ChangePosition(g,POS_FACEUP_DEFENSE) end - elseif op==2 + elseif op==2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsCanTurnSet),tp,LOCATION_MZONE,0,1,1,nil) if #g>0 then diff --git a/official/c28126717.lua b/official/c28126717.lua index 74b3452338..60dec4d130 100644 --- a/official/c28126717.lua +++ b/official/c28126717.lua @@ -8,8 +8,9 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) - --Reveal + --Reveal 1 Level 1 "Floowandereeze" monster in your hand and banish 1 "Floowandereeze" card with a different name from your Deck then immediately after this effect resolves, Normal Summon the revealed monster local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SUMMON+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_FZONE) @@ -17,8 +18,9 @@ function s.initial_effect(c) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) - --Normal on normal + --Immediately after this effect resolves, Normal Summon 1 "Floowandereeze" monster local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) @@ -43,7 +45,6 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_REMOVE,POS_FACEUP,1,tp,LOCATION_DECK) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g1=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,tp) if #g1>0 then @@ -68,7 +69,7 @@ function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) end function s.nsop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local g=Duel.SelectMatchingCard(tp,s.nsfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil) if #g>0 then local sg=g:GetFirst(tp,1,1,nil) diff --git a/official/c28534130.lua b/official/c28534130.lua index 3c12c07c29..4225bd5d27 100644 --- a/official/c28534130.lua +++ b/official/c28534130.lua @@ -3,8 +3,9 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Special summon 1 "Salamangreat" monster from hand, then link summon 1 "Salamangreat" monster + --Special Summon 1 "Salamangreat" monster from hand, then Link Summon 1 "Salamangreat" Link Monster using materials you control, including the Summoned monster local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) @@ -12,8 +13,9 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --Return 1 "Salamangreat" link monster to extra deck + --Return 1 "Salamangreat" Link Monster from your GY to the Extra Deck local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) @@ -28,7 +30,8 @@ function s.spfilter2(c,mc,fg) return c:IsSetCard(SET_SALAMANGREAT) and c:IsLinkSummonable(mc,fg+mc) end function s.spfilter(c,e,tp,fg) - return c:IsSetCard(SET_SALAMANGREAT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_EXTRA,0,1,nil,c,fg) + return c:IsSetCard(SET_SALAMANGREAT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_EXTRA,0,1,nil,c,fg) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local fg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsCanBeLinkMaterial),tp,LOCATION_MZONE,0,nil) @@ -39,8 +42,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local fg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsCanBeLinkMaterial),tp,LOCATION_MZONE,0,nil) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,fg) local tc=g:GetFirst() if not tc or not Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then @@ -96,11 +99,11 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) + Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end \ No newline at end of file From 3f73124ac759039b7dbcab292aea00755d786792 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:24:15 +0300 Subject: [PATCH 05/57] Ruddy Rose Witch - Added missing hint messages. - Shouldn't be able to use its effect if you don't have a Plant to place on top of the Deck. - Added missing summon category and opinfo. - Shouldn't be able to Normal Summon if you don't successfully add a card to the hand and place a Plant on top of the Deck. --- official/c29107423.lua | 91 +++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/official/c29107423.lua b/official/c29107423.lua index fe04c0d37b..035140267b 100644 --- a/official/c29107423.lua +++ b/official/c29107423.lua @@ -3,10 +3,10 @@ --scripted by Rundas local s,id=GetID() function s.initial_effect(c) - --Tribute + search + deck stack + potentially Normal Summon + --Add 1 "Witch of the Black Rose" from your Deck to your hand, and if you do, take 1 Level 3 or lower Plant monster from your Deck and place it on top of your Deck, then immediately after this effect resolves, you can Normal Summon 1 "Witch of the Black Rose" from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) @@ -14,69 +14,68 @@ function s.initial_effect(c) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) - --To Extra Deck + --Return 1 of your "Black Rose Dragon" or "Ruddy Rose Dragon" that is banished or in your GY to the Extra Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_TODECK) + e2:SetCategory(CATEGORY_TOEXTRA) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) - e2:SetTarget(s.tedtg) - e2:SetOperation(s.tedop) + e2:SetTarget(s.textg) + e2:SetOperation(s.texop) c:RegisterEffect(e2) end -s.listed_names={id,17720747,CARD_BLACK_ROSE_DRAGON,40139997} ---Tribute + search + deck stack + potentially Normal Summon -function s.thfilter(c) - return c:IsAbleToHand() and c:IsCode(17720747) +s.listed_names={17720747,CARD_BLACK_ROSE_DRAGON,40139997} --"Witch of the Black Rose", "Ruddy Rose Dragon" +function s.thfilter(c,tp) + return c:IsCode(17720747) and c:IsAbleToHand() and Duel.IsExistingMatchingCard(s.topdeckfilter,tp,LOCATION_DECK,0,1,c) end -function s.filter(c) - return c:IsRace(RACE_PLANT) and c:IsLevelBelow(3) -end -function s.sfilter(c) - return c:IsCode(17720747) and c:IsSummonable(true,nil) +function s.topdeckfilter(c) + return c:IsLevelBelow(3) and c:IsRace(RACE_PLANT) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end + if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_SUMMON,nil,1,tp,LOCATION_HAND) +end +function s.sumfilter(c) + return c:IsCode(17720747) and c:IsSummonable(true,nil) 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_DECK,0,1,1,nil) - if #g>0 then - if Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) then - Duel.ConfirmCards(1-tp,g) - local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() - if tc then - Duel.ShuffleDeck(tp) - Duel.MoveSequence(tc,0) - Duel.ConfirmDecktop(tp,1) + local sc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() + if sc and Duel.SendtoHand(sc,nil,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_HAND) then + Duel.ConfirmCards(1-tp,sc) + Duel.ShuffleHand(tp) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) + local topc=Duel.SelectMatchingCard(tp,s.topdeckfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() + if topc then + Duel.ShuffleDeck(tp) + Duel.MoveSequence(topc,0) + Duel.ConfirmDecktop(tp,1) + if Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) + local sumc=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst() + if sumc then + Duel.Summon(tp,sumc,true,nil) + end end - else Duel.ConfirmCards(1-tp,g) - end - end - local g2=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_HAND,0,nil) - if #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) - local tc=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst() - if tc then - Duel.Summon(tp,tc,true,nil) end end end ---To Extra Deck -function s.tedfilter(c,tp) - return (c:IsCode(CARD_BLACK_ROSE_DRAGON) or c:IsCode(40139997)) and c:IsAbleToExtra() - and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) +function s.texfilter(c) + return c:IsCode(CARD_BLACK_ROSE_DRAGON,40139997) and c:IsFaceup() and c:IsAbleToExtra() end -function s.tedtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.tedfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,tp) end - Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED) +function s.textg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.texfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,e:GetHandler()) end + Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED) end -function s.tedop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tedfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,tp):GetFirst() - if tc then - Duel.SendtoDeck(tc,tp,SEQ_DECKSHUFFLE,REASON_EFFECT) +function s.texop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.texfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end From c5b7e5c04aa922b83abae81bad09eb58127f14b9 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:59:19 +0300 Subject: [PATCH 06/57] Update c11082056.lua --- official/c11082056.lua | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/official/c11082056.lua b/official/c11082056.lua index 763bfe9862..6bb0b8e789 100644 --- a/official/c11082056.lua +++ b/official/c11082056.lua @@ -2,7 +2,14 @@ --The Fang of Critias local s,id=GetID() function s.initial_effect(c) - --Activate + --This card is also always treated as "Legendary Dragon Critias" + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_SINGLE) + e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) + e0:SetCode(EFFECT_ADD_CODE) + e0:SetValue(10000060) + c:RegisterEffect(e0) + --Send 1 Trap from your hand or field to the GY, that is listed on a Fusion Monster that can only be Special Summoned with "The Fang of Critias" (if that card is Set, reveal it), then Special Summon that Fusion Monster from your Extra Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) @@ -12,45 +19,38 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --This card is also always treated as "Legendary Dragon Critias" - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_ADD_CODE) - e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e2:SetValue(10000060) - c:RegisterEffect(e2) end -function s.tgfilter(c,e,tp,rp) - return c:IsTrap() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode(),rp) +s.listed_names={10000060,id} --"Legendary Dragon Critias" +function s.tgfilter(c,e,tp) + return c:IsTrap() and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode()) end -function s.spfilter(c,e,tp,code,rp) - return c:IsType(TYPE_FUSION) and c.material_trap and code==c.material_trap - and Duel.GetLocationCountFromEx(tp,rp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) +function s.spfilter(c,e,tp,code) + return c:IsType(TYPE_FUSION) and c.material_trap and code==c.material_trap and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND|LOCATION_SZONE,0,1,nil,e,tp,rp) end + if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) - local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_SZONE,0,1,1,nil,e,tp,rp):GetFirst() - if tc and not tc:IsImmuneToEffect(e) then - if tc:IsOnField() and tc:IsFacedown() then - Duel.ConfirmCards(1-tp,tc) + local mc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,nil,e,tp):GetFirst() + if mc and not mc:IsImmuneToEffect(e) then + if mc:IsOnField() and mc:IsFacedown() then + Duel.ConfirmCards(1-tp,mc) end - Duel.SendtoGrave(tc,REASON_EFFECT) - if not tc:IsLocation(LOCATION_GRAVE) then return end - local code=tc:GetCode() - if tc:IsPreviousLocation(LOCATION_SZONE) and tc:IsPreviousPosition(POS_FACEUP) then - code=tc:GetPreviousCodeOnField() + if Duel.SendtoGrave(mc,REASON_EFFECT)==0 or not mc:IsLocation(LOCATION_GRAVE) then return end + local code=mc:GetCode() + if mc:IsPreviousLocation(LOCATION_ONFIELD) and mc:IsPreviousPosition(POS_FACEUP) then + code=mc:GetPreviousCodeOnField() end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,code):GetFirst() if sc then Duel.BreakEffect() - Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP) + if Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP)==0 then return end sc:CompleteProcedure() end end -end \ No newline at end of file +end From ce731f4ab56b50c7dab1af7c67dbfda5f0d12c4c Mon Sep 17 00:00:00 2001 From: Naim Date: Mon, 28 Apr 2025 11:07:12 -0300 Subject: [PATCH 07/57] batch4 --- official/c29354228.lua | 97 +++++++++++++++++++++--------------------- official/c30114823.lua | 19 +++++---- official/c33760966.lua | 2 +- official/c33981008.lua | 11 ++--- official/c34460239.lua | 27 ++++++------ 5 files changed, 79 insertions(+), 77 deletions(-) diff --git a/official/c29354228.lua b/official/c29354228.lua index 53e4c70807..cc48e35f72 100644 --- a/official/c29354228.lua +++ b/official/c29354228.lua @@ -3,69 +3,70 @@ --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) - --Activate (special summon from hand) + --Activate 1 of these effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) - e1:SetTarget(s.sptg) - e1:SetOperation(s.spop) + e1:SetTarget(s.efftg) + e1:SetOperation(s.effop) c:RegisterEffect(e1) - --Activate (recycle) - local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) - e2:SetType(EFFECT_TYPE_ACTIVATE) - e2:SetCode(EVENT_FREE_CHAIN) - e2:SetHintTiming(0,TIMING_END_PHASE) - e2:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) - e2:SetTarget(s.thtg) - e2:SetOperation(s.thop) - c:RegisterEffect(e2) end s.listed_series={SET_DOGMATIKA} s.listed_names={CARD_ALBAZ} -function s.filter(c,e,tp) - return (c:IsCode(CARD_ALBAZ) or (c:IsMonster() and c:IsSetCard(SET_DOGMATIKA))) +function s.albazdogmatikafilter(c) + return (c:IsCode(CARD_ALBAZ) or (c:IsSetCard(SET_DOGMATIKA) and c:IsMonster())) end -function s.spfilter(c,e,tp) - return s.filter(c,e,tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) +function s.thfilter(c) + return s.albazdogmatikafilter(c) and c:IsAbleToHand() end -function s.thfilter(c,ft,e,tp) - return s.filter(c,e,tp) and ((ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)) or c:IsAbleToHand()) +function s.spfilter(c,e,tp) + return s.albazdogmatikafilter(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end -function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) +function s.thspfilter(c,ft,e,tp) + return s.thfilter(c) or (ft>0 and s.spfilter(c,e,tp)) end -function s.spop(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) - if #g>0 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + local b1=ft>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) + local b2=Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_GRAVE,0,1,nil,ft,e,tp) + if chk==0 then return b1 or b2 end + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,1)}, + {b2,aux.Stringid(id,2)}) + e:SetLabel(op) + if op==1 then + e:SetCategory(CATEGORY_SPECIAL_SUMMON) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) + elseif op==2 then + e:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) end end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil,ft,e,tp) end - Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) -end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,0) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,ft,e,tp) - local sc=sg:GetFirst() - if sc then - aux.ToHandOrElse(sc,tp,function(c) - return sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and ft>0 end, - function(c) - Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, - aux.Stringid(id,2)) +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local op=e:GetLabel() + if op==1 then + --Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your hand. + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) + end + elseif op==2 then + --Add to your hand or Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your GY + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3)) + local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thspfilter),tp,LOCATION_GRAVE,0,1,1,nil,ft,e,tp):GetFirst() + if sc then + aux.ToHandOrElse(sc,tp,function(c) + return sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and ft>0 end, + function(c) + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, + aux.Stringid(id,4)) + end end end \ No newline at end of file diff --git a/official/c30114823.lua b/official/c30114823.lua index ba9116e739..739c294ca7 100644 --- a/official/c30114823.lua +++ b/official/c30114823.lua @@ -3,8 +3,9 @@ --Scripted by AlphaKretin, extra material by edo9300 local s,id=GetID() function s.initial_effect(c) - --Extra Material + --If a Cyberse monster you control would be used as Link Material for a "Code Talker" monster, this card in your hand can also be used as material local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_HAND) e1:SetCode(EFFECT_EXTRA_MATERIAL) @@ -19,9 +20,9 @@ function s.initial_effect(c) if s.flagmap[c]==nil then s.flagmap[c] = {} end - --Send to grave + --Send OR Add to your hand 1 Cyberse monster with 1200 or less ATK from your Deck to the GY local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) @@ -70,7 +71,8 @@ function s.tgcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() e:SetLabel(0) if c:IsPreviousLocation(LOCATION_ONFIELD) then e:SetLabel(1) end - return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD|LOCATION_HAND) and r==REASON_LINK and c:GetReasonCard():IsSetCard(SET_CODE_TALKER) + return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD|LOCATION_HAND) + and r==REASON_LINK and c:GetReasonCard():IsSetCard(SET_CODE_TALKER) end function s.tgfilter(c,chk) return c:IsRace(RACE_CYBERSE) and c:IsAttackBelow(1200) and (c:IsAbleToGrave() or (chk==1 and c:IsAbleToHand())) @@ -81,10 +83,11 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel()) - if #g>0 then - local tc=g:GetFirst() - if e:GetLabel()==1 and tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectYesNo(tp,aux.Stringid(id,1))) then + local hint_msg=(e:GetLabel()==1 and aux.Stringid(id,2) or HINTMSG_SPSUMMON) + Duel.Hint(HINT_SELECTMSG,tp,hint_msg) + local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel()):GetFirst() + if tc then + if e:GetLabel()==1 and tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectYesNo(tp,aux.Stringid(id,3))) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) else diff --git a/official/c33760966.lua b/official/c33760966.lua index c93e7545a9..b9dd8e7464 100644 --- a/official/c33760966.lua +++ b/official/c33760966.lua @@ -61,8 +61,8 @@ s.listed_series={SET_DRAGONTAIL} function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and chkc:IsMonster() and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsMonster,Card.IsAbleToHand),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local ct=e:GetLabelObject():GetLabel() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,aux.AND(Card.IsMonster,Card.IsAbleToHand),tp,LOCATION_MZONE|LOCATION_GRAVE,LOCATION_MZONE|LOCATION_GRAVE,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,tp,0) end diff --git a/official/c33981008.lua b/official/c33981008.lua index 026d41ceb3..cf640d058a 100644 --- a/official/c33981008.lua +++ b/official/c33981008.lua @@ -7,7 +7,7 @@ function s.initial_effect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) - --draw + --Place 1 "Spellbook" Spell Card from your GY on the bottom of your Deck then draw 1 card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) @@ -19,7 +19,7 @@ function s.initial_effect(c) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) - --spsummon + --Special Summon 1 Spellcaster monster from your hand or Deck whose Level is less than or equal to the number of "Spellbook" Spell Cards in your GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -32,6 +32,7 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_SPELLBOOK} +s.listed_names={id} function s.cfilter(c) return c:IsRace(RACE_SPELLCASTER) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) end @@ -39,7 +40,7 @@ function s.drcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end function s.filter(c) - return c:IsSetCard(SET_SPELLBOOK) and c:GetCode()~=id and c:IsSpell() and c:IsAbleToDeck() + return c:IsSetCard(SET_SPELLBOOK) and c:IsSpell() and c:IsAbleToDeck() and not c:IsCode(id) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil) end @@ -47,11 +48,11 @@ function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.HintSelection(g) if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 then + Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end @@ -74,8 +75,8 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local ct=Duel.GetMatchingGroupCount(s.ctfilter,tp,LOCATION_GRAVE,0,nil) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,e,tp,ct) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) diff --git a/official/c34460239.lua b/official/c34460239.lua index f46f47703a..7f2d58aa4f 100644 --- a/official/c34460239.lua +++ b/official/c34460239.lua @@ -2,8 +2,9 @@ --Generation Shift local s,id=GetID() function s.initial_effect(c) - --Activate + --Destroy a card and add 1 card with the same name as the destroyed card from your Deck to your hand local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) @@ -12,30 +13,26 @@ function s.initial_effect(c) e1:SetOperation(s.activate) c:RegisterEffect(e1) end -function s.filter(c,tp) - return c:IsFaceup() - and Duel.IsExistingMatchingCard(s.nfilter1,tp,LOCATION_DECK,0,1,nil,c) +function s.desfilter(c,tp) + return c:IsFaceup() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode()) end -function s.nfilter1(c,tc) - return c:IsCode(tc:GetCode()) and c:IsAbleToHand() -end -function s.nfilter2(c,tc) - return c:IsCode(tc:GetPreviousCodeOnField()) and c:IsAbleToHand() +function s.thfilter(c,code) + return c:IsCode(code) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,tp) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,tp) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.desfilter(chkc,tp) end + if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_MZONE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,tp) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.BreakEffect() - local g=Duel.SelectMatchingCard(tp,s.nfilter2,tp,LOCATION_DECK,0,1,1,nil,tc) - local hc=g:GetFirst() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local hc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetPreviousCodeOnField()):GetFirst() if hc then Duel.SendtoHand(hc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,hc) From 95080b831e470e6932af0765a2f1036017a9c398 Mon Sep 17 00:00:00 2001 From: Naim Date: Mon, 28 Apr 2025 13:14:24 -0300 Subject: [PATCH 08/57] batch5 --- official/c36099130.lua | 5 +++-- official/c36224040.lua | 25 +++++++------------------ official/c3715284.lua | 41 +++++++++++++++++++++-------------------- official/c37491810.lua | 24 +++++++++++------------- 4 files changed, 42 insertions(+), 53 deletions(-) diff --git a/official/c36099130.lua b/official/c36099130.lua index 3ebc7a132c..9004ea4ed4 100644 --- a/official/c36099130.lua +++ b/official/c36099130.lua @@ -3,7 +3,7 @@ --Scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Equip from Extra Deck + --Equip 1 "Magistus" monster from your Extra Deck to 1 "Magistus" monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_EQUIP) @@ -14,7 +14,7 @@ function s.initial_effect(c) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) - --Special Summon when becomes equipped + --Special Summon 1 Level 4 Spellcaster monster from your hand or GY in Defense Position local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -44,6 +44,7 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local ec=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_EXTRA,0,1,1,nil,SET_MAGISTUS):GetFirst() if ec then Duel.Equip(tp,ec,tc,true) diff --git a/official/c36224040.lua b/official/c36224040.lua index 9a53447c0a..b49bbf5815 100644 --- a/official/c36224040.lua +++ b/official/c36224040.lua @@ -1,10 +1,9 @@ --RUM-ゼアル・フォース --Rank-Up-Magic Zexal Force ---Logical Nonsense ---Substitute ID +--scripted by Logical Nonsense local s,id=GetID() function s.initial_effect(c) - --Xyz summon 1 "Utopia" or "ZW -" monster, that is 1 rank higher than targeted Xyz + --Xyz Summon 1 "Utopia" or "ZW -" monster using 1 Xyz monster you control then take 1 "ZW -" or "ZS -" monster from your Deck and place it on top of your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -28,22 +27,18 @@ function s.initial_effect(c) e2:SetOperation(s.drop) c:RegisterEffect(e2) end - --Lists "Utopia", "ZW -", and "ZS -" archetypes s.listed_series={SET_UTOPIA,SET_ZW,SET_ZS} - --Check for an Xyz monster to use as material function s.filter1(c,e,tp) local rk=c:GetRank() local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and c:IsFaceup() and (rk>0 or c:IsStatus(STATUS_NO_LEVEL)) - and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1) + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+1) end - --Check for "Utopia" or "ZW -" Xyz monster -function s.filter2(c,e,tp,mc,rk) +function s.spfilter(c,e,tp,mc,rk) if c.rum_limit and not c.rum_limit(mc,e) then return false end return mc:IsType(TYPE_XYZ,c,SUMMON_TYPE_XYZ,tp) and c:IsRank(rk) and (c:IsSetCard(SET_UTOPIA) or c:IsSetCard(SET_ZW)) and mc:IsCanBeXyzMaterial(c,tp) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end - --Activation legality function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter1(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) @@ -53,25 +48,22 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end - --Check for "ZW -" or "ZS -" monster function s.topfilter(c) - return (c:IsSetCard(SET_ZW) or c:IsSetCard(SET_ZS)) and c:IsMonster() + return c:IsSetCard({SET_ZW,SET_ZS}) and c:IsMonster() end - --Xyz summon 1 "Utopia" or "ZW -" monster, that is 1 rank higher than targeted Xyz function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(tc),tp,nil,nil,REASON_XYZ) if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) or #pg>1 or (#pg==1 and not pg:IsContains(tc)) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1) - local sc=g:GetFirst() + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1):GetFirst() if sc then sc:SetMaterial(tc) Duel.Overlay(sc,tc) Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) sc:CompleteProcedure() + --Take 1 "ZW -" or "ZS -" monster from your Deck and place it on top of your Deck Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) - --Place 1 "ZW -" or "ZS -" monster to place on top of deck local tc=Duel.SelectMatchingCard(tp,s.topfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if tc then Duel.ShuffleDeck(tp) @@ -80,18 +72,15 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) end end end - --If opponent's LP is 2000 higher than yours function s.drcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetLP(tp)<=Duel.GetLP(1-tp)-2000 end - --Activation legality function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end - --Draw 1 function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) diff --git a/official/c3715284.lua b/official/c3715284.lua index 0773914355..b7e6864d52 100644 --- a/official/c3715284.lua +++ b/official/c3715284.lua @@ -3,7 +3,7 @@ --scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Destroy itself and special Summon from Deck + --Destroy this card, and if you do, Special Summon 2 "Meklord Army" monsters from your Deck in Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) @@ -13,7 +13,7 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Inflict damage in the End Phase + --During the End Phase of this turn, inflict 100 damage to your opponent for each "Meklord" monster you control local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DAMAGE) @@ -31,35 +31,35 @@ function s.spfilter(c,e,tp) return c:IsSetCard(SET_MEKLORD_ARMY) and c:IsMonster() and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if e:GetHandler():GetSequence()<5 then ft=ft+1 end - return ft>0 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) - end + local c=e:GetHandler() + if chk==0 then return Duel.GetMZoneCount(tp,c)>=2 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) + and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,tp,LOCATION_MZONE) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,LOCATION_MZONE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - --register special summon limitation + --Destroy this card, and if you do, Special Summon 2 "Meklord Army" monsters from your Deck in Defense Position, + if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 + and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) + and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + end + end + --You cannot Special Summon monsters for the rest of this turn, except Machine monsters local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) - --perform special summon - if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then - if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end - if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp) - if #g>0 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) - end - end end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsRace(RACE_MACHINE) @@ -68,6 +68,7 @@ function s.regtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end end function s.regop(e,tp,eg,ep,ev,re,r,rp) + --Inflict 100 damage to your opponent for each "Meklord" monster you control local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) diff --git a/official/c37491810.lua b/official/c37491810.lua index b92dd4e11b..b194fd3cc3 100644 --- a/official/c37491810.lua +++ b/official/c37491810.lua @@ -2,13 +2,12 @@ --Parametalfoes Azortless local s,id=GetID() function s.initial_effect(c) - --Fusion summon procedure - Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_METALFOES),aux.FilterBoolFunctionEx(Card.IsType,TYPE_FUSION)) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Enable pendulum summon + --Pendulum Summon procedure Pendulum.AddProcedure(c,false) - --Destroy 1 card on the field + --Fusion Materials: 1 "Metalfoes" monster + 1 Fusion Monster + Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_METALFOES),aux.FilterBoolFunctionEx(Card.IsType,TYPE_FUSION)) + --Destroy 1 face-up card on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) @@ -21,10 +20,10 @@ function s.initial_effect(c) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) - --Shuffle 2 pendulum monsters, destroy 1 card + --Shuffle 2 face-up Pendulum Monsters from your Extra Deck into the Deck, and if you do, destroy 1 card your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TODECK) + e2:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_SPSUMMON_SUCCESS) @@ -58,12 +57,11 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end @@ -75,15 +73,15 @@ function s.tdfilter(c) end function s.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end - if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) + if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_EXTRA,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,0,LOCATION_EXTRA) end function s.desop2(e,tp,eg,ep,ev,re,r,rp) - if not Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_EXTRA,0,2,nil) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_EXTRA,0,2,2,nil) if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then local tc=Duel.GetFirstTarget() From a004d3144569d7e5242ce1511001d12b87650938 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Tue, 29 Apr 2025 00:25:50 +0300 Subject: [PATCH 09/57] Update c34460239.lua --- official/c34460239.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/official/c34460239.lua b/official/c34460239.lua index 7f2d58aa4f..fc544c5315 100644 --- a/official/c34460239.lua +++ b/official/c34460239.lua @@ -2,13 +2,14 @@ --Generation Shift local s,id=GetID() function s.initial_effect(c) - --Destroy a card and add 1 card with the same name as the destroyed card from your Deck to your hand + --Destroy 1 face-up monster you control, then add 1 card with the same name as the destroyed card from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) @@ -29,13 +30,13 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then - Duel.BreakEffect() + if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(tp) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local hc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetPreviousCodeOnField()):GetFirst() - if hc then - Duel.SendtoHand(hc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,hc) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetPreviousCodeOnField()) + if #g>0 then + Duel.BreakEffect() + Duel.SendtoHand(g,nil,REASON_EFFECT) + Duel.ConfirmCards(1-tp,g) end end -end \ No newline at end of file +end From 864f1c80b77b4644f2b6ec81c8624189cfa4d4a0 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Tue, 29 Apr 2025 00:42:37 +0300 Subject: [PATCH 10/57] Update c29354228.lua --- official/c29354228.lua | 55 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/official/c29354228.lua b/official/c29354228.lua index cc48e35f72..ca80261de8 100644 --- a/official/c29354228.lua +++ b/official/c29354228.lua @@ -8,30 +8,25 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.efftg) e1:SetOperation(s.effop) c:RegisterEffect(e1) end s.listed_series={SET_DOGMATIKA} s.listed_names={CARD_ALBAZ} -function s.albazdogmatikafilter(c) - return (c:IsCode(CARD_ALBAZ) or (c:IsSetCard(SET_DOGMATIKA) and c:IsMonster())) +function s.handspfilter(c,e,tp) + return (c:IsSetCard(SET_DOGMATIKA) or c:IsCode(CARD_ALBAZ)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function s.thfilter(c) - return s.albazdogmatikafilter(c) and c:IsAbleToHand() -end -function s.spfilter(c,e,tp) - return s.albazdogmatikafilter(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) -end -function s.thspfilter(c,ft,e,tp) - return s.thfilter(c) or (ft>0 and s.spfilter(c,e,tp)) +function s.thspfilter(c,e,tp,mzone_chk) + return (c:IsSetCard(SET_DOGMATIKA) or c:IsCode(CARD_ALBAZ)) and c:IsMonster() and (c:IsAbleToHand() + or (mzone_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - local b1=ft>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) - local b2=Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_GRAVE,0,1,nil,ft,e,tp) + local mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + local b1=mzone_chk and Duel.IsExistingMatchingCard(s.handspfilter,tp,LOCATION_HAND,0,1,nil,e,tp) + local b2=Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,mzone_chk) if chk==0 then return b1 or b2 end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,1)}, @@ -42,31 +37,35 @@ function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) elseif op==2 then e:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) - Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) - Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then - --Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your hand. + --Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your hand if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.handspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end elseif op==2 then --Add to your hand or Special Summon 1 "Dogmatika" monster or "Fallen of Albaz" from your GY - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + local mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3)) - local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thspfilter),tp,LOCATION_GRAVE,0,1,1,nil,ft,e,tp):GetFirst() - if sc then - aux.ToHandOrElse(sc,tp,function(c) - return sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and ft>0 end, - function(c) - Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, - aux.Stringid(id,4)) - end + local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mzone_chk):GetFirst() + if not sc then return end + aux.ToHandOrElse(sc,tp, + function() + return mzone_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) + end, + function() + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) + end, + aux.Stringid(id,4) + ) end -end \ No newline at end of file +end From cb6e5b30d2373cf5e568747618b2964453f4547e Mon Sep 17 00:00:00 2001 From: Naim Date: Tue, 29 Apr 2025 06:01:30 -0300 Subject: [PATCH 11/57] 6 --- official/c37750912.lua | 15 +++++++------ official/c3792766.lua | 18 ++++++++------- official/c38694052.lua | 15 +++++++------ official/c41373230.lua | 15 +++++-------- official/c48032131.lua | 50 ++++++++++++++++++++---------------------- official/c48048590.lua | 21 ++++++++++-------- 6 files changed, 67 insertions(+), 67 deletions(-) diff --git a/official/c37750912.lua b/official/c37750912.lua index 63c770aa37..dae026899f 100644 --- a/official/c37750912.lua +++ b/official/c37750912.lua @@ -3,7 +3,7 @@ --scripted by Rundas local s,id=GetID() function s.initial_effect(c) - --To Grave + --Send 1 "Stardust" monster from your Deck to the GY, or if you control "Stardust Dragon" or a Synchro Monster that mentions it, you can Special Summon it instead local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) @@ -13,9 +13,10 @@ function s.initial_effect(c) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) c:RegisterEffect(e1) - --Level Change + --Increase or decrease the Level of a "Stardust" monster you control by 1 local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,3)) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_LVCHANGE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) @@ -27,7 +28,6 @@ function s.initial_effect(c) end s.listed_names={CARD_STARDUST_DRAGON} s.listed_series={SET_STARDUST} ---To Grave function s.ssfilter(c) return c:IsFaceup() and (c:IsCode(CARD_STARDUST_DRAGON) or (c:ListsCode(CARD_STARDUST_DRAGON) and c:IsType(TYPE_SYNCHRO))) end @@ -42,24 +42,25 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local ss,mz=Duel.IsExistingMatchingCard(s.ssfilter,tp,LOCATION_MZONE,0,1,nil),Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ss,mz) if #g>0 then - if ss and mz and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + if ss and mz and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) else Duel.SendtoGrave(g,REASON_EFFECT) end end end ---Level Change function s.lvfilter(c) return c:IsFaceup() and c:IsSetCard(SET_STARDUST) and c:IsMonster() and c:HasLevel() end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local tc=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() + Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,tc,1,tp,1) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() diff --git a/official/c3792766.lua b/official/c3792766.lua index e987495147..70022639ad 100644 --- a/official/c3792766.lua +++ b/official/c3792766.lua @@ -2,12 +2,13 @@ --Trickstar Delfiendium local s,id=GetID() function s.initial_effect(c) - --link summon - Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_TRICKSTAR),2) c:EnableReviveLimit() - --tohand + --Link Summon procedure: 2+ "Trickstar" monsters + Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_TRICKSTAR),2) + --Add banished "Trickstar" cards to your hand, and if you do, this card gains 1000 ATK for each card added local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_TOHAND) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.thcon) @@ -29,19 +30,20 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_LINK) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,ct,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,tp,0) + Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,#g*1000) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rg=Duel.GetTargetCards(e) Duel.SendtoHand(rg,nil,REASON_EFFECT) if c:IsRelateToEffect(e) and c:IsFaceup() then - local og=Duel.GetOperatedGroup() - local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_HAND) + local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_HAND) if ct>0 then + --This card gains 1000 ATK for each card added local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) diff --git a/official/c38694052.lua b/official/c38694052.lua index b57ca69abb..5fadfbbfb2 100644 --- a/official/c38694052.lua +++ b/official/c38694052.lua @@ -3,10 +3,10 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Xyz Summon - Xyz.AddProcedure(c,nil,7,2) c:EnableReviveLimit() - --Destroy + --Xyz Summon procedure: 2 Level 7 monsters + Xyz.AddProcedure(c,nil,7,2) + --Destroy 1 face-up card on the field it, and if you destroyed a monster, you can make 1 face-up monster you control gain ATK equal to the destroyed monster's original Level/Rank x 300 local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE) @@ -19,6 +19,7 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT) + --This is a Quick Effect if this card has a Dragon monster as material local e2=e1:Clone() e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) @@ -54,7 +55,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() @@ -63,10 +64,10 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then local lv=math.max(tc:GetOriginalLevel(),tc:GetOriginalRank()) - local sg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) + local sc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() Duel.HintSelection(sg) - local sc=sg:GetFirst() - --Increase ATK + --Increase its ATK by the destroyed monster's original Level/Rank x 300 local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) diff --git a/official/c41373230.lua b/official/c41373230.lua index 0b3d5dcdf8..e7f96c0ffe 100644 --- a/official/c41373230.lua +++ b/official/c41373230.lua @@ -4,7 +4,7 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Fusion Summon procedure + --Fusion materials: "Fallen of Albaz" + 1 monster with 2500 or more ATK Fusion.AddProcMix(c,true,true,CARD_ALBAZ,aux.FilterBoolFunctionEx(Card.IsAttackAbove,2500)) --Verify materials local e1=Effect.CreateEffect(c) @@ -37,12 +37,7 @@ end s.listed_names={CARD_ALBAZ} s.listed_series={SET_DOGMATIKA} function s.valcheck(e,c) - local g=c:GetMaterial() - local atk=0 - for tc in g:Iter() do - atk=atk+tc:GetOriginalLevel() - end - e:SetLabel(atk) + e:SetLabel(c:GetMaterial():GetSum(Card.GetOriginalLevel)) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -59,7 +54,7 @@ end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsFusionSummoned() then return end - --immune + --Unaffected by the activated effects of any other monsters Special Summoned from the Extra Deck local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) @@ -100,14 +95,14 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft):GetFirst() if tc then aux.ToHandOrElse(tc,tp,function(c) return tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0 end, function(c) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end, - aux.Stringid(id,1)) + aux.Stringid(id,2)) end end \ No newline at end of file diff --git a/official/c48032131.lua b/official/c48032131.lua index 38067f9cd2..03fde55ef7 100644 --- a/official/c48032131.lua +++ b/official/c48032131.lua @@ -3,25 +3,27 @@ --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) - --activate + --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetHintTiming(0,TIMING_STANDBY_PHASE) c:RegisterEffect(e0) - --atk up + --"HERO" monsters you control gain 400 ATK local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetRange(LOCATION_SZONE) e1:SetHintTiming(0,TIMING_STANDBY_PHASE) - e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetCountLimit(1,id) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) - --banish + --Banish 1 card from your opponent's hand (random), field, or GY local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) @@ -32,8 +34,9 @@ function s.initial_effect(c) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) - --to hand + --Add 1 "Destiny HERO" monster from your Deck to your hand local e3=Effect.CreateEffect(c) + e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_DESTROYED) @@ -45,28 +48,25 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_HERO,SET_DESTINY_HERO} -s.listed_names={76263644} +s.listed_names={76263644} --"Destiny End Dragoon" function s.atkfilter(c) return c:IsFaceup() and c:IsSetCard(SET_HERO) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then - return Duel.IsExistingMatchingCard(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) - end + local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil) + if chk==0 then return #g>0 end + Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,400) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end - local tg=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil) - if #tg>0 then - local sc=tg:GetFirst() - for sc in aux.Next(tg) do - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - e1:SetValue(400) - sc:RegisterEffect(e1) - end + local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil) + if #g==0 then return end + for sc in g:Iter() do + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + e1:SetValue(400) + sc:RegisterEffect(e1) end end function s.cfilter(c,tp) @@ -75,17 +75,15 @@ end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end -function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) local loc=LOCATION_ONFIELD|LOCATION_GRAVE|LOCATION_HAND - if chkc then return chkc:IsOnField() and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,loc,1,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,loc,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local loc=LOCATION_ONFIELD|LOCATION_GRAVE|LOCATION_HAND + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,loc,1,1,nil) if #g>0 then Duel.HintSelection(g) diff --git a/official/c48048590.lua b/official/c48048590.lua index 1d56365cf5..bb748ee902 100644 --- a/official/c48048590.lua +++ b/official/c48048590.lua @@ -3,7 +3,7 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Add to hand when summoned + --Add 1 "Polymerization" Normal Spell or "Fusion" Normal Spell from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) @@ -18,7 +18,7 @@ function s.initial_effect(c) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) - --Special summon a fusion material + --Special Summon from your GY 1 of the Fusion Materials mentioned on a monster in the Extra Deck, in face-down Defense Position local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -37,6 +37,7 @@ function s.counterfilter(c) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end + --You cannot Special Summon monsters from the Extra Deck, except Fusion Monsters local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) @@ -76,16 +77,17 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) end end -function s.filter1(c,e,tp) - return c.material and c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,c) +function s.revealfilter(c,e,tp) + return c.material and c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c) end -function s.filter2(c,e,tp,fc) +function s.spfilter(c,e,tp,fc) return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and c:IsCode(table.unpack(fc.material)) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return s.cost(e,tp,eg,ep,ev,re,r,rp,0) and Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end + if chk==0 then return s.cost(e,tp,eg,ep,ev,re,r,rp,0) + and Duel.IsExistingMatchingCard(s.revealfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) - local g=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.revealfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) Duel.ConfirmCards(1-tp,g) e:SetLabelObject(g:GetFirst()) s.cost(e,tp,eg,ep,ev,re,r,rp,1) @@ -95,9 +97,10 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local fc=e:GetLabelObject() - local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,fc) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,fc) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) end From 44c85f8d5d61e5163d36785441cf7ad88757764c Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Thu, 1 May 2025 02:42:11 +0300 Subject: [PATCH 12/57] Update c3715284.lua --- official/c3715284.lua | 47 +++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/official/c3715284.lua b/official/c3715284.lua index b7e6864d52..92bea8203c 100644 --- a/official/c3715284.lua +++ b/official/c3715284.lua @@ -3,7 +3,7 @@ --scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Destroy this card, and if you do, Special Summon 2 "Meklord Army" monsters from your Deck in Defense Position + --Destroy this card, and if you do, Special Summon 2 "Meklord Army" monsters from your Deck in Defense Position, except "Meklord Army Deployer Obbligato" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) @@ -21,32 +21,29 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,{id,1}) - e2:SetTarget(s.regtg) + e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,100) end) e2:SetOperation(s.regop) c:RegisterEffect(e2) end s.listed_names={id} s.listed_series={SET_MEKLORD,SET_MEKLORD_ARMY} function s.spfilter(c,e,tp) - return c:IsSetCard(SET_MEKLORD_ARMY) and c:IsMonster() and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) + return c:IsSetCard(SET_MEKLORD_ARMY) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return Duel.GetMZoneCount(tp,c)>=2 - and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) - and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) end + if chk==0 then return Duel.GetMZoneCount(tp,c)>=2 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,tp,LOCATION_MZONE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - --Destroy this card, and if you do, Special Summon 2 "Meklord Army" monsters from your Deck in Defense Position, - if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 - and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) + if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp) - if #g>0 then + if #g==2 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end @@ -56,33 +53,25 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) - e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return not c:IsRace(RACE_MACHINE) end) + e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end -function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) - return not c:IsRace(RACE_MACHINE) -end -function s.regtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end -end function s.regop(e,tp,eg,ep,ev,re,r,rp) - --Inflict 100 damage to your opponent for each "Meklord" monster you control + --During the End Phase of this turn, inflict 100 damage to your opponent for each "Meklord" monster you control local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) - e1:SetCondition(s.dmtg) - e1:SetOperation(s.dmop) + e1:SetOperation(s.damop) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end -function s.dmtg(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_MEKLORD),tp,LOCATION_MZONE,0,1,nil) -end -function s.dmop(e,tp,eg,ep,ev,re,r,rp) +function s.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) - local value=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_MEKLORD),tp,LOCATION_MZONE,0,1,nil) - Duel.Damage(1-tp,value*100,REASON_EFFECT) -end \ No newline at end of file + local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsSetCard,SET_MEKLORD),tp,LOCATION_MZONE,0,1,nil) + if ct>0 then + Duel.Damage(1-tp,ct*100,REASON_EFFECT) + end +end From 0734b69cc7fd2d7aadfe36e8ed54dd46f242d8ce Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Thu, 1 May 2025 14:00:38 +0300 Subject: [PATCH 13/57] The Grand Spellbook Tower - Highlight only after checking that a card was selected - Placing on the bottom of the Deck and drawing are simultaneous in the OCG --- official/c33981008.lua | 73 ++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/official/c33981008.lua b/official/c33981008.lua index cf640d058a..e96fc6b66f 100644 --- a/official/c33981008.lua +++ b/official/c33981008.lua @@ -3,62 +3,52 @@ local s,id=GetID() function s.initial_effect(c) --Activate + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_ACTIVATE) + e0:SetCode(EVENT_FREE_CHAIN) + c:RegisterEffect(e0) + --Place 1 "Spellbook" Spell from your GY on the bottom of your Deck, except "The Grand Spellbook Tower", and if you do, draw 1 card local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetCode(EVENT_PHASE|PHASE_STANDBY) + e1:SetRange(LOCATION_FZONE) + e1:SetCountLimit(1) + e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_SPELLCASTER),tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end) + e1:SetTarget(s.drtg) + e1:SetOperation(s.drop) c:RegisterEffect(e1) - --Place 1 "Spellbook" Spell Card from your GY on the bottom of your Deck then draw 1 card + --Special Summon 1 Spellcaster monster from your hand or Deck whose Level is less than or equal to the number of "Spellbook" Spells in your GY local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) - e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e2:SetRange(LOCATION_FZONE) - e2:SetCode(EVENT_PHASE|PHASE_STANDBY) - e2:SetCountLimit(1) - e2:SetCondition(s.drcon) - e2:SetTarget(s.drtg) - e2:SetOperation(s.drop) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_TO_GRAVE) + e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and e:GetHandler():IsReason(REASON_DESTROY) end) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) c:RegisterEffect(e2) - --Special Summon 1 Spellcaster monster from your hand or Deck whose Level is less than or equal to the number of "Spellbook" Spell Cards in your GY - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetCategory(CATEGORY_SPECIAL_SUMMON) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP) - e3:SetCode(EVENT_TO_GRAVE) - e3:SetCondition(s.spcon) - e3:SetTarget(s.sptg) - e3:SetOperation(s.spop) - c:RegisterEffect(e3) end s.listed_series={SET_SPELLBOOK} s.listed_names={id} -function s.cfilter(c) - return c:IsRace(RACE_SPELLCASTER) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) -end -function s.drcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(tp) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) -end -function s.filter(c) +function s.tdfilter(c) return c:IsSetCard(SET_SPELLBOOK) and c:IsSpell() and c:IsAbleToDeck() and not c:IsCode(id) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,0,1,nil) end + if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) + if #g==0 then return end Duel.HintSelection(g) - if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 then - Duel.BreakEffect() + if Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT)>0 then Duel.Draw(tp,1,REASON_EFFECT) end end -function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsReason(REASON_DESTROY) and not e:GetHandler():IsReason(REASON_RULE) and rp==1-tp -end function s.ctfilter(c) return c:IsSetCard(SET_SPELLBOOK) and c:IsSpell() end @@ -69,16 +59,17 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end local ct=Duel.GetMatchingGroupCount(s.ctfilter,tp,LOCATION_GRAVE,0,nil) - return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,nil,e,tp,ct) + return ct>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp,ct) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_HAND) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end local ct=Duel.GetMatchingGroupCount(s.ctfilter,tp,LOCATION_GRAVE,0,nil) + if ct==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil,e,tp,ct) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp,ct) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end From 61e718ff33fb19cd83ec9680b22d98e0c53d1f22 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Thu, 1 May 2025 15:18:52 +0300 Subject: [PATCH 14/57] Keeper of Dragon Magic Use Cost.AND for the shared restriction cost --- official/c48048590.lua | 63 +++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/official/c48048590.lua b/official/c48048590.lua index bb748ee902..06a6c8c97b 100644 --- a/official/c48048590.lua +++ b/official/c48048590.lua @@ -8,10 +8,10 @@ function s.initial_effect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) - e1:SetCost(s.thcost) + e1:SetCost(Cost.AND(Cost.Discard(),s.cost)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) @@ -25,45 +25,28 @@ function s.initial_effect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) - e3:SetCost(s.spcost) + e3:SetCost(Cost.AND(s.spcost,s.cost)) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) - Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) + Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,function(c) return not (c:IsSummonLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION)) end) end s.listed_series={SET_FUSION} -function s.counterfilter(c) - return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsType(TYPE_FUSION) -end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end - --You cannot Special Summon monsters from the Extra Deck, except Fusion Monsters + --You cannot Special Summon monsters from the Extra Deck, except Fusion Monsters, the turn you activate either of this card's effects local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) + e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,2),nil) - --lizard check - aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter) -end -function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) - return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA) -end -function s.lizfilter(e,c) - return not c:IsOriginalType(TYPE_FUSION) -end -function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) - and s.cost(e,tp,eg,ep,ev,re,r,rp,0) end - Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) - s.cost(e,tp,eg,ep,ev,re,r,rp,1) end function s.thfilter(c) - return c:IsNormalSpell() and c:IsSetCard(SET_FUSION) and c:IsAbleToHand() + return c:IsSetCard(SET_FUSION) and c:IsNormalSpell() 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_DECK,0,1,nil) end @@ -77,20 +60,19 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmCards(1-tp,g) end end -function s.revealfilter(c,e,tp) - return c.material and c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c) +function s.spcostfilter(c,e,tp) + return c:IsType(TYPE_FUSION) and not c:IsPublic() and c.material and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,table.unpack(c.material)) end -function s.spfilter(c,e,tp,fc) - return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and c:IsCode(table.unpack(fc.material)) +function s.spfilter(c,e,tp,...) + return c:IsCode(...) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return s.cost(e,tp,eg,ep,ev,re,r,rp,0) - and Duel.IsExistingMatchingCard(s.revealfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end + if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) - local g=Duel.SelectMatchingCard(tp,s.revealfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) - Duel.ConfirmCards(1-tp,g) - e:SetLabelObject(g:GetFirst()) - s.cost(e,tp,eg,ep,ev,re,r,rp,1) + local sc=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() + Duel.ConfirmCards(1-tp,sc) + Duel.ShuffleExtra(tp) + e:SetLabel(table.unpack(sc.material)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end @@ -98,10 +80,9 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - local fc=e:GetLabelObject() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,fc) - if #g>0 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,e:GetLabel()) + if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then + Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end From 1e9e4d38e5a064acef332763251fd6dee2931330 Mon Sep 17 00:00:00 2001 From: Naim Date: Thu, 1 May 2025 13:44:16 -0300 Subject: [PATCH 15/57] 7 --- official/c50793215.lua | 7 ++++--- official/c51782995.lua | 32 ++++++++++++++++---------------- official/c52331012.lua | 14 +++++++------- official/c53417695.lua | 24 +++++++++++++----------- official/c55051920.lua | 12 +++++++----- official/c56980148.lua | 8 ++++---- official/c60375194.lua | 5 ++++- official/c61245672.lua | 27 ++++++++++++++------------- official/c66380357.lua | 20 +++++++++++--------- official/c66809920.lua | 41 +++++++++++++++++++++-------------------- official/c67647362.lua | 3 ++- official/c69217334.lua | 4 ++-- official/c69809989.lua | 21 +++++++++++++-------- 13 files changed, 118 insertions(+), 100 deletions(-) diff --git a/official/c50793215.lua b/official/c50793215.lua index 3aedd71780..d9b880cc0c 100644 --- a/official/c50793215.lua +++ b/official/c50793215.lua @@ -28,7 +28,7 @@ function s.initial_effect(c) c:RegisterEffect(e2) --If sent to GY, shuffle 1 banished card into deck local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,3)) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) @@ -54,8 +54,9 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local hc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)):GetFirst() - if hc and aux.ToHandOrElse(hc,tp,s.spcheck(e,tp),s.spop(tp),aux.Stringid(id,1))~=0 and tc:IsRelateToEffect(e) then + if hc and aux.ToHandOrElse(hc,tp,s.spcheck(e,tp),s.spop(tp),aux.Stringid(id,3))~=0 and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end @@ -93,7 +94,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() diff --git a/official/c51782995.lua b/official/c51782995.lua index 832c0e6640..a0a8d541ed 100644 --- a/official/c51782995.lua +++ b/official/c51782995.lua @@ -2,30 +2,31 @@ --Defender of Nephthys local s,id=GetID() function s.initial_effect(c) - --special summon + --Destroy 1 card in your hand, and if you do, Special Summon 1 Level 4 or lower "Nephthys" monster from your hand, except "Defender of Nephthys local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) + e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetCountLimit(1,id) e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --reg + --Register when this card is destroyed by card effect and sent to the GY local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_TO_GRAVE) - e2:SetOperation(s.spr) + e2:SetOperation(s.regop) c:RegisterEffect(e2) + --Destroy 1 "Nephthys" monster in your Deck, except "Defender of Nephthys" local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_PHASE|PHASE_STANDBY) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,{id,1}) - e3:SetCode(EVENT_PHASE|PHASE_STANDBY) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) @@ -48,19 +49,19 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) + local sp=Duel.GetMatchingGroupCount(nil,tp,LOCATION_HAND,0,nil)>1 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local sp=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_HAND,0,nil)>1 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,1,sp) if #g==0 then return end - if Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then + if Duel.Destroy(g,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g2=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) - if #g2>0 then - Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() + if sc then + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end end end -function s.spr(e,tp,eg,ep,ev,re,r,rp) +function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if (r&(REASON_DESTROY|REASON_EFFECT)~=(REASON_DESTROY|REASON_EFFECT)) then return end if Duel.IsTurnPlayer(tp) and Duel.IsPhase(PHASE_STANDBY) then @@ -73,17 +74,16 @@ function s.spr(e,tp,eg,ep,ev,re,r,rp) end function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(id)>0 + return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and Duel.IsTurnPlayer(tp) and c:GetFlagEffect(id)>0 end function s.desfilter(c) return c:IsSetCard(SET_NEPHTHYS) and c:IsMonster() and not c:IsCode(id) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_DECK,0,1,nil) end + e:GetHandler():ResetFlagEffect(id) local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_DECK,0,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) - c:ResetFlagEffect(id) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) diff --git a/official/c52331012.lua b/official/c52331012.lua index bfcf08666b..2677eaad34 100644 --- a/official/c52331012.lua +++ b/official/c52331012.lua @@ -3,10 +3,10 @@ --Scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Link Summon - Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACES_BEAST_BWARRIOR_WINGB),2,3) c:EnableReviveLimit() - --Special Summon from hand + --Link Summon procedure: 2+ Beast, Beast-Warrior, and/or Winged Beast monsters + Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACES_BEAST_BWARRIOR_WINGB),2,3) + --Special Summon 1 Level 4 or lower Beast, Beast-Warrior, or Winged Beast monster from your hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -19,7 +19,7 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Decrease ATK + --Make all monsters your opponent currently controls lose 300 ATK for each Monster Type you control local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) @@ -45,9 +45,8 @@ end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() local c=e:GetHandler() - local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) - local sc=g:GetFirst() if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) @@ -95,8 +94,9 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) + if #g==0 then return end local ct=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetRace) - for tc in aux.Next(g) do + for tc in g:Iter() do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) diff --git a/official/c53417695.lua b/official/c53417695.lua index 2fec51ecb1..3fd8a10916 100644 --- a/official/c53417695.lua +++ b/official/c53417695.lua @@ -3,7 +3,7 @@ --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --destroy + --Destroy 1 "Unchained" monster you control and 1 card on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) @@ -15,7 +15,7 @@ function s.initial_effect(c) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) - --special summon + --Special Summon 1 "Unchained" monster from your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -32,22 +32,24 @@ s.listed_series={SET_UNCHAINED} function s.desfilter(c,tp,oc) return c:IsFaceup() and c:IsSetCard(SET_UNCHAINED) and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,Group.FromCards(c,oc)) end +function s.unchainedfilter(c,tp) + return c:IsSetCard(SET_UNCHAINED) and c:IsMonster() and c:IsControler(tp) +end +function s.rescon(sg,e,tp,mg) + return sg:IsExists(s.unchainedfilter,1,nil,tp) +end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - g:AddCard(c) - local g2=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g) - g:RemoveCard(c) - g:Merge(g2) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0) + local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) + local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_DESTROY) + Duel.SetTargetCard(tg) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,#tg,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) - if #tg==2 and tg:FilterCount(Card.IsRelateToEffect,nil,e)==2 then + if #tg==2 then Duel.Destroy(tg,REASON_EFFECT) end end diff --git a/official/c55051920.lua b/official/c55051920.lua index 9a32883a9d..dc499a02ba 100644 --- a/official/c55051920.lua +++ b/official/c55051920.lua @@ -9,7 +9,7 @@ function s.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) c:RegisterEffect(e1) - --Targeted "Orcust" or "World Legacy" card cannot be targeted by card effects + --Neither player can target 1 "Orcust" or "World Legacy" card you control with card effects this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_QUICK_O) @@ -38,23 +38,25 @@ function s.cfilter(c,tp) and Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,0,1,c) end function s.filter(c) - return c:IsFaceup() and (c:IsSetCard(SET_ORCUST) or c:IsSetCard(SET_WORLD_LEGACY)) and not c:IsCode(id) + return c:IsFaceup() and c:IsSetCard({SET_ORCUST,SET_WORLD_LEGACY}) and not c:IsCode(id) end function s.immcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.immtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO) Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,0,1,1,nil) end function s.immop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) then - local e1=Effect.CreateEffect(c) + if tc:IsRelateToEffect(e) then + --Neither player can target it with card effects this turn + local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3002) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) diff --git a/official/c56980148.lua b/official/c56980148.lua index b72b473f68..9b34780d57 100644 --- a/official/c56980148.lua +++ b/official/c56980148.lua @@ -3,7 +3,7 @@ --scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Search 1 "Dinowrestler" monster or 1 "World Dino Wrestling" + --Add 1 "Dinowrestler" monster or 1 "World Dino Wrestling" from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) @@ -36,7 +36,7 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_DINOWRESTLER} -s.listed_names={90173539,id} +s.listed_names={90173539,id} --"World Dino Wrestling" function s.thfilter(c) return ((c:IsSetCard(SET_DINOWRESTLER) and c:IsMonster()) or c:IsCode(90173539)) and c:IsAbleToHand() end @@ -65,12 +65,12 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) diff --git a/official/c60375194.lua b/official/c60375194.lua index 0d65bf50d2..3874ffc536 100644 --- a/official/c60375194.lua +++ b/official/c60375194.lua @@ -5,6 +5,7 @@ local s,id=GetID() function s.initial_effect(c) --Destroy all cards on the field, except the targeted "Vendread" ritual monster local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) @@ -28,6 +29,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,0,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) if #g==0 then return end Duel.HintSelection(g) @@ -35,10 +37,11 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) if #dg~=0 then Duel.Destroy(dg,REASON_EFFECT) end + --It cannot attack directly local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(3207) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) - g:GetFirst():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0)) g:GetFirst():RegisterEffect(e1) end \ No newline at end of file diff --git a/official/c61245672.lua b/official/c61245672.lua index 5fa2843dde..02e4873c3b 100644 --- a/official/c61245672.lua +++ b/official/c61245672.lua @@ -2,10 +2,10 @@ --Decode Talker Heatsoul local s,id=GetID() function s.initial_effect(c) - --link summon - Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_CYBERSE),2,99,s.lcheck) c:EnableReviveLimit() - --Increase ATK + --Link Summon procedure: 2+ Cyberse monsters with different Attributes + Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_CYBERSE),2,99,s.lcheck) + --Gains 500 ATK for each monster it points to local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) @@ -13,15 +13,15 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) - --Draw and Special Summon + --Draw 1 card, then banish this card from the field, and if you do, Special Summon 1 Link-3 or lower Cyberse monster from your Extra Deck, except "Decode Talker Heatsoul" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) - e2:SetCountLimit(1,id) e2:SetRange(LOCATION_MZONE) - e2:SetHintTiming(0,TIMING_END_PHASE) + e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) + e2:SetCountLimit(1,id) e2:SetCost(Cost.PayLP(1000)) e2:SetTarget(s.target) e2:SetOperation(s.operation) @@ -47,14 +47,15 @@ end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - if Duel.Draw(p,d,REASON_EFFECT)~=0 and Duel.GetLP(tp)<=2000 and c:IsRelateToEffect(e) and c:IsAbleToRemove() + if Duel.Draw(p,d,REASON_EFFECT)>0 and Duel.GetLP(tp)<=2000 and c:IsRelateToEffect(e) and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then - Duel.BreakEffect() - if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 then - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) - if #g>0 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) - end + Duel.BreakEffect() + if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) + if #g>0 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end + end end end \ No newline at end of file diff --git a/official/c66380357.lua b/official/c66380357.lua index 9ca4863f95..a51c76eb03 100644 --- a/official/c66380357.lua +++ b/official/c66380357.lua @@ -5,6 +5,7 @@ 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) e1:SetType(EFFECT_TYPE_ACTIVATE) @@ -34,19 +35,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local fid=e:GetHandler():GetFieldID() - local c=Duel.GetFirstTarget() - local zone=c:GetFreeLinkedZone()&ZONES_MMZ + local tc=Duel.GetFirstTarget() + local zone=tc:GetFreeLinkedZone()&ZONES_MMZ local count=s.zone_count(zone) - local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp,c) + local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp,tc) if #sg0 and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP,zone) then - tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,tc):GetFirst() + if sc then + local zone=tc:GetFreeLinkedZone()&ZONES_MMZ + if zone>0 and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP,zone) then + sc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid) end end end diff --git a/official/c66809920.lua b/official/c66809920.lua index f495d77620..1c38bcc837 100644 --- a/official/c66809920.lua +++ b/official/c66809920.lua @@ -3,33 +3,33 @@ --scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --damage + --Add 1 "Mischief of the Time Goddess" from your Gy to your hand local e1=Effect.CreateEffect(c) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) + e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) - e1:SetCountLimit(1,id) c:RegisterEffect(e1) - --remove + --Banish 1 monster from your opponent's GY, then this card's ATK becomes equal to the banished monster's original ATK local e2=Effect.CreateEffect(c) - e2:SetCategory(CATEGORY_REMOVE+CATEGORY_LEAVE_GRAVE) e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.rmcon) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) - e2:SetCountLimit(1,{id,1}) c:RegisterEffect(e2) end s.listed_series={SET_VALKYRIE} -s.listed_names={92182447} +s.listed_names={92182447} --"Mischief of the Time Goddess" function s.thcon(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSpell() and e:GetHandler():IsPreviousLocation(LOCATION_HAND) end @@ -41,7 +41,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() @@ -60,21 +60,22 @@ function s.rmfilter(c) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_GRAVE,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,1,nil):GetFirst() - if rc then - if Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsFaceup() then - Duel.BreakEffect() - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetReset(RESETS_STANDARD_PHASE_END) - e1:SetCode(EFFECT_SET_ATTACK) - e1:SetValue(rc:GetBaseAttack()) - c:RegisterEffect(e1) - end + if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then + Duel.BreakEffect() + --Tis card's ATK becomes equal to the banished monster's original ATK + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESETS_STANDARD_PHASE_END) + e1:SetCode(EFFECT_SET_ATTACK) + e1:SetValue(rc:GetBaseAttack()) + c:RegisterEffect(e1) end end \ No newline at end of file diff --git a/official/c67647362.lua b/official/c67647362.lua index a7f516c9e4..34c120b93a 100644 --- a/official/c67647362.lua +++ b/official/c67647362.lua @@ -42,9 +42,10 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,att) and Duel.IsPlayerCanDraw(tp,1) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) - Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local att=0 diff --git a/official/c69217334.lua b/official/c69217334.lua index 163a04fdb7..f8000d1ee1 100644 --- a/official/c69217334.lua +++ b/official/c69217334.lua @@ -29,7 +29,7 @@ function s.initial_effect(c) e3:SetTarget(s.target) c:RegisterEffect(e3) end -s.listed_names={46427957,72426662} +s.listed_names={46427957,72426662} --"Ruin, Queen of Oblivion", "Demise, King of Armageddon" function s.lvfilter(c,tp) return c:IsFaceup() and c:IsType(TYPE_RITUAL) and Duel.IsExistingMatchingCard(s.lvcfilter,tp,LOCATION_HAND,0,1,nil,c) @@ -49,7 +49,6 @@ function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) e:SetLabelObject(cg:GetFirst()) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) - if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() local pc=e:GetLabelObject() if tc:IsRelateToEffect(e) then @@ -98,6 +97,7 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) Duel.Draw(p,d,REASON_EFFECT) end function s.desop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) if #g>0 then Duel.Destroy(g,REASON_EFFECT) diff --git a/official/c69809989.lua b/official/c69809989.lua index 9f165bb707..db76624363 100644 --- a/official/c69809989.lua +++ b/official/c69809989.lua @@ -3,7 +3,7 @@ --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) - --Special Summon + --Special Summon 1 "Ghostrick" monster from your hand or GY, then you can change 1 face-down "Ghostrick" monster you control to face-up Attack Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION) @@ -13,9 +13,10 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Attach + --Attach 1 "Ghostrick" card from your GY to 1 "Ghostrick" Xyz Monster you control as material local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_LEAVE_GRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) @@ -44,6 +45,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local pg=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,0,1,1,nil) if #pg>0 then Duel.BreakEffect() @@ -51,15 +53,18 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) end end end -function s.xyzfilter(c) +function s.xyzfilter(c,tp) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(SET_GHOSTRICK) + and Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_GRAVE,0,1,nil,tp,c) +end +function s.attachfilter(c,tp,xyzc) + return c:IsSetCard(SET_GHOSTRICK) and c:IsCanBeXyzMaterial(xyzc,tp,REASON_EFFECT) end function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil) - and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_GRAVE,0,1,e:GetHandler(),SET_GHOSTRICK) end + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc,tp) end + if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) - Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0) end function s.matop(e,tp,eg,ep,ev,re,r,rp) @@ -67,7 +72,7 @@ function s.matop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_XYZ) and not tc:IsImmuneToEffect(e) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) - local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_GRAVE,0,1,1,nil,SET_GHOSTRICK) + local g=Duel.SelectMatchingCard(tp,s.attachfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp,tc) if #g==0 then return end Duel.Overlay(tc,g) end From 00bab2552c314dc48db2349bd0dff7014f87ef90 Mon Sep 17 00:00:00 2001 From: Naim Date: Fri, 2 May 2025 16:30:56 -0300 Subject: [PATCH 16/57] batch8 --- official/c70252926.lua | 37 ++++++++++++------------- official/c70369116.lua | 8 ++++-- official/c72272462.lua | 24 ++++++++-------- official/c72332074.lua | 9 +++--- official/c72498838.lua | 62 ++++++++++++++++++------------------------ official/c78199891.lua | 3 +- official/c81945678.lua | 26 ++++++++---------- official/c84271823.lua | 43 ++++++++++++++++------------- 8 files changed, 102 insertions(+), 110 deletions(-) diff --git a/official/c70252926.lua b/official/c70252926.lua index f00b78c051..fb4cec36c6 100644 --- a/official/c70252926.lua +++ b/official/c70252926.lua @@ -2,21 +2,21 @@ --Fortune Lady Every local s,id=GetID() function s.initial_effect(c) - --synchro summon - Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsRace,RACE_SPELLCASTER),1,99) c:EnableReviveLimit() - --atk,def + --Synchro Summon procedure: 1 Tuner + 1+ non-Tuner Spellcaster monsters + Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsRace,RACE_SPELLCASTER),1,99) + --This card's ATK/DEF become its Level x 400 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_SET_ATTACK) - e1:SetValue(s.value) + e1:SetValue(function(e,c) return c:GetLevel()*400 end) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE) c:RegisterEffect(e2) - --level up + --Increase this card's Level by 1 (max. 12), then, you can banish 1 face-up monster your opponent controls local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) @@ -27,7 +27,7 @@ function s.initial_effect(c) e3:SetCondition(s.lvcon) e3:SetOperation(s.lvop) c:RegisterEffect(e3) - --special summon + --Special Summon this card from the GY local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -35,14 +35,12 @@ function s.initial_effect(c) e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetRange(LOCATION_GRAVE) e4:SetCountLimit(1,id) - e4:SetCondition(s.spcon) + e4:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end) + e4:SetCost(s.spcost) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) end -function s.value(e,c) - return c:GetLevel()*400 -end function s.lvcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and e:GetHandler():IsLevelAbove(1) and e:GetHandler():IsLevelBelow(11) end @@ -76,20 +74,21 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp) end end end -function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(1-tp) -end -function s.rmfilter(c) +function s.spcostfilter(c) return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_SPELLCASTER) end +function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then returnDuel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_GRAVE,0,1,c) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_GRAVE,0,1,1,c) + Duel.Remove(g,POS_FACEUP,REASON_COST) +end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and c:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_GRAVE,0,1,c) end - local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_GRAVE,0,1,1,c) - Duel.Remove(g,POS_FACEUP,REASON_COST) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,LOCATION_GRAVE) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() diff --git a/official/c70369116.lua b/official/c70369116.lua index b23c9b430c..3c5429e4d4 100644 --- a/official/c70369116.lua +++ b/official/c70369116.lua @@ -5,7 +5,7 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_EFFECT),2,2) - --Change attribute to DARK + --The attribute of 1 face-up monster becomes DARK until the end of this turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) @@ -15,7 +15,7 @@ function s.initial_effect(c) e1:SetTarget(s.attg) e1:SetOperation(s.atop) c:RegisterEffect(e1) - --Apply the effects of a "Fusion/Polymerization" spell + --This effect becomes the effect of 1 "Fusion" or "Polymerization" Normal or Quick-Play Spel when that card is activated local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) @@ -60,6 +60,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end if chk==0 then return Duel.IsExistingMatchingCard(s.copfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.copfilter,tp,LOCATION_DECK,0,1,1,nil) if not Duel.SendtoGrave(g,REASON_COST) then return end local te=g:GetFirst():CheckActivateEffect(true,true,false) @@ -84,11 +85,12 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) te:SetLabel(e:GetLabel()) te:SetLabelObject(e:GetLabelObject()) end + --You cannot Special Summon monsters for the rest of this turn local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) - e1:SetDescription(aux.Stringid(id,2)) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) diff --git a/official/c72272462.lua b/official/c72272462.lua index 649b8a1c81..56a82db47d 100644 --- a/official/c72272462.lua +++ b/official/c72272462.lua @@ -5,7 +5,7 @@ local s,id=GetID() function s.initial_effect(c) Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_DESPIA),s.matfilter) c:EnableReviveLimit() - --Change ATK to 0 + --Change the ATK of all monsters currently on the field to 0, except Level 8 or higher Fusion Monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) @@ -14,16 +14,16 @@ function s.initial_effect(c) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCountLimit(1,id) - e1:SetCondition(s.atkcon) + e1:SetCondition(function() return Duel.IsMainPhase() end) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) - --Search or Special Summon + --Add to your hand, or Special Summon, 1 "Fallen of Albaz" or 1 "Despia" monster, from your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) - e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.thcon) @@ -36,10 +36,6 @@ s.listed_names={CARD_ALBAZ} function s.matfilter(c,fc,st,tp) return c:IsAttribute(ATTRIBUTE_LIGHT,fc,st,tp) or c:IsAttribute(ATTRIBUTE_DARK,fc,st,tp) end ---Change ATK -function s.atkcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsMainPhase() -end function s.atkfilter(c) return c:IsFaceup() and c:GetAttack()>0 and not (c:IsType(TYPE_FUSION) and c:IsLevelAbove(8)) end @@ -49,10 +45,11 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,PLAYER_ALL,LOCATION_MZONE) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) + if #g==0 then return end + local c=e:GetHandler() for tc in g:Iter() do - --Make ATK 0 + --Change the ATK to 0 until the end of this turn local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) @@ -61,7 +58,6 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) end end ---Search or Special Summon function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) @@ -73,16 +69,18 @@ end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ft) end + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft):GetFirst() if tc then aux.ToHandOrElse(tc,tp,function(c) return tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0 end, function(c) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end, - aux.Stringid(id,1)) + aux.Stringid(id,3)) end end \ No newline at end of file diff --git a/official/c72332074.lua b/official/c72332074.lua index acdc20d589..c22407b3ee 100644 --- a/official/c72332074.lua +++ b/official/c72332074.lua @@ -2,7 +2,7 @@ --Super Quantal Alphan Spike local s,id=GetID() function s.initial_effect(c) - --Activate + --Shuffle as many cards your opponent controls as possible into the Deck, then your opponent Special Summons 1 monster from their Extra Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK) @@ -12,7 +12,7 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --activate field spell + --Activate 1 "Super Quantal Mech Ship Magnacarrier" from your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) @@ -23,7 +23,7 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.listed_series={SET_SUPER_QUANTUM} -s.listed_names={58753372,10424147} +s.listed_names={58753372,10424147} --"Super Quantal Fairy Alphan", "Super Quantal Mech Ship Magnacarrier" function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_SUPER_QUANTUM) end @@ -59,7 +59,7 @@ function s.costfilter(c) end function s.actcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) + if chk==0 then return Cost.SelfBanish(e,tp,eg,ep,ev,re,r,rp,0) and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,c) @@ -73,6 +73,7 @@ function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.actfilter,tp,LOCATION_DECK,0,1,nil,tp) end end function s.actop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local tc=Duel.SelectMatchingCard(tp,s.actfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() Duel.ActivateFieldSpell(tc,e,tp,eg,ep,ev,re,r,rp) end \ No newline at end of file diff --git a/official/c72498838.lua b/official/c72498838.lua index 1c6d4dc4e6..0ed5356e74 100644 --- a/official/c72498838.lua +++ b/official/c72498838.lua @@ -3,11 +3,11 @@ --Scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Add "Magistus" Spell/Trap to the hand or return 1 Spellcaster to the GY + --Activate 1 of these effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.target) @@ -16,9 +16,9 @@ function s.initial_effect(c) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) - --Equip from grave + --Equip 1 "Magistus" monster you control with 1 "Magistus" monster from your GY, except a Level 4 monster. local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,3)) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_EQUIP) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) @@ -30,7 +30,7 @@ function s.initial_effect(c) c:RegisterEffect(e3) end s.listed_series={SET_MAGISTUS} -function s.schfilter(c) +function s.thfilter(c) return c:IsSetCard(SET_MAGISTUS) and c:IsSpellTrap() and c:IsAbleToHand() end function s.tgfilter(c) @@ -38,48 +38,38 @@ function s.tgfilter(c) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then - local sel=0 - if Duel.IsExistingMatchingCard(s.schfilter,tp,LOCATION_DECK,0,1,nil) then sel=sel+1 end - if Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_REMOVED,0,1,nil) then sel=sel+2 end - e:SetLabel(sel) - return sel~=0 - end - local sel=e:GetLabel() - if sel==3 then - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,0)) - sel=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))+1 - elseif sel==1 then - Duel.SelectOption(tp,aux.Stringid(id,1)) - else - Duel.SelectOption(tp,aux.Stringid(id,2)) - end - e:SetLabel(sel) - if sel==1 then + local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) + local b2=Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_REMOVED,0,1,nil) + if chk==0 then return b1 or b2 end + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,2)}, + {b2,aux.Stringid(id,3)}) + e:SetLabel(op) + if op==1 then e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) - else + elseif op==2 local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_REMOVED,0,nil) e:SetCategory(CATEGORY_TOGRAVE) - Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local sel=e:GetLabel() - if sel==1 then + local op=e:GetLabel() + if op==1 then + --Add 1 "Magistus" Spell/Trap from your Deck to your hand. Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.schfilter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.thfiler,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end - else - if Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_REMOVED,0,1,nil) then - local tg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil) - if #tg>0 then - Duel.SendtoGrave(tg,REASON_EFFECT|REASON_RETURN) - end + elseif op==2 + --Return 1 of your banished Level 4 or lower Spellcaster monsters to your GY + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOGRAVE) + local tg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil) + if #tg>0 then + Duel.SendtoGrave(tg,REASON_EFFECT|REASON_RETURN) end end end diff --git a/official/c78199891.lua b/official/c78199891.lua index 3fad3019a1..bed2041106 100644 --- a/official/c78199891.lua +++ b/official/c78199891.lua @@ -45,12 +45,13 @@ function s.eqptg(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) if e:GetHandler():IsLocation(LOCATION_HAND) then ft=ft-1 end if chk==0 then return ft>0 and Duel.IsExistingTarget(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK) end function s.eqpop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if not (tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end + if not (tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc,tp) if #g>0 then diff --git a/official/c81945678.lua b/official/c81945678.lua index 98aff1bcb6..49b79bf468 100644 --- a/official/c81945678.lua +++ b/official/c81945678.lua @@ -2,19 +2,19 @@ --Joker's Wild local s,id=GetID() function s.initial_effect(c) - --Copy face card spell + --This effect becomes the effect of a Spell that specifically lists all of "Queen's Knight", "King's Knight", and "Jack's Knight" when that card is activated local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_START) e1:SetCountLimit(1,id) - e1:SetCondition(s.condition) + e1:SetCondition(function() return Duel.IsMainPhase() or Duel.IsBattlePhase() end) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --to hand + --Shuffle 1 LIGHT Warrior monster in your GY into the Deck, and if you do, add this card to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK) @@ -24,15 +24,12 @@ function s.initial_effect(c) e2:SetRange(LOCATION_GRAVE) e2:SetHintTiming(TIMING_END_PHASE) e2:SetCountLimit(1,{id,1}) - e2:SetCondition(s.tdcon) + e2:SetCondition(function() return Duel.IsPhase(PHASE_END) end) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end s.listed_names={CARD_JACK_KNIGHT,CARD_KING_KNIGHT,CARD_QUEEN_KNIGHT} -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsMainPhase() or Duel.IsBattlePhase() -end function s.copfilter(c) return c:IsAbleToGraveAsCost() and c:ListsCode(CARD_JACK_KNIGHT,CARD_KING_KNIGHT,CARD_QUEEN_KNIGHT) and c:IsSpell() and c:CheckActivateEffect(true,true,false)~=nil @@ -46,6 +43,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end if chk==0 then return Duel.IsExistingMatchingCard(s.copfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.copfilter,tp,LOCATION_DECK,0,1,1,nil) if not Duel.SendtoGrave(g,REASON_COST) then return end local te=g:GetFirst():CheckActivateEffect(true,true,false) @@ -71,25 +69,23 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) te:SetLabelObject(e:GetLabelObject()) end end -function s.tdcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsPhase(PHASE_END) -end function s.tdfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR) and c:IsAbleToDeck() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc) end - if chk==0 then return e:GetHandler():IsAbleToHand() + if chk==0 then return c:IsAbleToHand() and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() local c=e:GetHandler() - if tc and tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 + local tc=Duel.GetFirstTarget() + if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA) and c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end diff --git a/official/c84271823.lua b/official/c84271823.lua index cef9b449f5..bf879a138e 100644 --- a/official/c84271823.lua +++ b/official/c84271823.lua @@ -3,29 +3,30 @@ --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --link summon c:EnableReviveLimit() + --Link Summon procedure: 2 monsters with different Levels Link.AddProcedure(c,s.mfilter,2,nil,s.matcheck) - --change level + --Change the Level of a monster(s) Special Summoned to a zone this card points to local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_LVCHANGE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) - e1:SetCountLimit(1,id) e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,id) e1:SetCondition(s.lvcon) e1:SetTarget(s.lvtg) e1:SetOperation(s.lvop) c:RegisterEffect(e1) - --destroy + --Destroy 2 monsters (1 from each field) with the same level local e2=Effect.CreateEffect(c) - e2:SetCategory(CATEGORY_DESTROY) e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetCountLimit(1,{id,1}) e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) @@ -54,6 +55,7 @@ function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) e:SetLabel(Duel.AnnounceLevel(tp,1,8,lv)) e:SetLabelObject(g) + Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,g,#dg,0,e:GetLabel()) end function s.opfilter(c,e) return c:IsFaceup() and c:IsRelateToEffect(e) @@ -62,7 +64,8 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local lg=e:GetHandler():GetLinkedGroup() local g=eg:Filter(s.cfilter,nil,tp,lg) - for tc in aux.Next(g) do + --Their levels become the declared Level + for tc in g:Iter() do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) @@ -71,21 +74,23 @@ function s.lvop(e,tp,eg,ep,ev,re,r,rp) tc:RegisterEffect(e1) end end -function s.desfilter1(c,tp) - return c:IsFaceup() and c:IsLevelAbove(1) and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsLevel,c:GetLevel()),tp,0,LOCATION_MZONE,1,nil) +function s.desfilter(c,e) + return c:IsFaceup() and c:HasLevel() and c:IsCanBeEffectTarget(e) +end +function s.rescon(sg,e,tp,mg) + return sg:GetClassCount(Card.GetControler)==2 and sg:GetClassCount(Card.GetLevel)==1 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.desfilter1(chkc,chkc:GetControler()) end - if chk==0 then return Duel.IsExistingTarget(s.desfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end - local g=Duel.SelectTarget(tp,s.desfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp) - local oc=g:GetFirst() - local sg=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsLevel,oc:GetLevel()),tp,0,LOCATION_MZONE,1,1,nil) - g:Merge(sg) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) + if chkc then return false end + local g=Duel.GetMatchingGroup(s.desfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil,e) + if chk==0 then return #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end + local dg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_DESTROY) + Duel.SetTargetCard(dg) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetTargetCards(e) - if g then - Duel.Destroy(g,REASON_EFFECT) + local dg=Duel.GetTargetCards(e) + if #dg>0 then + Duel.Destroy(dg,REASON_EFFECT) end end \ No newline at end of file From 18948bb3f8e9370a204a5af84bd1f1ebe4e81ff3 Mon Sep 17 00:00:00 2001 From: Naim Date: Sat, 3 May 2025 09:11:54 -0300 Subject: [PATCH 17/57] batch8 --- official/c84482694.lua | 44 +++++++++++++++++++----------------------- official/c84813516.lua | 3 ++- official/c85555787.lua | 18 +++++++++-------- official/c85590798.lua | 16 ++++----------- official/c87074380.lua | 15 ++++++++------ official/c8837932.lua | 26 +++++++++++-------------- official/c91392974.lua | 11 ++++++----- official/c91742238.lua | 24 ++++++++++++++--------- official/c9482987.lua | 1 + official/c98452268.lua | 19 +++++++++--------- 10 files changed, 88 insertions(+), 89 deletions(-) diff --git a/official/c84482694.lua b/official/c84482694.lua index 7633b09b7f..5ecca04e8c 100644 --- a/official/c84482694.lua +++ b/official/c84482694.lua @@ -1,10 +1,11 @@ --顕現する紋章 --Charged-Up Heraldry ---Logical Nonsense ---Substitute ID +--scripted by Logical Nonsense local s,id=GetID() function s.initial_effect(c) + --Special Summon 2 "Heraldic Beast" monsters from your Deck in Defense Position local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) @@ -14,33 +15,35 @@ function s.initial_effect(c) e1:SetOperation(s.activate) c:RegisterEffect(e1) end - --Part of "Heraldry" archetype s.listed_series={SET_HERALDIC_BEAST} - --Cost filter -function s.cfilter(c,ft,tp) - return ft>1 or (c:IsControler(tp) and c:GetSequence()<5 and ft>0) +function s.spcheck(sg,tp,exg,dg) + return Duel.GetMZoneCount(tp,sg)>=2 end - --Tribute 1 monster cost function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if chk==0 then return ft>-1 and Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,ft,tp) end - local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,ft,tp) + if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,s.spcheck,nil) end + local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,s.spcheck,nil) Duel.Release(g,REASON_COST) end - --Check for "Heraldic Beast" monster function s.spfilter(c,e,tp) return c:IsSetCard(SET_HERALDIC_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end - --Activation legality function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end - --Special summon 2 "Heraldic Beast" monsters, locked into machine and psychic for extra deck function s.activate(e,tp,eg,ep,ev,re,r,rp) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetDescription(aux.Stringid(id,0)) + if Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp) + if #g==2 then + Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) + end + end + --You cannot Special Summon monsters from the Extra Deck for the rest of this turn after this card resolves, except Psychic or Machine monsters + local c=e:GetHandler() + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) @@ -48,16 +51,9 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - --lizard check - aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp) - if #g==2 then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) - end + --Clock Lizard check + aux.addTempLizardCheck(c,tp,s.lizfilter) end - --Locked into machine and psychic monsters for extra deck function s.splimit(e,c) return not c:IsRace(RACE_MACHINE|RACE_PSYCHIC) and c:IsLocation(LOCATION_EXTRA) end diff --git a/official/c84813516.lua b/official/c84813516.lua index 6b8ec7ef9d..c7aedfca3a 100644 --- a/official/c84813516.lua +++ b/official/c84813516.lua @@ -5,7 +5,7 @@ local s,id=GetID() function s.initial_effect(c) --Special Summon itself from the hand local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,1)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_DAMAGE_STEP_END) @@ -79,6 +79,7 @@ function s.thcond(e,tp,eg,ep,ev,re,r,rp) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE) diff --git a/official/c85555787.lua b/official/c85555787.lua index 07d5bde3b1..ebc5616abd 100644 --- a/official/c85555787.lua +++ b/official/c85555787.lua @@ -5,6 +5,7 @@ local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) @@ -34,20 +35,21 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local atk=e:GetLabel() local ct=math.floor(atk/500) + Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_DECK|LOCATION_HAND,0,ct,ct,nil) - if #g~=0 and Duel.Destroy(g,REASON_EFFECT)~=0 then + if #g>0 and Duel.Destroy(g,REASON_EFFECT)>=0 then local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE) - for oc in aux.Next(og) do + for tc in og:Iter() do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_GRAVE) e1:SetReset(RESET_EVENT|RESETS_STANDARD_EXC_GRAVE|RESET_PHASE|PHASE_END) - oc:RegisterEffect(e1) + tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_ACTIVATE) - oc:RegisterEffect(e2) + tc:RegisterEffect(e2) end end if atk>=2000 then @@ -84,19 +86,19 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) if #hg==0 then return end Duel.ConfirmCards(1-ep,hg) local dg=hg:Filter(Card.IsMonster,nil) - if Duel.Destroy(dg,REASON_EFFECT)~=0 then + if Duel.Destroy(dg,REASON_EFFECT)>0 then local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE) - for oc in aux.Next(og) do + for tc in og:Iter() do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_GRAVE) e1:SetReset(RESET_EVENT|RESETS_STANDARD_EXC_GRAVE|RESET_PHASE|PHASE_END) - oc:RegisterEffect(e1) + tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_ACTIVATE) - oc:RegisterEffect(e2) + tc:RegisterEffect(e2) end end Duel.ShuffleHand(ep) diff --git a/official/c85590798.lua b/official/c85590798.lua index 39efb2b0a6..e54e1ad6d4 100644 --- a/official/c85590798.lua +++ b/official/c85590798.lua @@ -1,7 +1,6 @@ --聖なる降誕 --Starry Knight Ceremony ---Logical Nonsense ---Substitute ID +--scripted by Logical Nonsense local s,id=GetID() function s.initial_effect(c) --Activate @@ -19,7 +18,7 @@ function s.initial_effect(c) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) - --Special summon 1 level 7 LIGHT dragon monster from hand + --Special Summon 1 Level 7 LIGHT Dragon monster from your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) @@ -33,18 +32,15 @@ function s.initial_effect(c) e3:SetOperation(s.spop) c:RegisterEffect(e3) end - --Check for a LIGHT fairy monster function s.cfilter(c) return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() and c:IsAbleToDeck() end - --Check for a level 7 LIGHT dragon monster function s.ldlv7filter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_DRAGON) and c:IsLevel(7) end function s.thfilter(c) return s.ldlv7filter(c) and c:IsAbleToHand() end - --Activation legality function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) @@ -52,13 +48,12 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end - --Reveal 1 LIGHT fairy monster, add 1 level 7 LIGHT dragon monster, place revealed monster on bottom of deck function s.thop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local rc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil) if #rc>0 then Duel.ConfirmCards(1-tp,rc) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #sg>0 and Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then Duel.ConfirmCards(1-tp,sg) @@ -68,19 +63,16 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) end end end - --Check for a level 7 LIGHT dragon monster function s.spfilter(c,e,tp) return s.ldlv7filter(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end - --Activation legality function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end - --Special summon 1 level 7 LIGHT dragon monster from hand function s.spop(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end + if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then diff --git a/official/c87074380.lua b/official/c87074380.lua index d9e245631e..49f28c7261 100644 --- a/official/c87074380.lua +++ b/official/c87074380.lua @@ -11,8 +11,9 @@ function s.initial_effect(c) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(s.splimit) c:RegisterEffect(e1) - --destroy + --Destroy 1 Machine monster you control and all monsters your opponent controls with ATK less than or equal to it local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetHintTiming(TIMINGS_CHECK_MONSTER|TIMING_BATTLE_START) e2:SetType(EFFECT_TYPE_QUICK_O) @@ -23,9 +24,9 @@ function s.initial_effect(c) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) - --special summon + --Special Summon this card from your GY local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,0)) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_DESTROYED) @@ -37,7 +38,7 @@ function s.initial_effect(c) e3:SetOperation(s.spop) c:RegisterEffect(e3) end -s.listed_names={} +s.listed_names={id} function s.splimit(e,se,sp,st) return se:IsHasType(EFFECT_TYPE_ACTIONS) end @@ -49,10 +50,11 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local tc=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst() local dg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,tc:GetAttack()),tp,0,LOCATION_MZONE,nil) dg:AddCard(tc) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,PLAYER_ALL,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() @@ -74,7 +76,8 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) diff --git a/official/c8837932.lua b/official/c8837932.lua index 870555645c..528dde8383 100644 --- a/official/c8837932.lua +++ b/official/c8837932.lua @@ -1,5 +1,6 @@ --方界曼荼羅 --Cubic Mandala +local COUNTER_CUBIC=0x1038 local s,id=GetID() function s.initial_effect(c) --Activate @@ -13,14 +14,14 @@ function s.initial_effect(c) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --disable + --While your opponent controls any of the monsters Summoned by this effect, negate any monster effects your opponent activates local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_CHAIN_ACTIVATING) e2:SetOperation(s.disop) c:RegisterEffect(e2) - --destroy + --When the last of the monsters Summoned by this effect leaves the field, destroy this card local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_SZONE) @@ -29,7 +30,7 @@ function s.initial_effect(c) e3:SetOperation(s.desop) c:RegisterEffect(e3) end -s.counter_place_list={0x1038} +s.counter_place_list={COUNTER_CUBIC} s.listed_series={SET_CUBIC} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_CUBIC),tp,LOCATION_MZONE,0,1,nil) @@ -37,7 +38,7 @@ end function s.spfilter(c,e,tp,tid) return c:IsReason(REASON_DESTROY) and c:IsMonster() and c:GetTurnID()==tid and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) - and Duel.IsCanAddCounter(tp,0x1038,1,c) + and Duel.IsCanAddCounter(tp,COUNTER_CUBIC,1,c) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local tid=Duel.GetTurnCount() @@ -45,8 +46,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp) if chk==0 then return ft>0 and Duel.IsExistingTarget(s.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,tid) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,0,LOCATION_GRAVE,1,ft,nil,e,tp,tid) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0) end @@ -60,8 +61,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) sg=sg:Select(tp,ft,ft,nil) end - local sc=sg:GetFirst() - for sc in aux.Next(sg) do + for sc in sg:Iter() do if Duel.SpecialSummonStep(sc,0,tp,1-tp,false,false,POS_FACEUP) then c:SetCardTarget(sc) local e1=Effect.CreateEffect(c) @@ -74,13 +74,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) end Duel.SpecialSummonComplete() local og=Duel.GetOperatedGroup() - local oc=og:GetFirst() - for oc in aux.Next(og) do - oc:AddCounter(0x1038,1) + for oc in og:Iter() do + oc:AddCounter(COUNTER_CUBIC,1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_ATTACK) - e2:SetCondition(s.disable) + e2:SetCondition(function(e) return e:GetHandler():GetCounter(COUNTER_CUBIC)>0 end) e2:SetReset(RESET_EVENT|RESETS_STANDARD) oc:RegisterEffect(e2) local e3=e2:Clone() @@ -88,15 +87,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) oc:RegisterEffect(e3) end end -function s.disable(e) - return e:GetHandler():GetCounter(0x1038)>0 -end function s.dfilter(c,g) return g:IsContains(c) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetHandler():GetCardTarget() - if re:IsMonsterEffect() and rp~=tp + if re:IsMonsterEffect() and rp==1-tp and Duel.IsExistingMatchingCard(s.dfilter,tp,0,LOCATION_MZONE,1,nil,g) then Duel.NegateEffect(ev) end diff --git a/official/c91392974.lua b/official/c91392974.lua index 2345f9572d..e2b510dd2f 100644 --- a/official/c91392974.lua +++ b/official/c91392974.lua @@ -3,7 +3,7 @@ --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) - --Activate + --Special Summon 1 Level 4 or lower "Vision HERO" monster from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE) @@ -19,27 +19,28 @@ end s.listed_series={SET_VISION_HERO} function s.cfilter(c,tp) return c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) - and c:GetPreviousControler()==tp and c:IsPreviousSetCard(SET_HERO) and c:IsPreviousPosition(POS_FACEUP) + and c:IsPreviousControler(tp) and c:IsPreviousSetCard(SET_HERO) and c:IsPreviousPosition(POS_FACEUP) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end -function s.filter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(SET_VISION_HERO) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) local tc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil):GetFirst() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) diff --git a/official/c91742238.lua b/official/c91742238.lua index b3ce3fc4dc..48cb8135e5 100644 --- a/official/c91742238.lua +++ b/official/c91742238.lua @@ -3,27 +3,28 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Banish 1 zombie monster from field, then controller of it special summons 1 zombie monster from their GY + --Banish 1 Zombie monster on the field, then Special Summon 1 Zombie monster from the GY of the player who controlled it, to their field, in Defense Position local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) + e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.activate) - e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) c:RegisterEffect(e1) - --Set itself from GY + --Shuffle 1 of your banished Zombie monsters into the Deck, and if you do, Set this card local e2=Effect.CreateEffect(c) - e2:SetCategory(CATEGORY_TODECK) e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) + e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.settg) e2:SetOperation(s.setop) - e2:SetHintTiming(0,TIMING_END_PHASE) c:RegisterEffect(e2) end function s.rmfilter(c,e,tp) @@ -41,23 +42,28 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_ALL,LOCATION_GRAVE) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) if not Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp):GetFirst() if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)~=0 then local p=rc:GetPreviousControler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),p,LOCATION_GRAVE,0,1,1,nil,e,tp,p) - if #g>0 then Duel.SpecialSummon(g,0,tp,p,false,false,POS_FACEUP_DEFENSE) end + if #g>0 then + Duel.BreakEffect() + Duel.SpecialSummon(g,0,tp,p,false,false,POS_FACEUP_DEFENSE) + end end end function s.setfilter(c) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsSSetable() + local c=e:GetHandler() + if chk==0 then return c:IsSSetable() and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_REMOVED,0,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() diff --git a/official/c9482987.lua b/official/c9482987.lua index 80351477d2..96cbecdb28 100644 --- a/official/c9482987.lua +++ b/official/c9482987.lua @@ -43,6 +43,7 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local ec=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_EXTRA,0,1,1,nil,SET_MAGISTUS):GetFirst() if ec then Duel.Equip(tp,ec,tc,true) diff --git a/official/c98452268.lua b/official/c98452268.lua index fd6a5c9282..2fdcc938cd 100644 --- a/official/c98452268.lua +++ b/official/c98452268.lua @@ -4,10 +4,13 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() + --You can only Special Summon "Odd-Eyes Rebellion Dragon Overlord(s)" once per turn. c:SetSPSummonOnce(id) + --Xyz Summon Procedure: 2 Level 7 monsters OR 1 "Rebellion" Xyz Monster you control Xyz.AddProcedure(c,nil,7,2,s.ovfilter,aux.Stringid(id,0)) + --Pendulum Summon Procedure Pendulum.AddProcedure(c,false) - --special summon + --Special Summon this card from your Pendulum Zone, then Special Summon from your Extra Deck, 1 "Rebellion" or "The Phantom Knights" monster, using this card as material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -17,12 +20,12 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --multi attack + --This card that was Xyz Summoned using a Rank 7 Xyz Monster as material can make up to 3 attacks during each Battle Phase local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetCondition(s.condition) + e2:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) @@ -31,7 +34,7 @@ function s.initial_effect(c) e3:SetValue(s.valcheck) e3:SetLabelObject(e2) c:RegisterEffect(e3) - --pendulum zone + --Place this card in your Pendulum Zone local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) @@ -42,8 +45,8 @@ function s.initial_effect(c) e4:SetOperation(s.penop) c:RegisterEffect(e4) end -s.listed_names={} s.pendulum_level=7 +s.listed_names={id} s.listed_series={SET_REBELLION,SET_THE_PHANTOM_KNIGHTS} function s.ovfilter(c) return c:IsFaceup() and c:IsSetCard(SET_REBELLION) and c:IsType(TYPE_XYZ) @@ -79,6 +82,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) sc:CompleteProcedure() local xg=Duel.GetFieldGroup(tp,LOCATION_PZONE,0) if #xg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACH) local cd=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_PZONE,0,1,1,nil):GetFirst() Duel.BreakEffect() Duel.Overlay(sc,cd) @@ -91,9 +95,6 @@ end function s.valcheck(e,c) e:GetLabelObject():SetLabel(c:GetMaterial():FilterCount(s.valfilter,nil)) end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():IsXyzSummoned() -end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ct=e:GetLabel() @@ -110,7 +111,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end function s.pencon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return (r&REASON_EFFECT+REASON_BATTLE)~=0 and c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() + return r&(REASON_EFFECT|REASON_BATTLE)>=0 and c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() end function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) end From 42f8f69213bc1bed81deaca38bbe418e91ca3686 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 15:12:38 +0300 Subject: [PATCH 18/57] Update c41373230.lua --- official/c41373230.lua | 129 ++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 72 deletions(-) diff --git a/official/c41373230.lua b/official/c41373230.lua index e7f96c0ffe..abd7a0a31e 100644 --- a/official/c41373230.lua +++ b/official/c41373230.lua @@ -4,105 +4,90 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --Fusion materials: "Fallen of Albaz" + 1 monster with 2500 or more ATK + --Fusion Materials: "Fallen of Albaz" + 1 monster with 2500 or more ATK Fusion.AddProcMix(c,true,true,CARD_ALBAZ,aux.FilterBoolFunctionEx(Card.IsAttackAbove,2500)) - --Verify materials + --Gains ATK equal to the combined original Levels of the monsters used for its Fusion Summon x 100 local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_MATERIAL_CHECK) e1:SetValue(s.valcheck) c:RegisterEffect(e1) - --Increase its ATK by the level of its materials x 100 + --After this card is Fusion Summoned, for the rest of this turn, it is unaffected by the activated effects of any other monsters Special Summoned from the Extra Deck local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetCondition(function(e) return e:GetHandler():IsFusionSummoned() end) - e2:SetOperation(s.atkop) - e2:SetLabelObject(e1) + e2:SetOperation(s.regop) c:RegisterEffect(e2) - --Unaffected by activated effects of monster Special Summoned from the Exra Deck + --Add to your hand, or Special Summon, 1 "Dogmatika" monster or 1 "Fallen of Albaz" from your Deck local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - e3:SetOperation(s.regop) + e3:SetDescription(aux.Stringid(id,0)) + e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_PHASE+PHASE_END) + e3:SetRange(LOCATION_GRAVE) + e3:SetCountLimit(1,id) + e3:SetCondition(function(e) local c=e:GetHandler() return c:GetTurnID()==Duel.GetTurnCount() and not c:IsReason(REASON_RETURN) end) + e3:SetTarget(s.thsptg) + e3:SetOperation(s.thspop) c:RegisterEffect(e3) - --Register effect when it is sent to the GY - local e4=Effect.CreateEffect(c) - e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e4:SetCode(EVENT_TO_GRAVE) - e4:SetOperation(s.regop2) - c:RegisterEffect(e4) end s.listed_names={CARD_ALBAZ} s.listed_series={SET_DOGMATIKA} function s.valcheck(e,c) - e:SetLabel(c:GetMaterial():GetSum(Card.GetOriginalLevel)) -end -function s.atkop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local atk=e:GetLabelObject():GetLabel()*100 - if atk>0 then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(atk) - e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) - c:RegisterEffect(e1) - end + local atk=c:GetMaterial():GetSum(Card.GetOriginalLevel)*100 + if atk==0 then return end + --Gains ATK equal to the combined original Levels of the monsters used for its Fusion Summon x 100 + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(atk) + e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE&~RESET_TOFIELD) + c:RegisterEffect(e1) end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsFusionSummoned() then return end - --Unaffected by the activated effects of any other monsters Special Summoned from the Extra Deck + --After this card is Fusion Summoned, for the rest of this turn, it is unaffected by the activated effects of any other monsters Special Summoned from the Extra Deck local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e1:SetRange(LOCATION_MZONE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_IMMUNE_EFFECT) - e1:SetValue(s.efilter) + e1:SetValue(s.immval) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end -function s.efilter(e,te) - local tc=te:GetOwner() - return tc:IsSpecialSummoned() and tc:IsSummonLocation(LOCATION_EXTRA) and tc~=e:GetHandler() - and te:IsMonsterEffect() and te:IsActivated() and te:GetActivateLocation()==LOCATION_MZONE +function s.immval(e,te) + local tc=te:GetHandler() + local trig_loc,trig_sum_loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SUMMON_LOCATION) + if not (te:IsActivated() and te:IsMonsterEffect() and trig_loc==LOCATION_MZONE and tc~=e:GetHandler()) then return false end + if not Duel.IsChainSolving() or (tc:IsRelateToEffect(te) and tc:IsFaceup() and tc:IsLocation(trig_loc)) then + return tc:IsSummonLocation(LOCATION_EXTRA) + else + return trig_sum_loc&LOCATION_EXTRA>0 + end end -function s.regop2(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local e1=Effect.CreateEffect(c) - --Add to hand or Special Summom 1 "Dogmatika" monster or "Fallen of Albaz" - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_PHASE+PHASE_END) - e1:SetRange(LOCATION_GRAVE) - e1:SetCountLimit(1,id) - e1:SetTarget(s.thtg) - e1:SetOperation(s.thop) - e1:SetReset(RESETS_STANDARD_PHASE_END) - c:RegisterEffect(e1) +function s.thspfilter(c,e,tp,mmz_chk) + return (c:IsSetCard(SET_DOGMATIKA) or c:IsCode(CARD_ALBAZ)) and c:IsMonster() and (c:IsAbleToHand() + or (mmz_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) end -function s.thfilter(c,e,tp,ft) - return c:IsMonster() and (c:IsSetCard(SET_DOGMATIKA) or c:IsCode(CARD_ALBAZ)) - and (c:IsAbleToHand() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0)) +function s.thsptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)>0) end + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ft) end - Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +function s.thspop(e,tp,eg,ep,ev,re,r,rp) + local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) + local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mmz_chk):GetFirst() + if not sc then return end + aux.ToHandOrElse(sc,tp, + function() + return mmz_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) + end, + function() + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) + end, + aux.Stringid(id,3) + ) end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) - local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft):GetFirst() - if tc then - aux.ToHandOrElse(tc,tp,function(c) - return tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0 end, - function(c) - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end, - aux.Stringid(id,2)) - end -end \ No newline at end of file From 9b4b42f3e732541e2c9f17ce22f9b3d3be403849 Mon Sep 17 00:00:00 2001 From: Naim Date: Sat, 3 May 2025 09:14:26 -0300 Subject: [PATCH 19/57] fix --- official/c72498838.lua | 2 +- official/c84482694.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/official/c72498838.lua b/official/c72498838.lua index 0ed5356e74..a4a76e8755 100644 --- a/official/c72498838.lua +++ b/official/c72498838.lua @@ -48,7 +48,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if op==1 then e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) - elseif op==2 + elseif op==2 then local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_REMOVED,0,nil) e:SetCategory(CATEGORY_TOGRAVE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0) diff --git a/official/c84482694.lua b/official/c84482694.lua index 5ecca04e8c..f3ece55008 100644 --- a/official/c84482694.lua +++ b/official/c84482694.lua @@ -33,7 +33,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - if Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then + if Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp) if #g==2 then From 26a323b3215041ab30ed06adfc96df643672d6a3 Mon Sep 17 00:00:00 2001 From: Naim Date: Sat, 3 May 2025 09:15:55 -0300 Subject: [PATCH 20/57] missing keyword --- official/c72498838.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/official/c72498838.lua b/official/c72498838.lua index a4a76e8755..687a416133 100644 --- a/official/c72498838.lua +++ b/official/c72498838.lua @@ -64,7 +64,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end - elseif op==2 + elseif op==2 then --Return 1 of your banished Level 4 or lower Spellcaster monsters to your GY Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOGRAVE) local tg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil) From 644d732c840d682d0a91d3f00709ed00283ae3f0 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 15:17:23 +0300 Subject: [PATCH 21/57] Update c41373230.lua --- official/c41373230.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/official/c41373230.lua b/official/c41373230.lua index abd7a0a31e..7240ca7d2d 100644 --- a/official/c41373230.lua +++ b/official/c41373230.lua @@ -82,12 +82,8 @@ function s.thspop(e,tp,eg,ep,ev,re,r,rp) local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mmz_chk):GetFirst() if not sc then return end aux.ToHandOrElse(sc,tp, - function() - return mmz_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) - end, - function() - Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) - end, + function() return mmz_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, + function() Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, aux.Stringid(id,3) ) end From 94f204d0cdc3b559b8de22cde4da5b0f4e384526 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 15:35:10 +0300 Subject: [PATCH 22/57] Update c30114823.lua --- official/c30114823.lua | 55 ++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/official/c30114823.lua b/official/c30114823.lua index 739c294ca7..7b64c2acaa 100644 --- a/official/c30114823.lua +++ b/official/c30114823.lua @@ -5,11 +5,10 @@ local s,id=GetID() function s.initial_effect(c) --If a Cyberse monster you control would be used as Link Material for a "Code Talker" monster, this card in your hand can also be used as material local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetRange(LOCATION_HAND) - e1:SetCode(EFFECT_EXTRA_MATERIAL) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) + e1:SetCode(EFFECT_EXTRA_MATERIAL) + e1:SetRange(LOCATION_HAND) e1:SetTargetRange(1,0) e1:SetOperation(s.extracon) e1:SetValue(s.extraval) @@ -20,9 +19,9 @@ function s.initial_effect(c) if s.flagmap[c]==nil then s.flagmap[c] = {} end - --Send OR Add to your hand 1 Cyberse monster with 1200 or less ATK from your Deck to the GY + --Send 1 Cyberse monster with 1200 or less ATK from your Deck to the GY, or, if this card on the field was used as material, you can add that card to your hand instead local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,1)) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) @@ -38,17 +37,13 @@ function s.extrafilter(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) end function s.extracon(c,e,tp,sg,mg,lc,og,chk) - return (sg+mg):Filter(s.extrafilter,nil,e:GetHandlerPlayer()):IsExists(Card.IsRace,1,og,RACE_CYBERSE) and - sg:FilterCount(s.flagcheck,nil)<2 -end -function s.flagcheck(c) - return c:GetFlagEffect(id)>0 + return (sg+mg):Filter(s.extrafilter,nil,e:GetHandlerPlayer()):IsExists(Card.IsRace,1,og,RACE_CYBERSE) and sg:FilterCount(Card.HasFlagEffect,nil,id)<2 end function s.extraval(chk,summon_type,e,...) local c=e:GetHandler() if chk==0 then local tp,sc=... - if summon_type~=SUMMON_TYPE_LINK or not sc:IsSetCard(SET_CODE_TALKER) or Duel.GetFlagEffect(tp,id)>0 then + if summon_type~=SUMMON_TYPE_LINK or not sc:IsSetCard(SET_CODE_TALKER) or Duel.HasFlagEffect(tp,id) then return Group.CreateGroup() else table.insert(s.flagmap[c],c:RegisterFlagEffect(id,0,0,1)) @@ -56,7 +51,7 @@ function s.extraval(chk,summon_type,e,...) end elseif chk==1 then local sg,sc,tp=... - if summon_type&SUMMON_TYPE_LINK == SUMMON_TYPE_LINK and #sg>0 then + if summon_type&SUMMON_TYPE_LINK==SUMMON_TYPE_LINK and #sg>0 then Duel.Hint(HINT_CARD,tp,id) Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end @@ -69,29 +64,27 @@ function s.extraval(chk,summon_type,e,...) end function s.tgcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - e:SetLabel(0) - if c:IsPreviousLocation(LOCATION_ONFIELD) then e:SetLabel(1) end - return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD|LOCATION_HAND) - and r==REASON_LINK and c:GetReasonCard():IsSetCard(SET_CODE_TALKER) + return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_HAND|LOCATION_ONFIELD) and r==REASON_LINK and c:GetReasonCard():IsSetCard(SET_CODE_TALKER) end -function s.tgfilter(c,chk) - return c:IsRace(RACE_CYBERSE) and c:IsAttackBelow(1200) and (c:IsAbleToGrave() or (chk==1 and c:IsAbleToHand())) +function s.tgfilter(c,tohand_chk) + return c:IsRace(RACE_CYBERSE) and c:IsAttackBelow(1200) and (c:IsAbleToGrave() or (tohand_chk==1 and c:IsAbleToHand())) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,e:GetLabel()) end - Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) - Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) + local tohand_chk=e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) + if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,tohand_chk) end + e:SetLabel(tohand_chk and 1 or 0) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) - local hint_msg=(e:GetLabel()==1 and aux.Stringid(id,2) or HINTMSG_SPSUMMON) + local tohand_chk=e:GetLabel()==1 + local hint_msg=(tohand_chk and aux.Stringid(id,1) or HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,hint_msg) - local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel()):GetFirst() - if tc then - if e:GetLabel()==1 and tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectYesNo(tp,aux.Stringid(id,3))) then - Duel.SendtoHand(tc,nil,REASON_EFFECT) - Duel.ConfirmCards(1-tp,tc) - else - Duel.SendtoGrave(tc,REASON_EFFECT) - end + local sc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel()):GetFirst() + if not sc then return end + if tohand_chk then + aux.ToHandOrElse(sc,tp) + else + Duel.SendtoGrave(sc,REASON_EFFECT) end -end \ No newline at end of file +end From 3d6c08c671853b1523c47f701d85188b44087aa6 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 15:36:58 +0300 Subject: [PATCH 23/57] Update c30114823.lua --- official/c30114823.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/official/c30114823.lua b/official/c30114823.lua index 7b64c2acaa..c5a969eeff 100644 --- a/official/c30114823.lua +++ b/official/c30114823.lua @@ -73,8 +73,12 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) local tohand_chk=e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,tohand_chk) end e:SetLabel(tohand_chk and 1 or 0) - Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) - Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + if not tohand_chk then + Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) + else + Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + end end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tohand_chk=e:GetLabel()==1 From 5bb5f79cdf5e6aff65a2c5461064a534d4c0c65a Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 19:16:23 +0300 Subject: [PATCH 24/57] Update c48032131.lua --- official/c48032131.lua | 45 ++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/official/c48032131.lua b/official/c48032131.lua index 03fde55ef7..e55ffda061 100644 --- a/official/c48032131.lua +++ b/official/c48032131.lua @@ -7,17 +7,17 @@ function s.initial_effect(c) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) - e0:SetHintTiming(0,TIMING_STANDBY_PHASE) c:RegisterEffect(e0) - --"HERO" monsters you control gain 400 ATK + --Make all "HERO" monsters you control gain 400 ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) - e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e1:SetCode(EVENT_PHASE|PHASE_STANDBY) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_SZONE) - e1:SetHintTiming(0,TIMING_STANDBY_PHASE) e1:SetCountLimit(1,id) + e1:SetHintTiming(TIMING_STANDBY_PHASE) + e1:SetCondition(function() return Duel.IsPhase(PHASE_STANDBY) end) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) @@ -39,8 +39,8 @@ function s.initial_effect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_DESTROYED) e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,{id,2}) e3:SetCondition(s.thcon) e3:SetTarget(s.thtg) @@ -49,42 +49,39 @@ function s.initial_effect(c) end s.listed_series={SET_HERO,SET_DESTINY_HERO} s.listed_names={76263644} --"Destiny End Dragoon" -function s.atkfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_HERO) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) - local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil) + local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_HERO),tp,LOCATION_MZONE,0,nil) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,400) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil) + local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_HERO),tp,LOCATION_MZONE,0,nil) if #g==0 then return end + local c=e:GetHandler() for sc in g:Iter() do - local e1=Effect.CreateEffect(e:GetHandler()) + --All "HERO" monsters you control gain 400 ATK + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(400) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) end end -function s.cfilter(c,tp) - return c:IsFaceup() and ((c:IsLevelAbove(8) and c:IsSetCard(SET_DESTINY_HERO)) or c:IsCode(76263644)) and c:IsControler(tp) +function s.rmconfilter(c,tp) + return ((c:IsLevelAbove(8) and c:IsSetCard(SET_DESTINY_HERO)) or c:IsCode(76263644)) and c:IsControler(tp) and c:IsFaceup() end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.cfilter,1,nil,tp) + return eg:IsExists(s.rmconfilter,1,nil,tp) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) - local loc=LOCATION_ONFIELD|LOCATION_GRAVE|LOCATION_HAND - if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,loc,1,nil) end - local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,loc,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0) + if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) - local loc=LOCATION_ONFIELD|LOCATION_GRAVE|LOCATION_HAND Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,loc,1,1,nil) + local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE,1,1,nil) if #g>0 then Duel.HintSelection(g) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) @@ -92,7 +89,7 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_SZONE) + return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_STZONE) end function s.thfilter(c) return c:IsSetCard(SET_DESTINY_HERO) and c:IsMonster() and c:IsAbleToHand() @@ -108,4 +105,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end -end \ No newline at end of file +end From f4dfba4897a42c0426c5aad2d108eb296ff5a793 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 19:54:35 +0300 Subject: [PATCH 25/57] Update c37750912.lua --- official/c37750912.lua | 75 +++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/official/c37750912.lua b/official/c37750912.lua index dae026899f..d6fb4c66fd 100644 --- a/official/c37750912.lua +++ b/official/c37750912.lua @@ -13,12 +13,12 @@ function s.initial_effect(c) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) c:RegisterEffect(e1) - --Increase or decrease the Level of a "Stardust" monster you control by 1 + --Increase or decrease the Level of 1 "Stardust" monster you control by 1 until the end of this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_LVCHANGE) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) @@ -28,32 +28,44 @@ function s.initial_effect(c) end s.listed_names={CARD_STARDUST_DRAGON} s.listed_series={SET_STARDUST} -function s.ssfilter(c) - return c:IsFaceup() and (c:IsCode(CARD_STARDUST_DRAGON) or (c:ListsCode(CARD_STARDUST_DRAGON) and c:IsType(TYPE_SYNCHRO))) +function s.spconfilter(c) + return (c:IsCode(CARD_STARDUST_DRAGON) or (c:ListsCode(CARD_STARDUST_DRAGON) and c:IsType(TYPE_SYNCHRO) and c:IsMonster())) and c:IsFaceup() end -function s.tgfilter(c,e,tp,ss,mz) - return c:IsMonster() and c:IsSetCard(SET_STARDUST) and (c:IsAbleToGrave() or (ss and mz and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) +function s.tgfilter(c,e,tp,stardust_mzone_chk) + return c:IsSetCard(SET_STARDUST) and c:IsMonster() and (c:IsAbleToGrave() or (stardust_mzone_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) - local ss,mz=Duel.IsExistingMatchingCard(s.ssfilter,tp,LOCATION_MZONE,0,1,nil),Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ss,mz) end + if chk==0 then + local stardust_mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_ONFIELD,0,1,nil) + return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,e,tp,stardust_mzone_chk) + end Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) - local ss,mz=Duel.IsExistingMatchingCard(s.ssfilter,tp,LOCATION_MZONE,0,1,nil),Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) - local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ss,mz) - if #g>0 then - if ss and mz and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then - Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) - else - Duel.SendtoGrave(g,REASON_EFFECT) - end + local stardust_mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_ONFIELD,0,1,nil) + local hintmsg=stardust_mzone_chk and aux.Stringid(id,2) or HINTMSG_TOGRAVE + Duel.Hint(HINT_SELECTMSG,tp,hintmsg) + local sc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,stardust_mzone_chk):GetFirst() + if not sc then return end + local op=1 + if stardust_mzone_chk then + local b1=sc:IsAbleToGrave() + local b2=sc:IsCanBeSpecialSummoned(e,0,tp,false,false) + op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,3)}, + {b2,aux.Stringid(id,4)}) + end + if op==1 then + Duel.SendtoGrave(sc,REASON_EFFECT) + elseif op==2 then + Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end end function s.lvfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_STARDUST) and c:IsMonster() and c:HasLevel() + return c:IsSetCard(SET_STARDUST) and c:HasLevel() and c:IsFaceup() end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end @@ -63,20 +75,17 @@ function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,tc,1,tp,1) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() local tc=Duel.GetFirstTarget() - if not tc:IsRelateToEffect(e) then return end - local choice=-1 - if tc:IsLevelAbove(2) then - choice=Duel.SelectOption(tp,aux.Stringid(id,4),aux.Stringid(id,5)) - else - choice=Duel.SelectOption(tp,aux.Stringid(id,4)) + if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:HasLevel() then + local op=tc:IsLevelAbove(2) and Duel.SelectOption(tp,aux.Stringid(id,5),aux.Stringid(id,6)) or 0 + local lv=op==0 and 1 or -1 + --Increase or decrease its Level by 1 until the end of this turn + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_UPDATE_LEVEL) + e1:SetValue(lv) + e1:SetReset(RESETS_STANDARD_PHASE_END) + tc:RegisterEffect(e1) end - --Change Level - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_LEVEL) - e1:SetReset(RESETS_STANDARD_PHASE_END) - e1:SetValue(1-(choice*2)) - tc:RegisterEffect(e1) -end \ No newline at end of file +end From eecd02e1b8bd3cc31f39e59a95bf021f09a2d7e3 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 20:48:13 +0300 Subject: [PATCH 26/57] Update c38694052.lua --- official/c38694052.lua | 58 +++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/official/c38694052.lua b/official/c38694052.lua index 5fadfbbfb2..f2f903a63a 100644 --- a/official/c38694052.lua +++ b/official/c38694052.lua @@ -6,73 +6,63 @@ function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon procedure: 2 Level 7 monsters Xyz.AddProcedure(c,nil,7,2) - --Destroy 1 face-up card on the field it, and if you destroyed a monster, you can make 1 face-up monster you control gain ATK equal to the destroyed monster's original Level/Rank x 300 + --Destroy 1 face-up card on the field, and if you destroyed a monster, you can make 1 face-up monster you control gain ATK equal to the destroyed monster's original Level/Rank x 300 until the end of the next turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetCountLimit(1) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) - e1:SetCondition(s.condition1) - e1:SetCost(s.cost) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) + e1:SetCondition(function(e) return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_DRAGON) end) + e1:SetCost(Cost.AND(Cost.Detach(2),s.descost)) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT) --This is a Quick Effect if this card has a Dragon monster as material local e2=e1:Clone() e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) - e2:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMINGS_CHECK_MONSTER_E) - e2:SetCondition(s.condition2) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e2:SetCondition(function(e) return e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_DRAGON) end) c:RegisterEffect(e2) end -function s.condition1(e,tp,eg,ep,ev,re,r,rp) - return not e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_DRAGON) -end -function s.condition2(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_DRAGON) - and aux.StatChangeDamageStepCondition() -end -function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) +function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return c:GetAttackAnnouncedCount()==0 and c:CheckRemoveOverlayCard(tp,2,REASON_COST) - and c:GetFlagEffect(id)==0 end - --Cannot attack this turn + if chk==0 then return c:GetAttackAnnouncedCount()==0 end + --This card cannot attack the turn you activate this effect local e1=Effect.CreateEffect(c) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESETS_STANDARD_PHASE_END) - c:RegisterEffect(e1,true) - c:RemoveOverlayCard(tp,2,2,REASON_COST) - c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) + c:RegisterEffect(e1) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and tc:IsPreviousLocation(LOCATION_MZONE) - and (tc:GetOriginalLevel()>0 or tc:GetOriginalRank()>0) - and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) + and (tc:HasLevel() or tc:HasRank()) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then - local lv=math.max(tc:GetOriginalLevel(),tc:GetOriginalRank()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) local sc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() - Duel.HintSelection(sg) - --Increase its ATK by the destroyed monster's original Level/Rank x 300 + if not sc then return end + Duel.HintSelection(sc) + local lvrk=math.max(tc:GetOriginalLevel(),tc:GetOriginalRank()) + --It gains ATK equal to the destroyed monster's original Level/Rank x 300 until the end of the next turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(lv*300) + e1:SetValue(lvrk*300) e1:SetReset(RESETS_STANDARD_PHASE_END,2) sc:RegisterEffect(e1) end -end \ No newline at end of file +end From 8cd62b10494441caab07bba48621f9b529ba7552 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 21:51:01 +0300 Subject: [PATCH 27/57] Update c66809920.lua - Missing target flag - Check that re is a Spell effect rather than the card being a Spell - Should also check face-up for other "Valkyrie" monsters - ATK change should reset on negate and be negatable --- official/c66809920.lua | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/official/c66809920.lua b/official/c66809920.lua index 1c38bcc837..bd0914393a 100644 --- a/official/c66809920.lua +++ b/official/c66809920.lua @@ -3,19 +3,19 @@ --scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --Add 1 "Mischief of the Time Goddess" from your Gy to your hand + --Add 1 "Mischief of the Time Goddess" from your GY to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) - e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) - e1:SetCondition(s.thcon) + e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:IsSpellEffect() and e:GetHandler():IsSummonLocation(LOCATION_HAND) end) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) - --Banish 1 monster from your opponent's GY, then this card's ATK becomes equal to the banished monster's original ATK + --Banish 1 monster from your opponent's GY, then this card's ATK becomes equal to the banished monster's original ATK until the end of this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE) @@ -23,16 +23,14 @@ function s.initial_effect(c) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCondition(s.rmcon) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) end s.listed_series={SET_VALKYRIE} -s.listed_names={92182447} --"Mischief of the Time Goddess" -function s.thcon(e,tp,eg,ep,ev,re,r,rp) - return re and re:GetHandler():IsSpell() and e:GetHandler():IsPreviousLocation(LOCATION_HAND) -end +s.listed_names={92182447,id} --"Mischief of the Time Goddess" function s.thfilter(c) return c:IsCode(92182447) and c:IsAbleToHand() end @@ -49,33 +47,34 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(tc,nil,REASON_EFFECT) end end -function s.cfilter(c) - return c:IsSetCard(SET_VALKYRIE) and not c:IsCode(id) +function s.rmconfilter(c) + return c:IsSetCard(SET_VALKYRIE) and c:IsFaceup() and not c:IsCode(id) end function s.rmcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) + return Duel.IsExistingMatchingCard(s.rmconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.rmfilter(c) return c:IsAbleToRemove() and c:IsMonster() end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_GRAVE,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,1,nil):GetFirst() - if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then + local sc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,1,nil):GetFirst() + if not sc then return end + Duel.HintSelection(sc) + local c=e:GetHandler() + if Duel.Remove(sc,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then Duel.BreakEffect() - --Tis card's ATK becomes equal to the banished monster's original ATK + --This card's ATK becomes equal to the banished monster's original ATK until the end of this turn local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetCode(EFFECT_SET_ATTACK) - e1:SetValue(rc:GetBaseAttack()) + e1:SetValue(sc:GetBaseAttack()) + e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) c:RegisterEffect(e1) end -end \ No newline at end of file +end From 9ff6a22627edbff835a590ebfbf75291b9a44349 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 3 May 2025 22:53:34 +0300 Subject: [PATCH 28/57] Blackbeard, the Plunder Patroll Captain - Missing chkc handling - Missing draw opinfo --- official/c67647362.lua | 56 +++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/official/c67647362.lua b/official/c67647362.lua index 34c120b93a..c80d1f2b79 100644 --- a/official/c67647362.lua +++ b/official/c67647362.lua @@ -3,11 +3,10 @@ --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Link summon procedure - Link.AddProcedure(c,nil,2,2,s.lcheck) - --Special summon 1 "Plunder Patroll" monster from extra deck + --Link Summon procedure: 2 monsters including a "Plunder Patroll" monster + Link.AddProcedure(c,nil,2,2,s.matcheck) + --Special Summon 1 "Plunder Patroll" monster from your Extra Deck with the same Attribute as a monster your opponent controls or is in their GY, and if you do, equip that target to it, then draw 1 card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP+CATEGORY_DRAW) @@ -15,61 +14,46 @@ function s.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_PLUNDER_PATROLL} -function s.lcheck(g,lc,sumtype,tp) +function s.matcheck(g,lc,sumtype,tp) return g:IsExists(Card.IsSetCard,1,nil,SET_PLUNDER_PATROLL,lc,sumtype,tp) end -function s.filter(c,e,tp,att) - return c:IsSetCard(SET_PLUNDER_PATROLL) and c:IsAttribute(att) - and c:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 +function s.spfilter(c,e,tp,att) + return c:IsSetCard(SET_PLUNDER_PATROLL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 + and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,c:GetAttribute()),tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end -function s.cfilter(c) - return c:IsMonster() and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) -end -function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) - local att=0 - for gc in aux.Next(Duel.GetMatchingGroup(s.cfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,nil)) do - att=att|gc:GetAttribute() - end - if chk==0 then return att>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsType(TYPE_EFFECT) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,LOCATION_MZONE,0,1,nil) - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,att) - and Duel.IsPlayerCanDraw(tp,1) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,tp,0) + Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.spop(e,tp,eg,ep,ev,re,r,rp) - local att=0 - for gc in aux.Next(Duel.GetMatchingGroup(s.cfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,nil)) do - att=att|gc:GetAttribute() - end - if att==0 then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local sc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,att):GetFirst() - if not sc or Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)<1 then return end local tc=Duel.GetFirstTarget() - if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) - and tc:IsControler(tp) and Duel.Equip(tp,tc,sc,true) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() + if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) + and tc:IsControler(tp) and Duel.Equip(tp,tc,sc) then + --Equip limit local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetValue(function(e,c) return c==sc end) e1:SetReset(RESET_EVENT|RESETS_STANDARD) - e1:SetValue(s.eqlimit) - e1:SetLabelObject(sc) tc:RegisterEffect(e1) Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end -function s.eqlimit(e,c) - return c==e:GetLabelObject() -end \ No newline at end of file From afdcf39f7ce1ffe42320ea7398b40abd4ee2e383 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 4 May 2025 01:09:52 +0300 Subject: [PATCH 29/57] Decode Talker Heatsoul - Missing possible opinfos - Added more hint timings --- official/c61245672.lua | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/official/c61245672.lua b/official/c61245672.lua index 02e4873c3b..35ef1007be 100644 --- a/official/c61245672.lua +++ b/official/c61245672.lua @@ -4,53 +4,53 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure: 2+ Cyberse monsters with different Attributes - Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_CYBERSE),2,99,s.lcheck) + Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_CYBERSE),2,99,s.matcheck) --Gains 500 ATK for each monster it points to local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) - e1:SetValue(s.atkval) + e1:SetValue(function(e,c) return c:GetLinkedGroup():FilterCount(Card.IsMonster,nil)*500 end) c:RegisterEffect(e1) - --Draw 1 card, then banish this card from the field, and if you do, Special Summon 1 Link-3 or lower Cyberse monster from your Extra Deck, except "Decode Talker Heatsoul" + --Draw 1 card, then if your LP are 2000 or less, you can apply this effect: ● Banish this card from the field, and if you do, Special Summon 1 Link-3 or lower Cyberse monster from your Extra Deck, except "Decode Talker Heatsoul" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) - e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1,id) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCost(Cost.PayLP(1000)) - e2:SetTarget(s.target) - e2:SetOperation(s.operation) + e2:SetTarget(s.drtg) + e2:SetOperation(s.drop) c:RegisterEffect(e2) end s.listed_names={id} -function s.lcheck(g,lc,sumtype,tp) +function s.matcheck(g,lc,sumtype,tp) return g:CheckDifferentPropertyBinary(Card.GetAttribute,lc,sumtype,tp) end -function s.atkval(e,c) - return c:GetLinkedGroup():FilterCount(Card.IsMonster,nil)*500 -end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spfilter(c,e,tp,mc) - return c:IsRace(RACE_CYBERSE) and c:IsLinkBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and not c:IsCode(id) + return c:IsLinkBelow(3) and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id) + and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.drop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.Draw(p,d,REASON_EFFECT)>0 and Duel.GetLP(tp)<=2000 and c:IsRelateToEffect(e) and c:IsAbleToRemove() - and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) + and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() - if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 then + if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) if #g>0 then @@ -58,4 +58,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) end end end -end \ No newline at end of file +end From 40aeb37bcd9ed783151fb652b8ef0094a3fe7319 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 4 May 2025 01:27:59 +0300 Subject: [PATCH 30/57] Orcustrated Core - Can't use a 2nd Orcustrated Core to apply the effect on a card that already has the effect applied to it - Use a table for checking multiple archetypes --- official/c55051920.lua | 89 +++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/official/c55051920.lua b/official/c55051920.lua index dc499a02ba..b0661c9731 100644 --- a/official/c55051920.lua +++ b/official/c55051920.lua @@ -4,84 +4,75 @@ local s,id=GetID() function s.initial_effect(c) --Activate + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_ACTIVATE) + e0:SetCode(EVENT_FREE_CHAIN) + c:RegisterEffect(e0) + --Neither player can target 1 "Orcust" or "World Legacy" card you control with card effects this turn local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(0,TIMING_END_PHASE) + e1:SetRange(LOCATION_SZONE) + e1:SetCountLimit(1) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMINGS_CHECK_MONSTER) + e1:SetCost(s.effcost) + e1:SetTarget(s.efftg) + e1:SetOperation(s.effop) c:RegisterEffect(e1) - --Neither player can target 1 "Orcust" or "World Legacy" card you control with card effects this turn + --If other "Orcust" and/or "World Legacy" card(s) you control would be destroyed by battle or card effect, you can send this card to the GY instead local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetType(EFFECT_TYPE_QUICK_O) - e2:SetCode(EVENT_FREE_CHAIN) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_SZONE) - e2:SetCountLimit(1) - e2:SetCost(s.immcost) - e2:SetTarget(s.immtg) - e2:SetOperation(s.immop) + e2:SetTarget(s.reptg) + e2:SetValue(function(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end) + e2:SetOperation(function(e) Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT|REASON_REPLACE) end) c:RegisterEffect(e2) - --Substitute destruction for an "Orcust" or "World Legacy" card(s) - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) - e3:SetCode(EFFECT_DESTROY_REPLACE) - e3:SetRange(LOCATION_SZONE) - e3:SetTarget(s.reptg) - e3:SetValue(s.repval) - e3:SetOperation(s.repop) - c:RegisterEffect(e3) end s.listed_series={SET_ORCUST,SET_WORLD_LEGACY} s.listed_names={id} -function s.cfilter(c,tp) +function s.effcostfilter(c,tp) return c:IsAbleToRemoveAsCost() and c:IsMonster() and aux.SpElimFilter(c,false,true) - and Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,0,1,c) + and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_ONFIELD,0,1,c) end -function s.filter(c) - return c:IsFaceup() and c:IsSetCard({SET_ORCUST,SET_WORLD_LEGACY}) and not c:IsCode(id) +function s.tgfilter(c) + return c:IsSetCard({SET_ORCUST,SET_WORLD_LEGACY}) and c:IsFaceup() and not c:IsCode(id) and not c:HasFlagEffect(id) end -function s.immcost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end +function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.effcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp) + local g=Duel.SelectMatchingCard(tp,s.effcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp) Duel.Remove(g,POS_FACEUP,REASON_COST) end -function s.immtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,0,1,nil) end +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.tgfilter(chkc) end + if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO) - Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,0,1,1,nil) + Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil) end -function s.immop(e,tp,eg,ep,ev,re,r,rp) +function s.effop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then + tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) --Neither player can target it with card effects this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3002) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) - e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(1) + e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end function s.repfilter(c,tp) - return c:IsFaceup() and (c:IsSetCard(SET_ORCUST) or c:IsSetCard(SET_WORLD_LEGACY)) and c:IsOnField() - and c:IsControler(tp) and c:IsReason(REASON_EFFECT|REASON_BATTLE) and not c:IsReason(REASON_REPLACE) + return c:IsSetCard({SET_ORCUST,SET_WORLD_LEGACY}) and c:IsOnField() and c:IsControler(tp) and c:IsFaceup() + and c:IsReason(REASON_BATTLE|REASON_EFFECT) and not c:IsReason(REASON_REPLACE) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return e:GetHandler():IsAbleToGrave() and not eg:IsContains(e:GetHandler()) - and eg:IsExists(s.repfilter,1,e:GetHandler(),tp) end - if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then - return true - else - return false - end -end -function s.repval(e,c) - return s.repfilter(c,e:GetHandlerPlayer()) + local c=e:GetHandler() + if chk==0 then return c:IsAbleToGrave() and not eg:IsContains(c) and eg:IsExists(s.repfilter,1,nil,tp) end + return Duel.SelectEffectYesNo(tp,c,96) end -function s.repop(e,tp,eg,ep,ev,re,r,rp) - Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT) -end \ No newline at end of file From 202c4256331381af843921306b303d4527b499ce Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 4 May 2025 02:23:23 +0300 Subject: [PATCH 31/57] Vendread Daybreak Shouldn't destroy itself if it's still related --- official/c60375194.lua | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/official/c60375194.lua b/official/c60375194.lua index 3874ffc536..bb37a2ed1d 100644 --- a/official/c60375194.lua +++ b/official/c60375194.lua @@ -3,45 +3,45 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Destroy all cards on the field, except the targeted "Vendread" ritual monster + --Choose 1 Ritual Summoned "Vendread" monster you control, and destroy all cards on the field, except the chosen monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) - e1:SetCondition(s.condition) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0) end) e1:SetTarget(s.target) e1:SetOperation(s.activate) - e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) c:RegisterEffect(e1) end s.listed_series={SET_VENDREAD} -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0) -end -function s.filter(c) - return c:IsFaceup() and c:IsSetCard(SET_VENDREAD) and c:IsRitualSummoned() +function s.vendreadfilter(c) + return c:IsRitualSummoned() and c:IsSetCard(SET_VENDREAD) and c:IsFaceup() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end + if chk==0 then return Duel.IsExistingMatchingCard(s.vendreadfilter,tp,LOCATION_MZONE,0,1,nil) end local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,0,0,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g-2,tp,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) - if #g==0 then return end - Duel.HintSelection(g) - local dg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,g) - if #dg~=0 then - Duel.Destroy(dg,REASON_EFFECT) + local sc=Duel.SelectMatchingCard(tp,s.vendreadfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() + if not sc then return end + Duel.HintSelection(sc) + local c=e:GetHandler() + local exc=c:IsRelateToEffect(e) and Group.FromCards(sc,c) or sc + local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,exc) + if #g>0 then + Duel.Destroy(g,REASON_EFFECT) end - --It cannot attack directly - local e1=Effect.CreateEffect(e:GetHandler()) + --It cannot attack directly while it remains face-up on the field + local e1=Effect.CreateEffect(c) e1:SetDescription(3207) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD) - g:GetFirst():RegisterEffect(e1) -end \ No newline at end of file + sc:RegisterEffect(e1) +end From 38fd48ffb06891f2254facdc3aec87bff18e1756 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 5 May 2025 01:32:31 +0300 Subject: [PATCH 32/57] Escape of the Unchained - Use "Card.IsCanBeEffectTarget" - The "Unchained" monster also needs to be face-up --- official/c53417695.lua | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/official/c53417695.lua b/official/c53417695.lua index 3fd8a10916..2d61fa4e5b 100644 --- a/official/c53417695.lua +++ b/official/c53417695.lua @@ -3,15 +3,15 @@ --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --Destroy 1 "Unchained" monster you control and 1 card on the field + --Destroy both 1 "Unchained" monster you control and 1 card on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) + e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) @@ -20,8 +20,8 @@ function s.initial_effect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) @@ -29,23 +29,19 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.listed_series={SET_UNCHAINED} -function s.desfilter(c,tp,oc) - return c:IsFaceup() and c:IsSetCard(SET_UNCHAINED) and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,Group.FromCards(c,oc)) -end -function s.unchainedfilter(c,tp) - return c:IsSetCard(SET_UNCHAINED) and c:IsMonster() and c:IsControler(tp) +function s.resconfilter(c,tp) + return c:IsSetCard(SET_UNCHAINED) and c:IsMonster() and c:IsControler(tp) and c:IsFaceup() end function s.rescon(sg,e,tp,mg) - return sg:IsExists(s.unchainedfilter,1,nil,tp) + return sg:IsExists(s.resconfilter,1,nil,tp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() if chkc then return false end - if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) end - local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) + local g=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),e) + if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_DESTROY) Duel.SetTargetCard(tg) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,#tg,tp,0) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,2,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) @@ -72,4 +68,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end From f3444e008c28a0b78d130ad5ff15dfe5d9bde4da Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 5 May 2025 01:51:58 +0300 Subject: [PATCH 33/57] Tri-Brigade Rugal the Silver Sheller - Use "Card.NegateEffects" and "aux.DelayedOperation" --- official/c52331012.lua | 81 +++++++++++++----------------------------- 1 file changed, 25 insertions(+), 56 deletions(-) diff --git a/official/c52331012.lua b/official/c52331012.lua index 2677eaad34..41b7254edd 100644 --- a/official/c52331012.lua +++ b/official/c52331012.lua @@ -5,103 +5,72 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure: 2+ Beast, Beast-Warrior, and/or Winged Beast monsters - Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACES_BEAST_BWARRIOR_WINGB),2,3) - --Special Summon 1 Level 4 or lower Beast, Beast-Warrior, or Winged Beast monster from your hand or GY + Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACES_BEAST_BWARRIOR_WINGB),2) + --Special Summon 1 Level 4 or lower Beast, Beast-Warrior, or Winged Beast monster from your hand or GY, but negate its effects, also, return it to the hand during the End Phase local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_QUICK_O) - e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) - e1:SetHintTiming(0,TIMING_MAIN_END) - e1:SetCondition(s.spcon) + e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) + e1:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and Duel.IsMainPhase() end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Make all monsters your opponent currently controls lose 300 ATK for each Monster Type you control + --Make all monsters your opponent currently controls lose 300 ATK for each Monster Type you control, until the end of this turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) + e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end -function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsMainPhase() and Duel.IsTurnPlayer(1-tp) -end function s.spfilter(c,e,tp) - return c:IsLevelBelow(4) and c:IsRace(RACES_BEAST_BWARRIOR_WINGB) and c:IsMonster() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp) + return c:IsLevelBelow(4) and c:IsRace(RACES_BEAST_BWARRIOR_WINGB) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) - and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() - local c=e:GetHandler() if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_DISABLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - sc:RegisterEffect(e1,true) - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_DISABLE_EFFECT) - e2:SetReset(RESET_EVENT|RESETS_STANDARD) - sc:RegisterEffect(e2,true) - local fid=c:GetFieldID() - sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid) - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,2)) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) - e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - e3:SetCode(EVENT_PHASE+PHASE_END) - e3:SetCountLimit(1) - e3:SetLabel(fid) - e3:SetLabelObject(sc) - e3:SetCondition(s.thcon) - e3:SetOperation(s.thop) - Duel.RegisterEffect(e3,tp) + --Negate its effects + sc:NegateEffects(e:GetHandler()) + --Return it to the hand during the End Phase + aux.DelayedOperation(sc,PHASE_END,id,e,tp,function(ag) Duel.SendtoHand(ag,nil,REASON_EFFECT) end,nil,0,0,aux.Stringid(id,2)) end Duel.SpecialSummonComplete() end -function s.thcon(e,tp,eg,ep,ev,re,r,rp) - local tc=e:GetLabelObject() - if tc:GetFlagEffectLabel(id)~=e:GetLabel() then - e:Reset() - return false - else - return true - end -end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT) -end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,nil,0,0,LOCATION_MZONE) + Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,nil,1,1-tp,LOCATION_MZONE) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) if #g==0 then return end - local ct=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetRace) + local c=e:GetHandler() + local val=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetRace)*-300 + if val==0 then return end for tc in g:Iter() do - local e1=Effect.CreateEffect(e:GetHandler()) + --All monsters your opponent currently controls lose 300 ATK for each Monster Type you control, until the end of this turn + local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetValue(-300*ct) + e1:SetValue(val) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end -end \ No newline at end of file +end From b450c122a9b5c9603fbffa50fc3899db6a19f58c Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 5 May 2025 15:55:17 +0300 Subject: [PATCH 34/57] Defender of Nephthys Simplify the resolution check and the destroy register logic a bit --- official/c51782995.lua | 90 ++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 55 deletions(-) diff --git a/official/c51782995.lua b/official/c51782995.lua index a0a8d541ed..c735c41e62 100644 --- a/official/c51782995.lua +++ b/official/c51782995.lua @@ -2,7 +2,7 @@ --Defender of Nephthys local s,id=GetID() function s.initial_effect(c) - --Destroy 1 card in your hand, and if you do, Special Summon 1 Level 4 or lower "Nephthys" monster from your hand, except "Defender of Nephthys + --Destroy 1 card in your hand, and if you do, Special Summon 1 Level 4 or lower "Nephthys" monster from your hand, except "Defender of Nephthys" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) @@ -12,83 +12,63 @@ function s.initial_effect(c) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Register when this card is destroyed by card effect and sent to the GY - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e2:SetCode(EVENT_TO_GRAVE) - e2:SetOperation(s.regop) - c:RegisterEffect(e2) + --Register when this card is destroyed + local e2a=Effect.CreateEffect(c) + e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e2a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e2a:SetCode(EVENT_DESTROYED) + e2a:SetOperation(function(e,tp) local ct=(Duel.IsTurnPlayer(tp) and Duel.IsPhase(PHASE_STANDBY)) and 2 or 1 e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,0,ct,ct) end) + c:RegisterEffect(e2a) --Destroy 1 "Nephthys" monster in your Deck, except "Defender of Nephthys" - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetCategory(CATEGORY_DESTROY) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_PHASE|PHASE_STANDBY) - e3:SetRange(LOCATION_GRAVE) - e3:SetCountLimit(1,{id,1}) - e3:SetCondition(s.descon) - e3:SetTarget(s.destg) - e3:SetOperation(s.desop) - e3:SetLabelObject(e2) - c:RegisterEffect(e3) + local e2b=Effect.CreateEffect(c) + e2b:SetDescription(aux.Stringid(id,1)) + e2b:SetCategory(CATEGORY_DESTROY) + e2b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2b:SetCode(EVENT_PHASE+PHASE_STANDBY) + e2b:SetRange(LOCATION_GRAVE) + e2b:SetCountLimit(1,{id,1}) + e2b:SetCondition(function(e,tp) local c=e:GetHandler() return Duel.IsTurnPlayer(tp) and c:IsReason(REASON_EFFECT) and c:HasFlagEffect(id) and (c:GetFlagEffectLabel(id)==1 or c:GetTurnID()~=Duel.GetTurnCount()) end) + e2b:SetTarget(s.destg) + e2b:SetOperation(s.desop) + c:RegisterEffect(e2b) end s.listed_series={SET_NEPHTHYS} s.listed_names={id} -function s.spfilter(c,e,tp) - return c:IsSetCard(SET_NEPHTHYS) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id) +function s.handdesfilter(c,e,tp,res_chk) + return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,c,e,tp) or res_chk end -function s.filter(c,e,tp,chk,sp) - return ((chk==0 or sp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,c,e,tp)) - or (chk==1 and not sp) +function s.spfilter(c,e,tp) + return c:IsLevelBelow(4) and c:IsSetCard(SET_NEPHTHYS) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp,0) end + and Duel.IsExistingMatchingCard(s.handdesfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) - local sp=Duel.GetMatchingGroupCount(nil,tp,LOCATION_HAND,0,nil)>1 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) + local res_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsExistingMatchingCard(s.handdesfilter,tp,LOCATION_HAND,0,1,nil,e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,1,sp) - if #g==0 then return end - if Duel.Destroy(g,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then + local g=Duel.SelectMatchingCard(tp,s.handdesfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,res_chk) + if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() - if sc then - Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) + local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) + if #sg>0 then + Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end end -function s.regop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - if (r&(REASON_DESTROY|REASON_EFFECT)~=(REASON_DESTROY|REASON_EFFECT)) then return end - if Duel.IsTurnPlayer(tp) and Duel.IsPhase(PHASE_STANDBY) then - e:SetLabel(Duel.GetTurnCount()) - c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,0,2) - else - e:SetLabel(0) - c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,0,1) - end -end -function s.descon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and Duel.IsTurnPlayer(tp) and c:GetFlagEffect(id)>0 -end -function s.desfilter(c) +function s.deckdesfilter(c) return c:IsSetCard(SET_NEPHTHYS) and c:IsMonster() and not c:IsCode(id) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_DECK,0,1,nil) end - e:GetHandler():ResetFlagEffect(id) - local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_DECK,0,nil) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) + if chk==0 then return Duel.IsExistingMatchingCard(s.deckdesfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_DECK) end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.deckdesfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end -end \ No newline at end of file +end From 477d2ab5c8cd5292f00234ef629b0de0ad0b3466 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 5 May 2025 21:18:56 +0300 Subject: [PATCH 35/57] Breaking of the World - Missing category - Strings - Show a card on resolution, not on activation - Check that the target is still face-up on resolution - Modern "activate 1 of these effects" implementation --- official/c69217334.lua | 135 +++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/official/c69217334.lua b/official/c69217334.lua index f8000d1ee1..7c46eeb5e9 100644 --- a/official/c69217334.lua +++ b/official/c69217334.lua @@ -4,102 +4,107 @@ local s,id=GetID() function s.initial_effect(c) --Activate + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_ACTIVATE) + e0:SetCode(EVENT_FREE_CHAIN) + c:RegisterEffect(e0) + --Make the Level of 1 Ritual Monster in your hand become the Level of 1 Ritual Monster you control local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_LVCHANGE) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetRange(LOCATION_FZONE) + e1:SetCountLimit(1) + e1:SetTarget(s.lvtg) + e1:SetOperation(s.lvop) c:RegisterEffect(e1) - --Change the level of Ritual monster + --Activate 1 of these effects local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetType(EFFECT_TYPE_IGNITION) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1) - e2:SetTarget(s.lvtg) - e2:SetOperation(s.lvop) + e2:SetCondition(s.effcon) + e2:SetTarget(s.efftg) + e2:SetOperation(s.effop) c:RegisterEffect(e2) - --Draw 1 card or destroy 1 card on the field - local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_SPSUMMON_SUCCESS) - e3:SetProperty(EFFECT_FLAG_DELAY) - e3:SetRange(LOCATION_FZONE) - e3:SetCountLimit(1) - e3:SetCondition(s.condition) - e3:SetTarget(s.target) - c:RegisterEffect(e3) end s.listed_names={46427957,72426662} --"Ruin, Queen of Oblivion", "Demise, King of Armageddon" -function s.lvfilter(c,tp) - return c:IsFaceup() and c:IsType(TYPE_RITUAL) - and Duel.IsExistingMatchingCard(s.lvcfilter,tp,LOCATION_HAND,0,1,nil,c) +function s.tgfilter(c,tp) + return c:IsRitualMonster() and c:IsFaceup() and Duel.IsExistingMatchingCard(s.revealfilter,tp,LOCATION_HAND,0,1,nil,c:GetLevel()) end -function s.lvcfilter(c,mc) - return c:IsRitualMonster() and not c:IsPublic() and not c:IsLevel(mc:GetLevel()) +function s.revealfilter(c,lv) + return c:IsRitualMonster() and not c:IsPublic() and not c:IsLevel(lv) end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc,tp) end - if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil,tp) end + if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.tgfilter(chkc,tp) end + if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) - local g=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) - local cg=Duel.SelectMatchingCard(tp,s.lvcfilter,tp,LOCATION_HAND,0,1,1,nil,g:GetFirst()) - Duel.ConfirmCards(1-tp,cg) - Duel.ShuffleHand(tp) - e:SetLabelObject(cg:GetFirst()) + Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - local pc=e:GetLabelObject() - if tc:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) and tc:IsFaceup() then + local lv=tc:GetLevel() + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) + local sc=Duel.SelectMatchingCard(tp,s.revealfilter,tp,LOCATION_HAND,0,1,1,nil,lv):GetFirst() + if not sc then return end + --Show it until the end of this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_CHANGE_LEVEL) - e1:SetValue(tc:GetLevel()) + e1:SetCode(EFFECT_PUBLIC) e1:SetReset(RESETS_STANDARD_PHASE_END) - pc:RegisterEffect(e1) - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_SINGLE) - e2:SetCode(EFFECT_PUBLIC) - e2:SetReset(RESETS_STANDARD_PHASE_END) - pc:RegisterEffect(e2) + sc:RegisterEffect(e1) + --The Level of the shown Ritual Monster becomes the targeted monster's Level, until the end of this turn + local e2=e1:Clone() + e2:SetCode(EFFECT_CHANGE_LEVEL) + e2:SetValue(lv) + sc:RegisterEffect(e2) end end -function s.cfilter(c,tp) - return c:IsCode(46427957,72426662) and c:IsControler(tp) and c:IsRitualSummoned() +function s.effconfilter(c,tp) + return c:IsCode(46427957,72426662) and c:IsRitualSummoned() and c:IsControler(tp) and c:IsFaceup() end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.cfilter,1,nil,tp) +function s.effcon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.effconfilter,1,nil,tp) end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.IsPlayerCanDraw(tp,1) - local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) + local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD) local b2=#g>0 if chk==0 then return b1 or b2 end - local sel=Duel.SelectEffect(tp, - {b1,aux.Stringid(id,0)}, - {b2,aux.Stringid(id,1)}) - if sel==1 then + local op=Duel.SelectEffect(tp, + {b1,aux.Stringid(id,2)}, + {b2,aux.Stringid(id,3)}) + e:SetLabel(op) + if op==1 then e:SetCategory(CATEGORY_DRAW) e:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) - e:SetOperation(s.drop) Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) - else + elseif op==2 then e:SetCategory(CATEGORY_DESTROY) - e:SetOperation(s.desop) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) + e:SetProperty(EFFECT_FLAG_DELAY) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end end -function s.drop(e,tp,eg,ep,ev,re,r,rp) - local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) - Duel.Draw(p,d,REASON_EFFECT) -end -function s.desop(e,tp,eg,ep,ev,re,r,rp) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) - if #g>0 then - Duel.Destroy(g,REASON_EFFECT) +function s.effop(e,tp,eg,ep,ev,re,r,rp) + local op=e:GetLabel() + if op==1 then + --Draw 1 card + local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) + Duel.Draw(p,d,REASON_EFFECT) + elseif op==2 then + --Destroy 1 card on the field + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.Destroy(g,REASON_EFFECT) + end end -end \ No newline at end of file +end From 16cc1faadd0abd4f848bf037366dc64c28844225 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 5 May 2025 22:06:12 +0300 Subject: [PATCH 36/57] Deep Sea Prima Donna Simplifications --- official/c50793215.lua | 110 +++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 60 deletions(-) diff --git a/official/c50793215.lua b/official/c50793215.lua index d9b880cc0c..1fe81d5b97 100644 --- a/official/c50793215.lua +++ b/official/c50793215.lua @@ -3,91 +3,81 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Must be properly summoned before reviving c:EnableReviveLimit() - --Synchro summon procedure + --Synchro Summon procedure: 1 Tuner + 1+ non-Tuner monsters Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) - --Take 1 level 4 or lower WATER monster from deck, and either special summon it or add it to hand + --Your opponent cannot target a Synchro Monster that used this card as material with monster effects local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) - e1:SetType(EFFECT_TYPE_IGNITION) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e1:SetCode(EVENT_BE_MATERIAL) + e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return r==REASON_SYNCHRO end) + e1:SetOperation(s.effop) c:RegisterEffect(e1) - --A synchro monster using this card cannot be targeted by opponent's monster effects + --Add to your hand, or Special Summon, 1 Level 4 or lower WATER monster from your Deck, and if you do, add 1 of your opponent's banished cards to their hand local e2=Effect.CreateEffect(c) - e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e2:SetCode(EVENT_BE_MATERIAL) - e2:SetCondition(s.indcon) - e2:SetOperation(s.indop) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1,id) + e2:SetTarget(s.thsptg) + e2:SetOperation(s.thspop) c:RegisterEffect(e2) --If sent to GY, shuffle 1 banished card into deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) + e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) end -function s.filter(c,e,tp,lc) - return c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(4) - and (c:IsAbleToHand() or (lc>0 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 chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_REMOVED) and chkc:IsAbleToHand() end - if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_REMOVED,1,nil) - and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) - local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_REMOVED,1,1,nil) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) - Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local tc=Duel.GetFirstTarget() - Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) - local hc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)):GetFirst() - if hc and aux.ToHandOrElse(hc,tp,s.spcheck(e,tp),s.spop(tp),aux.Stringid(id,3))~=0 and tc:IsRelateToEffect(e) then - Duel.SendtoHand(tc,nil,REASON_EFFECT) - end -end -function s.spcheck(e,tp) - return function(c) - return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - end -end -function s.spop(tp) - return function(c) - return Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) - end -end -function s.indcon(e,tp,eg,ep,ev,re,r,rp) - return r==REASON_SYNCHRO -end -function s.indop(e,tp,eg,ep,ev,re,r,rp) +function s.effop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() - --Cannot be targeted by opponent's monster effects + --Your opponent cannot target a Synchro Monster that used this card as material with monster effects local e1=Effect.CreateEffect(c) e1:SetDescription(3062) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) - e1:SetValue(s.efilter) + e1:SetValue(function(e,re,rp) return re:IsMonsterEffect() and rp==1-e:GetHandlerPlayer() end) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1) end -function s.efilter(e,re,rp) - return re:IsMonsterEffect() and e:GetHandlerPlayer()~=rp +function s.thspfilter(c,e,tp,mzone_chk) + return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WATER) and (c:IsAbleToHand() + or (mzone_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) +end +function s.thsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_REMOVED) and chkc:IsAbleToHand() end + if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_REMOVED,1,nil) + and Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)>0) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) + local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_REMOVED,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) + Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) +end +function s.thspop(e,tp,eg,ep,ev,re,r,rp) + local mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) + local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mzone_chk):GetFirst() + if not sc then return end + local tc=Duel.GetFirstTarget() + local hand_or_ss_chk=aux.ToHandOrElse(sc,tp, + function() return mzone_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, + function() return Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, + aux.Stringid(id,3) + ) + if hand_or_ss_chk and tc:IsRelateToEffect(e) then + Duel.SendtoHand(tc,nil,REASON_EFFECT) + end end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsAbleToDeck() end @@ -101,4 +91,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) if tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end -end \ No newline at end of file +end From 78197d272d46ff9533effb4033ba6b76e43a4d17 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 5 May 2025 22:09:54 +0300 Subject: [PATCH 37/57] Update c50793215.lua --- official/c50793215.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/official/c50793215.lua b/official/c50793215.lua index 1fe81d5b97..fac0782a1f 100644 --- a/official/c50793215.lua +++ b/official/c50793215.lua @@ -69,13 +69,13 @@ function s.thspop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mzone_chk):GetFirst() if not sc then return end - local tc=Duel.GetFirstTarget() - local hand_or_ss_chk=aux.ToHandOrElse(sc,tp, + local tohand_or_ss_chk=aux.ToHandOrElse(sc,tp, function() return mzone_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, function() return Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, aux.Stringid(id,3) ) - if hand_or_ss_chk and tc:IsRelateToEffect(e) then + local tc=Duel.GetFirstTarget() + if tohand_or_ss_chk and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end From 35709ce6d9951365f4dfa30b25e326754c073cd4 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Mon, 5 May 2025 22:45:46 +0300 Subject: [PATCH 38/57] Appliancer Test General modernisation + hint on the summoned monsters --- official/c66380357.lua | 76 +++++++++++------------------------------- 1 file changed, 20 insertions(+), 56 deletions(-) diff --git a/official/c66380357.lua b/official/c66380357.lua index a51c76eb03..750921a1c3 100644 --- a/official/c66380357.lua +++ b/official/c66380357.lua @@ -3,12 +3,12 @@ --Anime version scripted by pyrQ, updated by Larry126 local s,id=GetID() function s.initial_effect(c) - --Activate + --Special Summon as many Link-1 "Appliancer" monsters from your GY as possible to your zones 1 "Appliancer" Link Monster you control points to, but banish them during the End Phase local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) - e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) @@ -16,67 +16,31 @@ function s.initial_effect(c) c:RegisterEffect(e1) end s.listed_series={SET_APPLIANCER} -function s.filter(c,e,tp) - return c:IsSetCard(SET_APPLIANCER) and c:IsLinkMonster() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c) +function s.tgfilter(c,e,tp) + return c:IsSetCard(SET_APPLIANCER) and c:IsLinkMonster() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c:GetFreeLinkedZone()) end -function s.spfilter(c,e,tp,fc) - local zone=fc:GetFreeLinkedZone()&ZONES_MMZ - return c:IsSetCard(SET_APPLIANCER) and c:IsLinkMonster() and c:IsLink(1) - and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) +function s.spfilter(c,e,tp,zone) + return c:IsLink(1) and c:IsSetCard(SET_APPLIANCER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end + and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) - local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp,g:GetFirst()) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,1,0,LOCATION_GRAVE) + Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - local fid=e:GetHandler():GetFieldID() local tc=Duel.GetFirstTarget() - local zone=tc:GetFreeLinkedZone()&ZONES_MMZ - local count=s.zone_count(zone) - local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp,tc) - if #sg0 and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP,zone) then - sc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1,fid) - end - end - end - Duel.SpecialSummonComplete() - --banish them during this End Phase - 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:SetLabel(fid) - e1:SetOperation(s.rmop) - e1:SetReset(RESET_PHASE|PHASE_END) - e1:SetCountLimit(1) - Duel.RegisterEffect(e1,tp) + if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end + local zone=tc:GetFreeLinkedZone() + local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone) + if not (zone>0 and ft>0) then return end + if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,ft,ft,nil,e,tp,zone) + if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone)>0 then + --Banish them during the End Phase + aux.DelayedOperation(g,PHASE_END,id,e,tp,function(ag) Duel.Remove(ag,POS_FACEUP,REASON_EFFECT) end,nil,nil,nil,aux.Stringid(id,1)) end end -function s.rmfilter(c,e) - return c:GetFlagEffectLabel(id)==e:GetLabel() -end -function s.rmop(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE,0,nil,e) - if #g>0 then Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end -end -function s.zone_count(z) - local c=0 - while z>0 do - c=c+1 - z=z&(z-1) - end - return c -end \ No newline at end of file From 55e8f7ab945692ef314560d9cfc9865ac7d8f5b5 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Tue, 6 May 2025 00:43:16 +0300 Subject: [PATCH 39/57] Fortune Lady Every - CATEGORY_LVCHANGE - lvtg - Should activate even if she's already Level 12 or higher - Yes/No string - Missing space after "return" --- official/c70252926.lua | 115 ++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 58 deletions(-) diff --git a/official/c70252926.lua b/official/c70252926.lua index fb4cec36c6..15fd383899 100644 --- a/official/c70252926.lua +++ b/official/c70252926.lua @@ -6,80 +6,79 @@ function s.initial_effect(c) --Synchro Summon procedure: 1 Tuner + 1+ non-Tuner Spellcaster monsters Synchro.AddProcedure(c,nil,1,1,Synchro.NonTunerEx(Card.IsRace,RACE_SPELLCASTER),1,99) --This card's ATK/DEF become its Level x 400 - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) - e1:SetRange(LOCATION_MZONE) - e1:SetCode(EFFECT_SET_ATTACK) - e1:SetValue(function(e,c) return c:GetLevel()*400 end) - c:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EFFECT_SET_DEFENSE) - c:RegisterEffect(e2) + local e1a=Effect.CreateEffect(c) + e1a:SetType(EFFECT_TYPE_SINGLE) + e1a:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1a:SetCode(EFFECT_SET_ATTACK) + e1a:SetRange(LOCATION_MZONE) + e1a:SetValue(function(e,c) return c:GetLevel()*400 end) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EFFECT_SET_DEFENSE) + c:RegisterEffect(e1b) --Increase this card's Level by 1 (max. 12), then, you can banish 1 face-up monster your opponent controls + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,0)) + e2:SetCategory(CATEGORY_LVCHANGE+CATEGORY_REMOVE) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetCode(EVENT_PHASE+PHASE_STANDBY) + e2:SetRange(LOCATION_MZONE) + e2:SetCountLimit(1) + e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(tp) end) + e2:SetTarget(s.lvtg) + e2:SetOperation(s.lvop) + c:RegisterEffect(e2) + --Special Summon this card local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,0)) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) - e3:SetCategory(CATEGORY_REMOVE) - e3:SetRange(LOCATION_MZONE) - e3:SetCountLimit(1) - e3:SetCode(EVENT_PHASE|PHASE_STANDBY) - e3:SetCondition(s.lvcon) - e3:SetOperation(s.lvop) + e3:SetDescription(aux.Stringid(id,1)) + e3:SetCategory(CATEGORY_SPECIAL_SUMMON) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e3:SetCode(EVENT_PHASE+PHASE_END) + e3:SetRange(LOCATION_GRAVE) + e3:SetCountLimit(1,id) + e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end) + e3:SetCost(s.spcost) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) c:RegisterEffect(e3) - --Special Summon this card from the GY - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,1)) - e4:SetCategory(CATEGORY_SPECIAL_SUMMON) - e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e4:SetCode(EVENT_PHASE+PHASE_END) - e4:SetRange(LOCATION_GRAVE) - e4:SetCountLimit(1,id) - e4:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end) - e4:SetCost(s.spcost) - e4:SetTarget(s.sptg) - e4:SetOperation(s.spop) - c:RegisterEffect(e4) end -function s.lvcon(e,tp,eg,ep,ev,re,r,rp) - return Duel.IsTurnPlayer(tp) and e:GetHandler():IsLevelAbove(1) and e:GetHandler():IsLevelBelow(11) +function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,e:GetHandler(),1,tp,1) + Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_MZONE) end function s.filter(c) return c:IsMonster() and c:IsFaceup() and c:IsAbleToRemove() end -function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return true end - local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) - if #g>0 then - Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) - end -end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - local lvl=c:GetLevel() - if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsLevelAbove(12) then return end - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_LEVEL) - e1:SetValue(1) - e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) - c:RegisterEffect(e1) - local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_MZONE,nil) - if c:GetLevel()==lvl+1 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local rg=g:Select(tp,1,1,nil) - if #rg>0 then - Duel.BreakEffect() - Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) + if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsLevelBelow(11) then + local prev_lv=c:GetLevel() + --Increase this card's Level by 1 + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_LEVEL) + e1:SetValue(1) + e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) + c:RegisterEffect(e1) + if c:IsLevel(prev_lv+1) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAbleToRemove),tp,0,LOCATION_MZONE,1,nil) + and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsAbleToRemove),tp,0,LOCATION_MZONE,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.BreakEffect() + Duel.Remove(g,POS_FACEUP,REASON_EFFECT) + end end end end function s.spcostfilter(c) - return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_SPELLCASTER) + return c:IsRace(RACE_SPELLCASTER) and c:IsAbleToRemoveAsCost() end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then returnDuel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_GRAVE,0,1,c) end + if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_GRAVE,0,1,1,c) Duel.Remove(g,POS_FACEUP,REASON_COST) @@ -95,4 +94,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end From 3c5523163d3ec9cbd4dbdb4d1ac856870a404672 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Tue, 6 May 2025 00:45:42 +0300 Subject: [PATCH 40/57] Delete unused filter --- official/c70252926.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/official/c70252926.lua b/official/c70252926.lua index 15fd383899..362f0b700a 100644 --- a/official/c70252926.lua +++ b/official/c70252926.lua @@ -47,9 +47,6 @@ function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,e:GetHandler(),1,tp,1) Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_MZONE) end -function s.filter(c) - return c:IsMonster() and c:IsFaceup() and c:IsAbleToRemove() -end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsLevelBelow(11) then From 92d6c4666f25dcbfc95fe28327ada6b70ea5aa13 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Tue, 6 May 2025 02:18:19 +0300 Subject: [PATCH 41/57] Despian Quaeritis The ATK change itself should be unnegatable --- official/c72272462.lua | 57 ++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/official/c72272462.lua b/official/c72272462.lua index 56a82db47d..b5d3a765ee 100644 --- a/official/c72272462.lua +++ b/official/c72272462.lua @@ -3,17 +3,18 @@ --scripted by Rundas local s,id=GetID() function s.initial_effect(c) - Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_DESPIA),s.matfilter) c:EnableReviveLimit() - --Change the ATK of all monsters currently on the field to 0, except Level 8 or higher Fusion Monsters + --Fusion Materials: 1 "Despia" monster + 1 LIGHT or DARK monster + Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_DESPIA),aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_LIGHT|ATTRIBUTE_DARK)) + --Change the ATK of all monsters currently on the field to 0 until the end of this turn, except Level 8 or higher Fusion Monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER) e1:SetCondition(function() return Duel.IsMainPhase() end) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) @@ -26,61 +27,57 @@ function s.initial_effect(c) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCountLimit(1,{id,1}) - e2:SetCondition(s.thcon) - e2:SetTarget(s.thtg) - e2:SetOperation(s.thop) + e2:SetCondition(s.thspcon) + e2:SetTarget(s.thsptg) + e2:SetOperation(s.thspop) c:RegisterEffect(e2) end s.listed_series={SET_DESPIA} s.listed_names={CARD_ALBAZ} -function s.matfilter(c,fc,st,tp) - return c:IsAttribute(ATTRIBUTE_LIGHT,fc,st,tp) or c:IsAttribute(ATTRIBUTE_DARK,fc,st,tp) -end function s.atkfilter(c) - return c:IsFaceup() and c:GetAttack()>0 and not (c:IsType(TYPE_FUSION) and c:IsLevelAbove(8)) + return c:HasNonZeroAttack() and not (c:IsLevelAbove(8) and c:IsType(TYPE_FUSION)) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if chk==0 then return #g>0 end - Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,PLAYER_ALL,LOCATION_MZONE) + Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,0) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #g==0 then return end local c=e:GetHandler() for tc in g:Iter() do - --Change the ATK to 0 until the end of this turn + --Their ATK becomes 0 until the end of this turn local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(0) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end -function s.thcon(e,tp,eg,ep,ev,re,r,rp) +function s.thspcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) end -function s.thfilter(c,e,tp,ft) - return ((c:IsSetCard(SET_DESPIA) and c:IsMonster()) or c:IsCode(CARD_ALBAZ)) - and (c:IsAbleToHand() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0)) +function s.thspfilter(c,e,tp,mzone_chk) + return (c:IsSetCard(SET_DESPIA) or c:IsCode(CARD_ALBAZ)) and c:IsMonster() and (c:IsAbleToHand() + or (mzone_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) - if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,ft) end +function s.thsptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.thspfilter,tp,LOCATION_DECK,0,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)>0) end Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end -function s.thop(e,tp,eg,ep,ev,re,r,rp) - local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) +function s.thspop(e,tp,eg,ep,ev,re,r,rp) + local mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) - local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft):GetFirst() - if tc then - aux.ToHandOrElse(tc,tp,function(c) - return tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and ft>0 end, - function(c) - Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end, - aux.Stringid(id,3)) - end -end \ No newline at end of file + local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mzone_chk):GetFirst() + if not sc then return end + aux.ToHandOrElse(sc,tp, + function() return mzone_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, + function() Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, + aux.Stringid(id,3) + ) +end From b26a5c3572c442a072842355c97f07254e053188 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Tue, 6 May 2025 13:46:18 +0300 Subject: [PATCH 42/57] Super Quantal Alphan Spike - Check that at least 1 card ended up in the Main or Extra Deck - Check for an available zone to summon from the Extra Deck --- official/c72332074.lua | 55 ++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/official/c72332074.lua b/official/c72332074.lua index c22407b3ee..1cefc5c602 100644 --- a/official/c72332074.lua +++ b/official/c72332074.lua @@ -2,13 +2,13 @@ --Super Quantal Alphan Spike local s,id=GetID() function s.initial_effect(c) - --Shuffle as many cards your opponent controls as possible into the Deck, then your opponent Special Summons 1 monster from their Extra Deck + --Shuffle as many cards your opponent controls as possible into the Deck, then your opponent Special Summons 1 monster from their Extra Deck, ignoring its Summoning conditions local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK) + e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetCondition(s.condition) + e1:SetCondition(function(e,tp) return Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_SUPER_QUANTUM),tp,LOCATION_MZONE,0,nil):GetClassCount(Card.GetCode)>=3 end) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) @@ -24,47 +24,36 @@ function s.initial_effect(c) end s.listed_series={SET_SUPER_QUANTUM} s.listed_names={58753372,10424147} --"Super Quantal Fairy Alphan", "Super Quantal Mech Ship Magnacarrier" -function s.cfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_SUPER_QUANTUM) -end -function s.condition(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,nil) - return g:GetClassCount(Card.GetCode)>=3 -end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) and Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>0 and Duel.IsPlayerCanSpecialSummon(1-tp) end - local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil) - Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0) + Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_ONFIELD) end -function s.spfilter(c,e,tp) - return c:IsMonster() and c:IsCanBeSpecialSummoned(e,0,tp,true,false) +function s.spfilter(c,e,opp) + return c:IsMonster() and Duel.GetLocationCountFromEx(opp,opp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,opp,true,false) end function s.activate(e,tp,eg,ep,ev,re,r,rp) + local opp=1-tp local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil) - if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 - and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(s.spfilter,1-tp,LOCATION_EXTRA,0,1,nil,e,1-tp) then - Duel.BreakEffect() - Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(1-tp,s.spfilter,1-tp,LOCATION_EXTRA,0,1,1,nil,e,1-tp) - local tc=g:GetFirst() - if tc then - Duel.SpecialSummon(tc,0,1-tp,1-tp,true,false,POS_FACEUP) + if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and Duel.GetOperatedGroup():IsExists(Card.IsLocation,1,nil,LOCATION_DECK|LOCATION_EXTRA) then + Duel.Hint(HINT_SELECTMSG,opp,HINTMSG_SPSUMMON) + local sg=Duel.SelectMatchingCard(opp,s.spfilter,opp,LOCATION_EXTRA,0,1,1,nil,e,opp) + if #sg>0 then + Duel.BreakEffect() + Duel.SpecialSummon(sg,0,opp,opp,true,false,POS_FACEUP) end end end -function s.costfilter(c) +function s.actcostfilter(c) return c:IsCode(58753372) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.actcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return Cost.SelfBanish(e,tp,eg,ep,ev,re,r,rp,0) - and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,c) end + if chk==0 then return c:IsAbleToRemoveAsCost() + and Duel.IsExistingMatchingCard(s.actcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,c) - g:AddCard(c) - Duel.Remove(g,POS_FACEUP,REASON_COST) + local g=Duel.SelectMatchingCard(tp,s.actcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,c) + Duel.Remove(g+c,POS_FACEUP,REASON_COST) end function s.actfilter(c,tp) return c:IsCode(10424147) and c:GetActivateEffect():IsActivatable(tp,true,true) @@ -74,6 +63,8 @@ function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk) end function s.actop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) - local tc=Duel.SelectMatchingCard(tp,s.actfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() - Duel.ActivateFieldSpell(tc,e,tp,eg,ep,ev,re,r,rp) -end \ No newline at end of file + local sc=Duel.SelectMatchingCard(tp,s.actfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() + if sc then + Duel.ActivateFieldSpell(sc,e,tp,eg,ep,ev,re,r,rp) + end +end From 8670fe1d566c743164b748152ba24a982361dd13 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Tue, 6 May 2025 14:11:21 +0300 Subject: [PATCH 43/57] Rilliona, the Magistus of Verre - Filter name typo - Cannot disable equip limit --- official/c72498838.lua | 110 +++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 58 deletions(-) diff --git a/official/c72498838.lua b/official/c72498838.lua index 687a416133..ab20b403b6 100644 --- a/official/c72498838.lua +++ b/official/c72498838.lua @@ -4,62 +4,59 @@ local s,id=GetID() function s.initial_effect(c) --Activate 1 of these effects - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,0)) - e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e1:SetProperty(EFFECT_FLAG_DELAY) - e1:SetCode(EVENT_SUMMON_SUCCESS) - e1:SetCountLimit(1,id) - e1:SetTarget(s.target) - e1:SetOperation(s.operation) - c:RegisterEffect(e1) - local e2=e1:Clone() - e2:SetCode(EVENT_SPSUMMON_SUCCESS) + local e1a=Effect.CreateEffect(c) + e1a:SetDescription(aux.Stringid(id,0)) + e1a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1a:SetProperty(EFFECT_FLAG_DELAY) + e1a:SetCode(EVENT_SUMMON_SUCCESS) + e1a:SetCountLimit(1,id) + e1a:SetTarget(s.efftg) + e1a:SetOperation(s.effop) + c:RegisterEffect(e1a) + local e1b=e1a:Clone() + e1b:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e1b) + --Equip 1 "Magistus" monster you control with 1 "Magistus" monster from your GY, except a Level 4 monster + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_EQUIP) + e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetRange(LOCATION_GRAVE) + e2:SetCountLimit(1,{id,1}) + e2:SetCost(Cost.SelfBanish) + e2:SetTarget(s.eqtg) + e2:SetOperation(s.eqop) c:RegisterEffect(e2) - --Equip 1 "Magistus" monster you control with 1 "Magistus" monster from your GY, except a Level 4 monster. - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetCategory(CATEGORY_EQUIP) - e3:SetType(EFFECT_TYPE_IGNITION) - e3:SetRange(LOCATION_GRAVE) - e3:SetProperty(EFFECT_FLAG_CARD_TARGET) - e3:SetCountLimit(1,{id,1}) - e3:SetCost(Cost.SelfBanish) - e3:SetTarget(s.eqtg) - e3:SetOperation(s.eqop) - c:RegisterEffect(e3) end s.listed_series={SET_MAGISTUS} function s.thfilter(c) return c:IsSetCard(SET_MAGISTUS) and c:IsSpellTrap() and c:IsAbleToHand() end -function s.tgfilter(c) - return c:IsRace(RACE_SPELLCASTER) and c:IsLevelBelow(4) and c:IsFaceup() +function s.rtgfilter(c) + return c:IsLevelBelow(4) and c:IsRace(RACE_SPELLCASTER) and c:IsFaceup() end -function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - local c=e:GetHandler() +function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) - local b2=Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_REMOVED,0,1,nil) + local b2=Duel.IsExistingMatchingCard(s.rtgfilter,tp,LOCATION_REMOVED,0,1,nil) if chk==0 then return b1 or b2 end local op=Duel.SelectEffect(tp, - {b1,aux.Stringid(id,2)}, - {b2,aux.Stringid(id,3)}) + {b1,aux.Stringid(id,2)}, + {b2,aux.Stringid(id,3)}) e:SetLabel(op) if op==1 then e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) elseif op==2 then - local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_REMOVED,0,nil) - e:SetCategory(CATEGORY_TOGRAVE) - Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,tp,0) + e:SetCategory(0) end end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then - --Add 1 "Magistus" Spell/Trap from your Deck to your hand. + --Add 1 "Magistus" Spell/Trap from your Deck to your hand Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectMatchingCard(tp,s.thfiler,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) @@ -67,9 +64,10 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) elseif op==2 then --Return 1 of your banished Level 4 or lower Spellcaster monsters to your GY Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOGRAVE) - local tg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil) - if #tg>0 then - Duel.SendtoGrave(tg,REASON_EFFECT|REASON_RETURN) + local g=Duel.SelectMatchingCard(tp,s.rtgfilter,tp,LOCATION_REMOVED,0,1,1,nil) + if #g>0 then + Duel.HintSelection(g) + Duel.SendtoGrave(g,REASON_EFFECT|REASON_RETURN) end end end @@ -77,32 +75,28 @@ function s.eqfilter(c) return c:IsSetCard(SET_MAGISTUS) and not c:IsLevel(4) and c:IsMonster() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsSetCard(SET_MAGISTUS) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsSetCard(SET_MAGISTUS) and chkc:IsFaceup() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSetCard,SET_MAGISTUS),tp,LOCATION_MZONE,0,1,nil) - and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_GRAVE,0,1,c) end + and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSetCard,SET_MAGISTUS),tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) - and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - local ec=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_GRAVE,0,1,1,nil):GetFirst() - if ec then - Duel.Equip(tp,ec,tc,true) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_EQUIP_LIMIT) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - e1:SetValue(s.eqlimit) - e1:SetLabelObject(tc) - ec:RegisterEffect(e1) + if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local ec=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst() + if ec and Duel.Equip(tp,ec,tc) then + --Equip limit + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetValue(function(e,c) return c==tc end) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + ec:RegisterEffect(e1) + end end end -function s.eqlimit(e,c) - return c==e:GetLabelObject() -end \ No newline at end of file From c60f745f2ed4971d49e0cc59f90d6650bd87d1b8 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Thu, 8 May 2025 00:40:46 +0300 Subject: [PATCH 44/57] Joker's Wild Shouldn't be able to copy it with another effect --- official/c81945678.lua | 66 ++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/official/c81945678.lua b/official/c81945678.lua index 49b79bf468..d272dd5b20 100644 --- a/official/c81945678.lua +++ b/official/c81945678.lua @@ -2,81 +2,79 @@ --Joker's Wild local s,id=GetID() function s.initial_effect(c) - --This effect becomes the effect of a Spell that specifically lists all of "Queen's Knight", "King's Knight", and "Jack's Knight" when that card is activated + --This effect becomes the activation effect of a Spell that mentions all of "Queen's Knight", "King's Knight", and "Jack's Knight" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_START) e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_START|TIMINGS_CHECK_MONSTER) e1:SetCondition(function() return Duel.IsMainPhase() or Duel.IsBattlePhase() end) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --Shuffle 1 LIGHT Warrior monster in your GY into the Deck, and if you do, add this card to your hand + --Shuffle 1 LIGHT Warrior monster from your GY into the Deck, and if you do, add this card to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_QUICK_O) - e2:SetCode(EVENT_FREE_CHAIN) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) - e2:SetHintTiming(TIMING_END_PHASE) e2:SetCountLimit(1,{id,1}) + e2:SetHintTiming(TIMING_END_PHASE) e2:SetCondition(function() return Duel.IsPhase(PHASE_END) end) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end -s.listed_names={CARD_JACK_KNIGHT,CARD_KING_KNIGHT,CARD_QUEEN_KNIGHT} -function s.copfilter(c) - return c:IsAbleToGraveAsCost() and c:ListsCode(CARD_JACK_KNIGHT,CARD_KING_KNIGHT,CARD_QUEEN_KNIGHT) - and c:IsSpell() and c:CheckActivateEffect(true,true,false)~=nil +s.listed_names={CARD_QUEEN_KNIGHT,CARD_KING_KNIGHT,CARD_JACK_KNIGHT} +function s.tgfilter(c) + return c:IsSpell() and c:ListsCode(CARD_QUEEN_KNIGHT,CARD_KING_KNIGHT,CARD_JACK_KNIGHT) and c:IsAbleToGraveAsCost() + and c:CheckActivateEffect(true,true,false)~=nil end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.copfilter,tp,LOCATION_DECK,0,1,nil) end + e:SetLabel(-100) + if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) + local sc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() + Duel.SendtoGrave(sc,REASON_COST) + e:SetLabelObject(sc) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then local te=e:GetLabelObject() + local tg=te:GetTarget() return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) end - if chk==0 then return Duel.IsExistingMatchingCard(s.copfilter,tp,LOCATION_DECK,0,1,nil) end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.copfilter,tp,LOCATION_DECK,0,1,1,nil) - if not Duel.SendtoGrave(g,REASON_COST) then return end - local te=g:GetFirst():CheckActivateEffect(true,true,false) - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) + if chk==0 then local res=e:GetLabel()==-100 e:SetLabel(0) return res end + Duel.ClearTargetCard() + local sc=e:GetLabelObject() + local te,ceg,cep,cev,cre,cr,crp=sc:CheckActivateEffect(false,true,true) local tg=te:GetTarget() - if tg then - tg(e,tp,eg,ep,ev,re,r,rp,1) - end - te:SetLabel(e:GetLabel()) + e:SetProperty(te:GetProperty()) + if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end te:SetLabelObject(e:GetLabelObject()) e:SetLabelObject(te) Duel.ClearOperationInfo(0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local te=e:GetLabelObject() - if te then - e:SetLabel(te:GetLabel()) - e:SetLabelObject(te:GetLabelObject()) - local op=te:GetOperation() - if op then op(e,tp,eg,ep,ev,re,r,rp) end - te:SetLabel(e:GetLabel()) - te:SetLabelObject(e:GetLabelObject()) + if not te then return end + e:SetLabelObject(te:GetLabelObject()) + local op=te:GetOperation() + if op then + op(e,tp,eg,ep,ev,re,r,rp) end end function s.tdfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR) and c:IsAbleToDeck() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc) end - if chk==0 then return c:IsAbleToHand() - and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end + local c=e:GetHandler() + if chk==0 then return c:IsAbleToHand() and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) @@ -85,8 +83,8 @@ end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 - and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA) and c:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA) + and c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end -end \ No newline at end of file +end From 2643967936639708d0a9024342d1f75c48dbb36d Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Fri, 9 May 2025 01:38:05 +0300 Subject: [PATCH 45/57] Thunder Ball - Shouldn't be able to use its 1st effect if damage calculation isn't conducted - The destroy effect should resolve doing nothing if this card has already left the field when it resolves - Shouldn't roll a die if the target has already left the GY when it resolves --- official/c84813516.lua | 48 +++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/official/c84813516.lua b/official/c84813516.lua index c7aedfca3a..248fc27775 100644 --- a/official/c84813516.lua +++ b/official/c84813516.lua @@ -3,7 +3,7 @@ --scripted by Naim local s,id=GetID() function s.initial_effect(c) - --Special Summon itself from the hand + --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -11,10 +11,19 @@ function s.initial_effect(c) e1:SetCode(EVENT_DAMAGE_STEP_END) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) + e1:SetCondition(function() return Duel.HasFlagEffect(0,id) end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Destroy all other monsters in the same column + --Keep track of damage calculation being performed + aux.GlobalCheck(s,function() + local ge1=Effect.CreateEffect(c) + ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + ge1:SetCode(EVENT_BATTLED) + ge1:SetOperation(function() Duel.RegisterFlagEffect(0,id,RESET_PHASE|PHASE_DAMAGE,0,1) end) + Duel.RegisterEffect(ge1,0) + end) + --Destroy all other monsters in this card's column local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) @@ -25,15 +34,15 @@ function s.initial_effect(c) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) - --Return a card from the GY to the hand + --Roll a six-sided die, and if the result is 6, add 1 card from your GY to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_DICE+CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) - e3:SetCode(EVENT_TO_GRAVE) + e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,{id,2}) - e3:SetCondition(s.thcond) + e3:SetCondition(s.thcon) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) @@ -43,7 +52,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_HAND) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() @@ -51,43 +60,44 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end -function s.cstfilter(c) - return c:IsTrap() and c:IsAbleToGraveAsCost() and (c:IsLocation(LOCATION_HAND) or c:IsFacedown()) +function s.descostfilter(c) + return c:IsTrap() and (c:IsLocation(LOCATION_HAND) or c:IsFacedown()) and c:IsAbleToGraveAsCost() end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(s.cstfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,nil) end + if chk==0 then return Duel.IsExistingMatchingCard(s.descostfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) - local g=Duel.SelectMatchingCard(tp,s.cstfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.descostfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - local cg=c:GetColumnGroup():Filter(Card.IsMonster,c) + local cg=c:GetColumnGroup():Match(Card.IsMonster,c) if chk==0 then return #cg>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,cg,#cg,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - local cg=c:GetColumnGroup():Filter(Card.IsMonster,c) + if not c:IsRelateToEffect(e) then return end + local cg=c:GetColumnGroup():Match(Card.IsMonster,c) if #cg>0 then Duel.Destroy(cg,REASON_EFFECT) end end -function s.thcond(e,tp,eg,ep,ev,re,r,rp) +function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) + return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsLocation(LOCATION_GRAVE) end -function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1) - Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE) + Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) - local res=Duel.TossDice(tp,1) local tc=Duel.GetFirstTarget() - if res==6 and tc:IsRelateToEffect(e) then + if tc:IsRelateToEffect(e) and Duel.TossDice(tp,1)==6 then Duel.SendtoHand(tc,nil,REASON_EFFECT) end -end \ No newline at end of file +end From beb71657ba9a86e6e757d6894a2acabafb259167 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Fri, 9 May 2025 01:40:55 +0300 Subject: [PATCH 46/57] Update c84813516.lua --- official/c84813516.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/official/c84813516.lua b/official/c84813516.lua index 248fc27775..625ab9f15d 100644 --- a/official/c84813516.lua +++ b/official/c84813516.lua @@ -88,7 +88,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsLocation(LOCATION_GRAVE) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end + if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_GRAVE,0,1,1,nil) From c90b57c081a814262ab9166fa279ef6681c8e692 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Fri, 9 May 2025 13:47:21 +0300 Subject: [PATCH 47/57] Charged-Up Heraldry - Check for zones in the target function if the cost is skipped - Apply the restriction on res only if it's a card activation --- official/c84482694.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/official/c84482694.lua b/official/c84482694.lua index f3ece55008..bf8671e204 100644 --- a/official/c84482694.lua +++ b/official/c84482694.lua @@ -20,6 +20,7 @@ function s.spcheck(sg,tp,exg,dg) return Duel.GetMZoneCount(tp,sg)>=2 end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) + e:SetLabel(-100) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,s.spcheck,nil) end local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,s.spcheck,nil) Duel.Release(g,REASON_COST) @@ -28,8 +29,12 @@ function s.spfilter(c,e,tp) return c:IsSetCard(SET_HERALDIC_BEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) - and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end + if chk==0 then + local cost_chk=e:GetLabel()==-100 + e:SetLabel(0) + return (cost_chk or Duel.GetLocationCount(tp,LOCATION_MZONE,0)>=2) and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) + end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) @@ -40,23 +45,18 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end - --You cannot Special Summon monsters from the Extra Deck for the rest of this turn after this card resolves, except Psychic or Machine monsters + if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end local c=e:GetHandler() + --You cannot Special Summon monsters from the Extra Deck for the rest of this turn after this card resolves, except Psychic or Machine monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) - e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) + e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(s.splimit) + e1:SetTarget(function(e,c) return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_PSYCHIC|RACE_MACHINE) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) - --Clock Lizard check - aux.addTempLizardCheck(c,tp,s.lizfilter) -end -function s.splimit(e,c) - return not c:IsRace(RACE_MACHINE|RACE_PSYCHIC) and c:IsLocation(LOCATION_EXTRA) + --"Clock Lizard" check + aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalRace(RACE_PSYCHIC|RACE_MACHINE) end) end -function s.lizfilter(e,c) - return not c:IsOriginalRace(RACE_MACHINE|RACE_PSYCHIC) -end \ No newline at end of file From bec1c7d685a6264a019f01918c193824a662927e Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Fri, 9 May 2025 23:48:56 +0300 Subject: [PATCH 48/57] Starry Knight Ceremony Place the revealed card on the bottom of the owner's Deck --- official/c85590798.lua | 80 +++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/official/c85590798.lua b/official/c85590798.lua index e54e1ad6d4..1ea3416efc 100644 --- a/official/c85590798.lua +++ b/official/c85590798.lua @@ -4,67 +4,61 @@ local s,id=GetID() function s.initial_effect(c) --Activate + local e0=Effect.CreateEffect(c) + e0:SetType(EFFECT_TYPE_ACTIVATE) + e0:SetCode(EVENT_FREE_CHAIN) + c:RegisterEffect(e0) + --Reveal 1 LIGHT Fairy monster in your hand, and if you do, add 1 Level 7 LIGHT Dragon monster from your Deck to your hand, then place that revealed monster on the bottom of your Deck local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_SZONE) + e1:SetCountLimit(1,id) + e1:SetTarget(s.thtg) + e1:SetOperation(s.thop) c:RegisterEffect(e1) - --Reveal 1 LIGHT fairy monster, add 1 level 7 LIGHT dragon monster from deck + --Special Summon 1 Level 7 LIGHT Dragon monster from your hand local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK) - e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY) + e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) - e2:SetTarget(s.thtg) - e2:SetOperation(s.thop) + e2:SetCondition(function(e,tp,eg,ep) return ep==1-tp end) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) c:RegisterEffect(e2) - --Special Summon 1 Level 7 LIGHT Dragon monster from your hand - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetCategory(CATEGORY_SPECIAL_SUMMON) - e3:SetProperty(EFFECT_FLAG_DELAY) - e3:SetCode(EVENT_CHAINING) - e3:SetRange(LOCATION_SZONE) - e3:SetCountLimit(1,id) - e3:SetCondition(function(_,tp,_,ep)return ep==1-tp end) - e3:SetTarget(s.sptg) - e3:SetOperation(s.spop) - c:RegisterEffect(e3) -end -function s.cfilter(c) - return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsPublic() and c:IsAbleToDeck() end -function s.ldlv7filter(c) - return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_DRAGON) and c:IsLevel(7) +function s.revealfilter(c) + return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY) and not c:IsPublic() and c:IsAbleToDeck() end function s.thfilter(c) - return s.ldlv7filter(c) and c:IsAbleToHand() + return c:IsLevel(7) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_DRAGON) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) - local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) - if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) + if chk==0 then return Duel.IsExistingMatchingCard(s.revealfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) - local rc=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil) - if #rc>0 then - Duel.ConfirmCards(1-tp,rc) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local sg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) - if #sg>0 and Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then - Duel.ConfirmCards(1-tp,sg) - Duel.ShuffleDeck(tp) - Duel.BreakEffect() - Duel.SendtoDeck(rc,tp,SEQ_DECKBOTTOM,REASON_EFFECT) - end - end + local rg=Duel.SelectMatchingCard(tp,s.revealfilter,tp,LOCATION_HAND,0,1,1,nil) + if #rg==0 then return end + Duel.ConfirmCards(1-tp,rg) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) + local sg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) + if #sg==0 or Duel.SendtoHand(sg,nil,REASON_EFFECT)==0 then return Duel.ShuffleHand(tp) end + Duel.ConfirmCards(1-tp,sg) + Duel.ShuffleDeck(tp) + Duel.BreakEffect() + Duel.SendtoDeck(rg,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end function s.spfilter(c,e,tp) - return s.ldlv7filter(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsLevel(7) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 @@ -78,4 +72,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end From e833e2ac40e0abc6bbda9bd94885f8a65a24e398 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 10 May 2025 12:39:17 +0300 Subject: [PATCH 49/57] Machina Citadel - Use "Card.AddMustBeSpecialSummonedByCardEffect" - Should check for the destroyed card's name on the field rather than after it's destroyed --- official/c87074380.lua | 97 ++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 55 deletions(-) diff --git a/official/c87074380.lua b/official/c87074380.lua index 49f28c7261..06bd55c645 100644 --- a/official/c87074380.lua +++ b/official/c87074380.lua @@ -4,85 +4,72 @@ local s,id=GetID() function s.initial_effect(c) c:EnableUnsummonable() - --splimit + c:AddMustBeSpecialSummonedByCardEffect() + --Destroy 1 Machine monster you control and all monsters your opponent controls with ATK less than or equal to it local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) - e1:SetCode(EFFECT_SPSUMMON_CONDITION) - e1:SetValue(s.splimit) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetCategory(CATEGORY_DESTROY) + e1:SetType(EFFECT_TYPE_QUICK_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_FREE_CHAIN) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) c:RegisterEffect(e1) - --Destroy 1 Machine monster you control and all monsters your opponent controls with ATK less than or equal to it + --Special Summon this card local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_DESTROY) - e2:SetHintTiming(TIMINGS_CHECK_MONSTER|TIMING_BATTLE_START) - e2:SetType(EFFECT_TYPE_QUICK_O) - e2:SetCode(EVENT_FREE_CHAIN) - e2:SetRange(LOCATION_MZONE) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) - e2:SetCountLimit(1,id) - e2:SetTarget(s.destg) - e2:SetOperation(s.desop) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP,EFFECT_FLAG2_CHECK_SIMULTANEOUS) + e2:SetCode(EVENT_DESTROYED) + e2:SetRange(LOCATION_GRAVE) + e2:SetCountLimit(1,{id,1}) + e2:SetCondition(s.spcon) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) c:RegisterEffect(e2) - --Special Summon this card from your GY - local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(id,1)) - e3:SetCategory(CATEGORY_SPECIAL_SUMMON) - e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) - e3:SetCode(EVENT_DESTROYED) - e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) - e3:SetRange(LOCATION_GRAVE) - e3:SetCountLimit(1,{id,1}) - e3:SetCondition(s.spcon) - e3:SetTarget(s.sptg) - e3:SetOperation(s.spop) - c:RegisterEffect(e3) end s.listed_names={id} -function s.splimit(e,se,sp,st) - return se:IsHasType(EFFECT_TYPE_ACTIONS) -end -function s.tgfilter(c,tp) - return c:IsFaceup() and c:IsRace(RACE_MACHINE) - and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttackBelow,c:GetAttack()),tp,0,LOCATION_MZONE,1,nil) +function s.desfilter(c,tp) + return c:IsRace(RACE_MACHINE) and c:IsFaceup() and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttackBelow,c:GetAttack()),tp,0,LOCATION_MZONE,1,nil) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - local c=e:GetHandler() - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,tp) end - if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.desfilter(chkc,tp) end + if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_MZONE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local tc=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst() - local dg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,tc:GetAttack()),tp,0,LOCATION_MZONE,nil) - dg:AddCard(tc) - Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,PLAYER_ALL,0) + local tc=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_MZONE,0,1,1,nil,tp):GetFirst() + local dg=tc+Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,tc:GetAttack()),tp,0,LOCATION_MZONE,nil) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if not tc:IsRelateToEffect(e) or not s.tgfilter(tc,tp) then return end - local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,tc:GetAttack()),tp,0,LOCATION_MZONE,nil) - if #g>0 then - g:AddCard(tc) - Duel.Destroy(g,REASON_EFFECT) + if tc:IsRelateToEffect(e) and tc:IsRace(RACE_MACHINE) and tc:IsFaceup() then + local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsAttackBelow,tc:GetAttack()),tp,0,LOCATION_MZONE,nil) + if #g>0 then + Duel.Destroy(g+tc,REASON_EFFECT) + end end end -function s.spcfilter(c,tp) - return c:IsReason(REASON_BATTLE|REASON_EFFECT) - and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) - and c:IsPreviousPosition(POS_FACEUP) and (c:GetPreviousAttributeOnField()&ATTRIBUTE_EARTH)==ATTRIBUTE_EARTH - and (c:GetPreviousRaceOnField()&RACE_MACHINE)==RACE_MACHINE and not c:IsCode(id) +function s.spconfilter(c,tp) + return c:IsPreviousAttributeOnField(ATTRIBUTE_EARTH) and c:IsPreviousRaceOnField(RACE_MACHINE) and c:IsPreviousPosition(POS_FACEUP) + and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and not c:IsPreviousCodeOnField(id) + and c:IsReason(REASON_BATTLE|REASON_EFFECT) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.spcfilter,1,e:GetHandler(),tp) and not eg:IsContains(e:GetHandler()) + return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.spconfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,LOCATION_GRAVE) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end -end \ No newline at end of file +end From 39943011609dceed078eaafe6ab50bf15c35e3d4 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 10 May 2025 13:23:41 +0300 Subject: [PATCH 50/57] Apparition CATEGORY_DEFCHANGE + SET_HERO --- official/c91392974.lua | 44 ++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/official/c91392974.lua b/official/c91392974.lua index e2b510dd2f..5cc1cb188d 100644 --- a/official/c91392974.lua +++ b/official/c91392974.lua @@ -3,56 +3,58 @@ --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 Level 4 or lower "Vision HERO" monster from your Deck + --Special Summon 1 Level 4 or lower "Vision HERO" monster from your Deck, then you can halve the original ATK/DEF of 1 monster your opponent controls local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) - e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE) + e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) + e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_DESTROYED) - e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.condition) e1:SetTarget(s.target) - e1:SetOperation(s.operation) + e1:SetOperation(s.activate) c:RegisterEffect(e1) end -s.listed_series={SET_VISION_HERO} -function s.cfilter(c,tp) - return c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) - and c:IsPreviousControler(tp) and c:IsPreviousSetCard(SET_HERO) and c:IsPreviousPosition(POS_FACEUP) +s.listed_series={SET_HERO,SET_VISION_HERO} +function s.confilter(c,tp) + return c:IsPreviousSetCard(SET_HERO) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) + and c:IsReason(REASON_BATTLE|REASON_EFFECT) end function s.condition(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(s.cfilter,1,nil,tp) + return eg:IsExists(s.confilter,1,nil,tp) end function s.spfilter(c,e,tp) - return c:IsSetCard(SET_VISION_HERO) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) + return c:IsLevelBelow(4) and c:IsSetCard(SET_VISION_HERO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end -function s.operation(e,tp,eg,ep,ev,re,r,rp) +function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then - Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) - local tc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil):GetFirst() + local sc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil):GetFirst() + if not sc then return end + Duel.HintSelection(sc) + Duel.BreakEffect() + --Its original ATK/DEF is halved local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) + e1:SetValue(sc:GetBaseAttack()/2) e1:SetReset(RESET_EVENT|RESETS_STANDARD) - e1:SetValue(tc:GetBaseAttack()/2) - tc:RegisterEffect(e1) - local e2=Effect.CreateEffect(e:GetHandler()) - e2:SetType(EFFECT_TYPE_SINGLE) + sc:RegisterEffect(e1) + local e2=e1:Clone() e2:SetCode(EFFECT_SET_BASE_DEFENSE) - e2:SetReset(RESET_EVENT|RESETS_STANDARD) - e2:SetValue(tc:GetBaseDefense()/2) - tc:RegisterEffect(e2) + e2:SetValue(sc:GetBaseDefense()/2) + sc:RegisterEffect(e2) end -end \ No newline at end of file +end From 62dee8c03df12a2ff444fc43c870766a97eb33b4 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sat, 10 May 2025 14:29:40 +0300 Subject: [PATCH 51/57] Return of the Zombies - Missing ">0" when checking for available zones with "Duel.GetMZoneCount" - Wrong string id in e2 --- official/c91742238.lua | 64 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/official/c91742238.lua b/official/c91742238.lua index 48cb8135e5..3f44875a7b 100644 --- a/official/c91742238.lua +++ b/official/c91742238.lua @@ -9,77 +9,77 @@ function s.initial_effect(c) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) - e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) - --Shuffle 1 of your banished Zombie monsters into the Deck, and if you do, Set this card + --Shuffle 1 of your banished Zombie monsters into the Deck, and if you do, Set this card, but banish it when it leaves the field local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) - e2:SetCategory(CATEGORY_TODECK) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetCategory(CATEGORY_TODECK+CATEGORY_LEAVE_GRAVE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) - e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCountLimit(1,{id,1}) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) end function s.rmfilter(c,e,tp) - local p=c:GetControler() - return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemove() - and Duel.GetMZoneCount(p,c,p,LOCATION_REASON_TOFIELD) - and Duel.IsExistingMatchingCard(s.spfilter,p,LOCATION_GRAVE,0,1,nil,e,tp,p) + local ctrl=c:GetControler() + return c:IsRace(RACE_ZOMBIE) and c:IsFaceup() and c:IsAbleToRemove() and Duel.GetMZoneCount(ctrl,c,tp)>0 + and Duel.IsExistingMatchingCard(s.spfilter,ctrl,LOCATION_GRAVE,0,1,nil,e,tp,ctrl) end -function s.spfilter(c,e,tp,p) - return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,p) +function s.spfilter(c,e,tp,ctrl) + return c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,ctrl) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end - Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_MZONE) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_ALL,LOCATION_GRAVE) + Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_EITHER,LOCATION_MZONE) + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,PLAYER_EITHER,LOCATION_GRAVE) end function s.activate(e,tp,eg,ep,ev,re,r,rp) - if not Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local rc=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp):GetFirst() - if rc and Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)~=0 then - local p=rc:GetPreviousControler() + if not rc then return end + Duel.HintSelection(rc) + if Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)>0 then + local ctrl=rc:GetPreviousControler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),p,LOCATION_GRAVE,0,1,1,nil,e,tp,p) + local g=Duel.SelectMatchingCard(tp,s.spfilter,ctrl,LOCATION_GRAVE,0,1,1,nil,e,tp,ctrl) if #g>0 then Duel.BreakEffect() - Duel.SpecialSummon(g,0,tp,p,false,false,POS_FACEUP_DEFENSE) + Duel.SpecialSummon(g,0,tp,ctrl,false,false,POS_FACEUP_DEFENSE) end end end -function s.setfilter(c) - return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck() +function s.tdfilter(c) + return c:IsRace(RACE_ZOMBIE) and c:IsFaceup() and c:IsAbleToDeck() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return c:IsSSetable() - and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_REMOVED,0,1,nil) end - Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0) + if chk==0 then return c:IsSSetable() and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,tp,0) end function s.setop(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) - local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_REMOVED,0,1,1,nil) - if #g>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 - and c:IsRelateToEffect(e) and c:IsSSetable() then - Duel.SSet(tp,c) - --Banish it if it leaves the field + local sc=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil):GetFirst() + if not sc then return end + Duel.HintSelection(sc) + local c=e:GetHandler() + if Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_DECK|LOCATION_EXTRA) + and c:IsRelateToEffect(e) and Duel.SSet(tp,c)>0 then + --Banish it when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) - e1:SetReset(RESET_EVENT|RESETS_REDIRECT) + e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) + e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1) end -end \ No newline at end of file +end From e44a5729fa114702143d18e200ac460fc149cdc4 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 11 May 2025 00:18:58 +0300 Subject: [PATCH 52/57] Endymion, the Magistus of Mastery - Missing CATEGORY_TODECK category and opinfo - Also check for forbidden status and unique on field for the card to equip --- official/c9482987.lua | 63 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/official/c9482987.lua b/official/c9482987.lua index 96cbecdb28..7fb193b7a7 100644 --- a/official/c9482987.lua +++ b/official/c9482987.lua @@ -3,7 +3,7 @@ --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) - --Equip from Extra Deck + --Equip 1 "Magistus" monster you control with 1 "Magistus" monster from your Extra Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_EQUIP) @@ -14,12 +14,12 @@ function s.initial_effect(c) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) - --Destroy, draw 1 card and return 1 card to the Deck + --Destroy 1 face-up Spell you control, and if you do, draw 1 card, then place 1 card from your hand on the bottom of the Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) - e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW) - e2:SetProperty(EFFECT_FLAG_CARD_TARGET) + e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW+CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_IGNITION) + e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.destg) @@ -27,53 +27,50 @@ function s.initial_effect(c) c:RegisterEffect(e2) end s.listed_series={SET_MAGISTUS} -function s.eqtgfilter(c,tp) - return c:IsFaceup() and c:IsSetCard(SET_MAGISTUS) and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_EXTRA,0,1,nil,SET_MAGISTUS) +function s.eqfilter(c,tp) + return c:IsSetCard(SET_MAGISTUS) and not c:IsForbidden() and c:CheckUniqueOnField(tp) end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() - if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqtgfilter(chkc,tp) end + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsSetCard(SET_MAGISTUS) and chkc:IsFaceup() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 - and Duel.IsExistingTarget(s.eqtgfilter,tp,LOCATION_MZONE,0,1,nil,tp) end + and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSetCard,SET_MAGISTUS),tp,LOCATION_MZONE,0,1,nil) + and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_EXTRA,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - Duel.SelectTarget(tp,s.eqtgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) + Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSetCard,SET_MAGISTUS),tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_EXTRA) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end local tc=Duel.GetFirstTarget() - if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) - and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) - local ec=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_EXTRA,0,1,1,nil,SET_MAGISTUS):GetFirst() - if ec then - Duel.Equip(tp,ec,tc,true) - local e1=Effect.CreateEffect(e:GetHandler()) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_EQUIP_LIMIT) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - e1:SetValue(s.eqlimit) - e1:SetLabelObject(tc) - ec:RegisterEffect(e1) + if tc:IsRelateToEffect(e) and tc:IsFaceup() then + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + local ec=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_EXTRA,0,1,1,nil,tp):GetFirst() + if ec and Duel.Equip(tp,ec,tc) then + --Equip limit + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetValue(function(e,c) return c==tc end) + e1:SetReset(RESET_EVENT|RESETS_STANDARD) + ec:RegisterEffect(e1) + end end end -function s.eqlimit(e,c) - return c==e:GetLabelObject() -end -function s.desfilter(c) - return c:IsFaceup() and c:IsSpell() -end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_ONFIELD) and s.desfilter(chkc) end + if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsSpell() and chkc:IsFaceup() end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) - and Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil) end + and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsSpell),tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil) + local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsSpell),tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) + Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.Draw(tp,1,REASON_EFFECT)~=0 then + if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and Duel.Draw(tp,1,REASON_EFFECT)>0 then Duel.ShuffleHand(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil) @@ -82,4 +79,4 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_EFFECT) end end -end \ No newline at end of file +end From 334c179c8d9c1aa811ef05e4df18dde37b212f54 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 11 May 2025 13:49:41 +0300 Subject: [PATCH 53/57] Odd-Eyes Rebellion Dragon Overlord Use "Card.IsCanBeXyzMaterial" when attaching from the Pendulum Zone --- official/c98452268.lua | 133 +++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 79 deletions(-) diff --git a/official/c98452268.lua b/official/c98452268.lua index 2fdcc938cd..b3e63d3388 100644 --- a/official/c98452268.lua +++ b/official/c98452268.lua @@ -4,13 +4,13 @@ local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() - --You can only Special Summon "Odd-Eyes Rebellion Dragon Overlord(s)" once per turn. - c:SetSPSummonOnce(id) - --Xyz Summon Procedure: 2 Level 7 monsters OR 1 "Rebellion" Xyz Monster you control - Xyz.AddProcedure(c,nil,7,2,s.ovfilter,aux.Stringid(id,0)) - --Pendulum Summon Procedure + --Xyz Summon procedure: 2 Level 7 monsters OR 1 "Rebellion" Xyz Monster you control + Xyz.AddProcedure(c,nil,7,2,function(c) return c:IsSetCard(SET_REBELLION) and c:IsType(TYPE_XYZ) and c:IsFaceup() end,aux.Stringid(id,0)) + --Pendulum Summon procedure Pendulum.AddProcedure(c,false) - --Special Summon this card from your Pendulum Zone, then Special Summon from your Extra Deck, 1 "Rebellion" or "The Phantom Knights" monster, using this card as material + --You can only Special Summon "Odd-Eyes Rebellion Dragon Overlord(s)" once per turn + c:SetSPSummonOnce(id) + --Special Summon this card from your Pendulum Zone, then Special Summon from your Extra Deck, 1 "Rebellion" or "The Phantom Knights" monster, using this card as material (this is treated as an Xyz Summon), then you can attach 1 card from your Pendulum Zone to it as material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) @@ -21,105 +21,80 @@ function s.initial_effect(c) e1:SetOperation(s.spop) c:RegisterEffect(e1) --This card that was Xyz Summoned using a Rank 7 Xyz Monster as material can make up to 3 attacks during each Battle Phase - local e2=Effect.CreateEffect(c) - e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) - e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) - e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) - e2:SetOperation(s.operation) - c:RegisterEffect(e2) + local e2a=Effect.CreateEffect(c) + e2a:SetType(EFFECT_TYPE_SINGLE) + e2a:SetCode(EFFECT_EXTRA_ATTACK) + e2a:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end) + e2a:SetValue(2) + c:RegisterEffect(e2a) + local e2b=Effect.CreateEffect(c) + e2b:SetType(EFFECT_TYPE_SINGLE) + e2b:SetCode(EFFECT_MATERIAL_CHECK) + e2b:SetValue(s.valcheck) + c:RegisterEffect(e2b) + --Place this card in your Pendulum Zone local e3=Effect.CreateEffect(c) - e3:SetType(EFFECT_TYPE_SINGLE) - e3:SetCode(EFFECT_MATERIAL_CHECK) - e3:SetValue(s.valcheck) - e3:SetLabelObject(e2) + e3:SetDescription(aux.Stringid(id,2)) + e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e3:SetProperty(EFFECT_FLAG_DELAY) + e3:SetCode(EVENT_DESTROYED) + e3:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) end) + e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) end end) + e3:SetOperation(s.penop) c:RegisterEffect(e3) - --Place this card in your Pendulum Zone - local e4=Effect.CreateEffect(c) - e4:SetDescription(aux.Stringid(id,2)) - e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) - e4:SetCode(EVENT_DESTROYED) - e4:SetProperty(EFFECT_FLAG_DELAY) - e4:SetCondition(s.pencon) - e4:SetTarget(s.pentg) - e4:SetOperation(s.penop) - c:RegisterEffect(e4) end s.pendulum_level=7 s.listed_names={id} s.listed_series={SET_REBELLION,SET_THE_PHANTOM_KNIGHTS} -function s.ovfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_REBELLION) and c:IsType(TYPE_XYZ) -end -function s.spfilter(c,e,tp,mc,pg) - return c:IsFacedown() and (c:IsSetCard(SET_REBELLION) or c:IsSetCard(SET_THE_PHANTOM_KNIGHTS)) and c:IsType(TYPE_XYZ) - and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 - and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) +function s.spfilter(c,e,tp,mc) + return c:IsSetCard({SET_REBELLION,SET_THE_PHANTOM_KNIGHTS}) and c:IsType(TYPE_XYZ) and c:IsFacedown() + and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and mc:IsCanBeXyzMaterial(c,tp) and not c:IsCode(id) - and (not pg or #pg<=0 or pg:IsContains(mc)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsPlayerCanSpecialSummonCount(tp,2) - and c:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) - Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) + if chk==0 then + local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonCount(tp,2) + and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (#pg<=0 or (#pg==1 and pg:IsContains(c))) + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) + end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,2,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end - local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) - Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c,pg) - local sc=g:GetFirst() - if sc then - Duel.BreakEffect() - sc:SetMaterial(Group.FromCards(c)) + if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then + local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) + if not (#pg<=0 or (#pg==1 and pg:IsContains(c))) then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) + local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c):GetFirst() + if not sc then return end + sc:SetMaterial(c) Duel.Overlay(sc,c) - Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) + Duel.BreakEffect() + if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)==0 then return end sc:CompleteProcedure() - local xg=Duel.GetFieldGroup(tp,LOCATION_PZONE,0) - if #xg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then + if Duel.IsExistingMatchingCard(Card.IsCanBeXyzMaterial,tp,LOCATION_PZONE,0,1,nil,c,tp,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACH) - local cd=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_PZONE,0,1,1,nil):GetFirst() + local matc=Duel.SelectMatchingCard(tp,Card.IsCanBeXyzMaterial,tp,LOCATION_PZONE,0,1,1,nil,c,tp,REASON_EFFECT):GetFirst() + if not matc then return end + Duel.HintSelection(matc) Duel.BreakEffect() - Duel.Overlay(sc,cd) + Duel.Overlay(sc,matc) end end end -function s.valfilter(c) - return c:IsType(TYPE_XYZ) and c:GetRank()==7 +function s.valcheckfilter(c) + return c:IsRank(7) and c:IsType(TYPE_XYZ) end function s.valcheck(e,c) - e:GetLabelObject():SetLabel(c:GetMaterial():FilterCount(s.valfilter,nil)) -end -function s.operation(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - local ct=e:GetLabel() - if ct>0 then - local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(id,4)) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) - e1:SetCode(EFFECT_EXTRA_ATTACK) - e1:SetValue(2) - e1:SetReset(RESET_EVENT|RESETS_STANDARD) - c:RegisterEffect(e1) + if c:GetMaterial():IsExists(s.valcheckfilter,1,nil) then + c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD&~(RESET_TOFIELD|RESET_LEAVE|RESET_TEMP_REMOVE),EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4)) end end -function s.pencon(e,tp,eg,ep,ev,re,r,rp) - local c=e:GetHandler() - return r&(REASON_EFFECT|REASON_BATTLE)>=0 and c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() -end -function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.CheckPendulumZones(tp) end -end function s.penop(e,tp,eg,ep,ev,re,r,rp) - if not Duel.CheckPendulumZones(tp) then return false end local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end -end \ No newline at end of file +end From 4b245b9d01d3db5b0f5d65aa885ed24de43f628e Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 11 May 2025 15:43:20 +0300 Subject: [PATCH 54/57] Update c29354228.lua --- official/c29354228.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/official/c29354228.lua b/official/c29354228.lua index ca80261de8..df2cdf09ef 100644 --- a/official/c29354228.lua +++ b/official/c29354228.lua @@ -59,12 +59,8 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) local sc=Duel.SelectMatchingCard(tp,s.thspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,mzone_chk):GetFirst() if not sc then return end aux.ToHandOrElse(sc,tp, - function() - return mzone_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) - end, - function() - Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) - end, + function() return mzone_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, + function() Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, aux.Stringid(id,4) ) end From 35cb7ffb00cb7fc9afcb470686bfd9487a2b6b68 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 11 May 2025 20:30:18 +0300 Subject: [PATCH 55/57] Update c23912837.lua --- official/c23912837.lua | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/official/c23912837.lua b/official/c23912837.lua index 98e62e4593..d063d3d26f 100644 --- a/official/c23912837.lua +++ b/official/c23912837.lua @@ -3,25 +3,27 @@ --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) - --Special Summon 1 "Shaddoll" monster from your GY + --Special Summon 1 "Shaddoll" monster from your GY in face-up or face-down Defense Position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) - e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) + e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) - --Activate one of these effects + --Activate 1 of these effects local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(id,0)) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) + e2:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCost(s.effcost) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) @@ -41,48 +43,46 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_DEFENSE)>0 then - if tc:IsFacedown() then - Duel.ConfirmCards(1-tp,tc) - end + if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_DEFENSE)>0 and tc:IsFacedown() then + Duel.ConfirmCards(1-tp,tc) end end -function s.cfilter(c) +function s.effcostfilter(c) return c:IsSetCard(SET_SHADDOLL) and c:IsAbleToRemoveAsCost() end function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() - if chk==0 then return Cost.SelfBanish(e,tp,eg,ep,ev,re,r,rp,0) - and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,c) end + if chk==0 then return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(s.effcostfilter,tp,LOCATION_GRAVE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) - local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,c) - g:AddCard(c) - Duel.Remove(g,POS_FACEUP,REASON_COST) + local g=Duel.SelectMatchingCard(tp,s.effcostfilter,tp,LOCATION_GRAVE,0,1,1,c) + Duel.Remove(g+c,POS_FACEUP,REASON_COST) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) - local b1=Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) - local b2=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCanTurnSet),tp,LOCATION_MZONE,0,1,nil) + local b1=Duel.IsExistingMatchingCard(aux.AND(Card.IsFacedown,Card.IsCanChangePosition),tp,LOCATION_MZONE,0,1,nil) + local b2=Duel.IsExistingMatchingCard(Card.IsCanTurnSet,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return b1 or b2 end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,2)}, {b2,aux.Stringid(id,3)}) e:SetLabel(op) - Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,tp,0) end function s.effop(e,tp,eg,ep,ev,re,r,rp) if op==1 then + --Change 1 face-down monster you control to face-up Defense Position Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) - local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_MZONE,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,aux.AND(Card.IsFacedown,Card.IsCanChangePosition),tp,LOCATION_MZONE,0,1,1,nil) if #g>0 then Duel.HintSelection(g) Duel.ChangePosition(g,POS_FACEUP_DEFENSE) end elseif op==2 then + --Change 1 face-up monster you control to face-down Defense Position Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) - local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsCanTurnSet),tp,LOCATION_MZONE,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,Card.IsCanTurnSet,tp,LOCATION_MZONE,0,1,1,nil) if #g>0 then Duel.HintSelection(g) Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) end end -end \ No newline at end of file +end From b51e37d9b37d436413f07f6d7b80353a8cd4b1d1 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 11 May 2025 21:04:50 +0300 Subject: [PATCH 56/57] Update c50793215.lua --- official/c50793215.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/official/c50793215.lua b/official/c50793215.lua index fac0782a1f..578cc8ad01 100644 --- a/official/c50793215.lua +++ b/official/c50793215.lua @@ -25,7 +25,7 @@ function s.initial_effect(c) e2:SetTarget(s.thsptg) e2:SetOperation(s.thspop) c:RegisterEffect(e2) - --If sent to GY, shuffle 1 banished card into deck + --Shuffle 1 banished card into the Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK) From f9d38fbab6be3c5ccb97fee1dcd4a3b2fb00aba8 Mon Sep 17 00:00:00 2001 From: pyrQ <30827955+pyrQ@users.noreply.github.com> Date: Sun, 11 May 2025 21:43:00 +0300 Subject: [PATCH 57/57] Update c3792766.lua --- official/c3792766.lua | 46 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/official/c3792766.lua b/official/c3792766.lua index 70022639ad..27f9712288 100644 --- a/official/c3792766.lua +++ b/official/c3792766.lua @@ -5,11 +5,12 @@ function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure: 2+ "Trickstar" monsters Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_TRICKSTAR),2) - --Add banished "Trickstar" cards to your hand, and if you do, this card gains 1000 ATK for each card added + --Add your banished "Trickstar" cards to your hand, up to the number of Link Monsters your opponent controls, and if you do, this card gains 1000 ATK for each card added, until the end of this turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) @@ -17,39 +18,36 @@ function s.initial_effect(c) c:RegisterEffect(e1) end s.listed_series={SET_TRICKSTAR} -function s.lkfilter(c) - return c:IsFaceup() and c:IsSetCard(SET_TRICKSTAR) +function s.thconfilter(c) + return c:IsSetCard(SET_TRICKSTAR) and c:IsFaceup() and c:IsMonster() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) - return e:GetHandler():GetLinkedGroup():IsExists(s.lkfilter,1,nil) + return e:GetHandler():GetLinkedGroup():IsExists(s.thconfilter,1,nil) end -function s.filter(c) - return c:IsFaceup() and c:IsSetCard(SET_TRICKSTAR) and c:IsAbleToHand() +function s.thfilter(c) + return c:IsSetCard(SET_TRICKSTAR) and c:IsFaceup() and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc) end - if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil) - and Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_LINK) end - local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK) + if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.thfilter(chkc) end + local ct=Duel.GetMatchingGroupCount(Card.IsLinkMonster,tp,0,LOCATION_MZONE,nil) + if chk==0 then return ct>0 and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) - local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,ct,nil) + local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_REMOVED,0,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,tp,0) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,#g*1000) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() - local rg=Duel.GetTargetCards(e) - Duel.SendtoHand(rg,nil,REASON_EFFECT) - if c:IsRelateToEffect(e) and c:IsFaceup() then + local tg=Duel.GetTargetCards(e) + if Duel.SendtoHand(tg,nil,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsFaceup() then local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_HAND) - if ct>0 then - --This card gains 1000 ATK for each card added - local e1=Effect.CreateEffect(c) - e1:SetType(EFFECT_TYPE_SINGLE) - e1:SetCode(EFFECT_UPDATE_ATTACK) - e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) - e1:SetValue(ct*1000) - c:RegisterEffect(e1) - end + if ct==0 then return end + --This card gains 1000 ATK for each card added, until the end of this turn + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(ct*1000) + e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END) + c:RegisterEffect(e1) end -end \ No newline at end of file +end