instruction
stringclasses
1 value
input
stringlengths
10
1.11k
output
stringlengths
67
7.06k
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can send 1 Spell/Trap from your hand or field to the GY; Special Summon this card from your hand, then add 1 "White Forest" monster from your Deck to your hand, except "Elzette of the White Forest". During your opponent's turn, if a LIGHT Spellcaster Tuner is Special Summoned to your field, while this card is in your GY (except during the Damage Step): You can add this card to your hand. You can only use each effect of "Elzette of the White Forest" once per turn.
--白き森のリゼット --Elzette of the White Forest --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your hand, then add 1 "White Forest" monster from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Add this card to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY,EFFECT_FLAG2_CHECK_SIMULTANEOUS) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_WHITE_FOREST} s.listed_names={id} function s.spcostfilter(c,tp) return c:IsSpellTrap() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0 end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,1,1,nil,tp) Duel.SendtoGrave(g,REASON_COST) end function s.thfilter(c) return c:IsSetCard(SET_WHITE_FOREST) and c:IsMonster() and not c:IsCode(id) and c:IsAbleToHand() end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) 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 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 Duel.BreakEffect() Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.thconfilter(c,tp) return c:IsControler(tp) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_TUNER) and c:IsFaceup() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) and eg:IsExists(s.thconfilter,1,nil,tp) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 "Gladiator Beast" monsters If a "Gladiator Beast" monster you control attacks, it cannot be destroyed by that battle, also your opponent cannot activate cards or effects until the end of the Damage Step. At the end of the Battle Phase, if this card battled: You can return this card to the Extra Deck; Special Summon 2 "Gladiator Beast" monsters with different names from your Deck. You can only use this effect of "Gladiator Beast Dragases" once per turn.
--剣闘獣ドラガシス --Gladiator Beast Dragases --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --link summon c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,SET_GLADIATOR),2,2) --indes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(s.indtg) e1:SetValue(1) c:RegisterEffect(e1) --actlimit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EFFECT_CANNOT_ACTIVATE) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(0,1) e2:SetValue(1) e2:SetCondition(s.actcon) c:RegisterEffect(e2) --special summon local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,0)) e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e6:SetCode(EVENT_PHASE|PHASE_BATTLE) e6:SetRange(LOCATION_MZONE) e6:SetCountLimit(1,id) e6:SetCondition(s.spcon) e6:SetCost(s.spcost) e6:SetTarget(s.sptg) e6:SetOperation(s.spop) c:RegisterEffect(e6) end s.listed_series={SET_GLADIATOR} function s.indtg(e,c) return c:IsSetCard(SET_GLADIATOR) and Duel.GetAttacker()==c end function s.actcon(e) local tc=Duel.GetAttacker() local tp=e:GetHandlerPlayer() return tc and tc:IsControler(tp) and tc:IsSetCard(SET_GLADIATOR) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattledGroupCount()>0 end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToExtraAsCost() end Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_COST) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_GLADIATOR) and c:IsCanBeSpecialSummoned(e,125,tp,false,false) 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 local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) return ft>1 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and g:GetClassCount(Card.GetCode)>=2 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) if #g>=2 and g:GetClassCount(Card.GetCode)>=2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg1=g:Select(tp,1,1,nil) local tc1=sg1:GetFirst() g:Remove(Card.IsCode,nil,tc1:GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg2=g:Select(tp,1,1,nil) local tc2=sg2:GetFirst() sg1:Merge(sg2) Duel.SpecialSummonStep(tc1,125,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(tc2,125,tp,tp,false,false,POS_FACEUP) tc1:RegisterFlagEffect(tc1:GetOriginalCode(),RESET_EVENT|RESETS_STANDARD_DISABLE,0,0) tc2:RegisterFlagEffect(tc2:GetOriginalCode(),RESET_EVENT|RESETS_STANDARD_DISABLE,0,0) Duel.SpecialSummonComplete() end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can banish 1 Level 8 Dragon monster from your Extra Deck; Special Summon this card from your hand, also you cannot Special Summon for the rest of this turn, except Dragon monsters. You can activate 1 of these effects; ● Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters from your hand or field. ● Target 1 other Attack Position monster on the field; make this card lose exactly 500 ATK/DEF, and if you do, destroy that monster. You can only use each effect of "Dark End Evaporation Dragon" once per turn.
--闇と消滅の竜 --Dark End Evaporation Dragon --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.hspcost) e1:SetTarget(s.hsptg) e1:SetOperation(s.hspop) c:RegisterEffect(e1) --Activate 1 of these effects local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) c:RegisterEffect(e2) end function s.hspcostfilter(c) return c:IsLevel(8) and c:IsRace(RACE_DRAGON) and c:IsAbleToRemoveAsCost() end function s.hspcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.hspcostfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.hspcostfilter,tp,LOCATION_EXTRA,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.hsptg(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,0) end function s.hspop(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 --Cannot Special Summon monsters for the rest of the turn, except Dragon 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_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(function(e,c) return not c:IsRace(RACE_DRAGON) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return e:GetLabel()==2 and chkc:IsLocation(LOCATION_MZONE) and chkc:IsAttackPos() and chkc~=c end local fustg=Fusion.SummonEffTG() local b1=fustg(e,tp,eg,ep,ev,re,r,rp,0) local b2=c:IsAttackAbove(500) and c:IsDefenseAbove(500) and Duel.IsExistingTarget(Card.IsAttackPos,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) if chk==0 then return b1 or b2 end local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,3)}, {b2,aux.Stringid(id,4)}) e:SetLabel(op) if op==1 then e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e:SetProperty(0) fustg(e,tp,eg,ep,ev,re,r,rp,1) elseif op==2 then e:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DESTROY) e:SetProperty(EFFECT_FLAG_CARD_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsAttackPos,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,c,1,tp,-500) Duel.SetOperationInfo(0,CATEGORY_DEFCHANGE,c,1,tp,-500) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then --Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters from your hand or field as material Fusion.SummonEffOP()(e,tp,eg,ep,ev,re,r,rp) elseif op==2 then --Make this card lose exactly 500 ATK/DEF and destroy 1 other Attack Position monster on the field local c=e:GetHandler() if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:IsAttackAbove(500) and c:IsDefenseAbove(500)) then return end if c:UpdateAttack(-500)==-500 and c:UpdateDefense(-500)==-500 then local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can activate 1 of these effects; ● Add 1 "Zubaba" monster from your Deck to your hand, except "Zubababa Knight". This card's Level becomes that added monster's Level. ● Destroy 1 Level 4 or lower Defense Position monster your opponent controls. If this card is detached from an Xyz Monster to activate that monster's effect: You can add 1 "Gagaga" monster from your Deck to your hand. You can only use each effect of "Zubababa Knight" once per turn.
--ズバババナイト --Zubababa Knight --Scripted by The Razgriz 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.efftg) e1:SetOperation(s.effop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Add 1 "Gagaga" monster from your Deck to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.gathcon) e3:SetTarget(s.gathtg) e3:SetOperation(s.gathop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_REMOVE) c:RegisterEffect(e4) end s.listed_series={SET_ZUBABA,SET_GAGAGA} s.listed_names={id} function s.zbthfilter(c) return c:IsSetCard(SET_ZUBABA) and c:IsMonster() and c:IsAbleToHand() and not c:IsCode(id) end function s.desfilter(c) return c:IsLevelBelow(4) and c:IsDefensePos() and c:IsFaceup() end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil) local b1=Duel.IsExistingMatchingCard(s.zbthfilter,tp,LOCATION_DECK,0,1,nil) local b2=#g>0 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+CATEGORY_LVCHANGE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) elseif op==2 then e:SetCategory(CATEGORY_DESTROY) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then --Add 1 "Zubaba" monster from your Deck to your hand, except "Zubababa Knight", and if you do, this card's Level becomes that added monster's Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sc=Duel.SelectMatchingCard(tp,s.zbthfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if sc and Duel.SendtoHand(sc,nil,REASON_EFFECT)>0 then Duel.ConfirmCards(1-tp,sc) local lv=sc:GetLevel() local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() and not c:IsLevel(lv) then --This card's Level becomes the added monster's local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(lv) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end elseif op==2 then --Destroy 1 Level 4 or lower Defense Position monster your opponent controls Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,0,LOCATION_MZONE,1,1,nil) if #g>0 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end end function s.gathcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ) and c:IsPreviousLocation(LOCATION_OVERLAY) end function s.gathfilter(c) return c:IsSetCard(SET_GAGAGA) and c:IsMonster() and c:IsAbleToHand() end function s.gathtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.gathfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.gathop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.gathfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, if this card was Tribute Summoned by Tributing a "Steelswarm" monster(s): You can pay 1000 Life Points to target 1 monster on the field; destroy that target.
--インヴェルズ・ホーン --Steelswarm Longhorn local s,id=GetID() function s.initial_effect(c) --summon success local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCondition(s.regcon) e1:SetOperation(s.regop) c:RegisterEffect(e1) --tribute check local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_MATERIAL_CHECK) e2:SetValue(s.valcheck) e2:SetLabelObject(e1) c:RegisterEffect(e2) end s.listed_series={SET_STEELSWARM} function s.valcheck(e,c) local g=c:GetMaterial() if g:IsExists(Card.IsSetCard,1,nil,SET_STEELSWARM) then e:GetLabelObject():SetLabel(1) else e:GetLabelObject():SetLabel(0) end end function s.regcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsTributeSummoned() and e:GetLabel()==1 end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():IsDisabled() and Duel.CheckLPCost(tp,1000) end Duel.PayLPCost(tp,1000) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If your opponent controls more monsters than you do (Quick Effect): You can discard this card; reveal 1 card in your Extra Deck, then look at your opponent's Extra Deck, also banish all cards in their Extra Deck with the same name as that revealed card. You can only use this effect of "Ghost Reaper & Winter Cherries" once per turn.
--浮幽さくら --Ghost Reaper & Winter Cherries local s,id=GetID() function s.initial_effect(c) --remove local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetCountLimit(1,id) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.condition) e1:SetCost(Cost.SelfDiscard) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_EXTRA,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,30459350) and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>0 end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_EXTRA,0,1,1,nil) if #sg>0 then Duel.ConfirmCards(1-tp,sg) Duel.BreakEffect() local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) Duel.ConfirmCards(tp,g) local tg=g:Filter(Card.IsCode,nil,sg:GetFirst():GetCode()) if #tg>0 then Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) end Duel.ShuffleExtra(1-tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is sent to the Graveyard, and you have no Spell/Trap Cards in your Graveyard: You can look at 5 cards from the top of your Deck, then place them on the top of the Deck in any order. When an opponent's monster declares a direct attack: You can banish this card from your Graveyard; excavate the top card of your Deck, and if it is a "Superheavy Samurai" monster, add it to your hand, and if you do, the attacking monster's ATK becomes 0. Otherwise, send it to the Graveyard.
--超重武者グロウ-V --Superheavy Samurai Gigagloves local s,id=GetID() function s.initial_effect(c) --Reveal and sort the top 5 cards of your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_TO_GRAVE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Change the ATK of a battling monster to 0 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_GRAVE) e2:SetCondition(s.atkcon) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end s.listed_series={SET_SUPERHEAVY_SAMURAI} function s.condition(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(Card.IsSpellTrap,tp,LOCATION_GRAVE,0,1,nil) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 end end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.SortDecktop(tp,tp,5) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end Duel.ConfirmDecktop(tp,1) local g=Duel.GetDecktopGroup(tp,1) local tc=g:GetFirst() Duel.DisableShuffleCheck() if tc:IsSetCard(SET_SUPERHEAVY_SAMURAI) and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 then Duel.ShuffleHand(tp) local at=Duel.GetAttacker() if at:IsFaceup() and at:IsRelateToBattle() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(0) e1:SetReset(RESET_EVENT|RESETS_STANDARD) at:RegisterEffect(e1) end else Duel.SendtoGrave(tc,REASON_EFFECT|REASON_EXCAVATE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon 1 of your "Fallen of Albaz" that is banished, in your hand, or in your GY. During the End Phase, if this card is in the GY because it was sent there to activate the effect of "Fallen of Albaz" this turn: You can Set this card. You can only use each effect of "Branded Bond" once per turn.
--烙印の絆 --Branded Bond --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Special Summon 1 "Fallen of Albaz" from your hand, GY, or banishment 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:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Set this card from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) --Register that this card was sent to the GY to activate the effect of "Fallen of Albaz" local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EVENT_TO_GRAVE) e3:SetOperation(s.regop) c:RegisterEffect(e3) end s.listed_names={CARD_ALBAZ} function s.spfilter(c,e,tp) return c:IsCode(CARD_ALBAZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) 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_HAND|LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_REMOVED) 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 g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsSSetable() end 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() if c:IsRelateToEffect(e) and c:IsSSetable() then Duel.SSet(tp,c) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (c:IsReason(REASON_COST) and re and re:IsActivated()) then return end local code1,code2=Duel.GetChainInfo(Duel.GetCurrentChain(),CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2) if code1==CARD_ALBAZ or code2==CARD_ALBAZ then c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is in your Graveyard and you control no monsters during either of your Main Phases: You can discard 1 WATER monster; Special Summon this card from your Graveyard, but destroy all monsters you control at the beginning of this turn's Battle Phase, except for WATER monsters. You can only use the effect of "Fishborg Archer" once per turn.
--フィッシュボーグ-アーチャー --Fishborg Archer local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end function s.cfilter(c) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST|REASON_DISCARD) 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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE|PHASE_BATTLE_START) e1:SetCountLimit(1) e1:SetOperation(s.desop) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end end function s.desfilter(c) return c:IsFacedown() or not c:IsAttribute(ATTRIBUTE_WATER) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE,0,nil) if #g>0 then Duel.Hint(HINT_CARD,0,id) Duel.Destroy(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can Special Summon 1 EARTH Machine monster from your hand in Defense Position, except "Infinitrack Anchor Drill". You can target 1 other Machine monster you control; the Levels of both that monster and this card become the combined original Levels of those 2 monsters, until the end of this turn. You can only use each effect of "Infinitrack Anchor Drill" once per turn.
--無限起動ロックアンカー --Infinitrack Anchor Drill --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --lv change local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.lvtg) e3:SetOperation(s.lvop) c:RegisterEffect(e3) end s.listed_names={id} function s.spfilter(c,e,tp) return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) 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 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 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_DEFENSE) end end function s.lvfilter(c,lv) return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:HasLevel() end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,c) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then local lv=c:GetOriginalLevel()+tc:GetOriginalLevel() local g=Group.FromCards(c,tc) for oc in aux.Next(g) do local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(lv) oc:RegisterEffect(e1) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is sent from the field to the Graveyard as a Synchro Material: You can add 1 "Shiranui" card from your Deck to your hand, except "Shiranui Smith". You can only use this effect of "Shiranui Smith" once per turn. If this card is banished: You can activate this effect; this turn, Zombie-Type monsters you control cannot be destroyed by battle.
--不知火の鍛師 --Shiranui Smith local s,id=GetID() function s.initial_effect(c) --to hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BE_MATERIAL) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) -- local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_REMOVE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetOperation(s.operation) c:RegisterEffect(e2) end s.listed_series={SET_SHIRANUI} s.listed_names={id} function s.filter(c) return c:IsSetCard(SET_SHIRANUI) and not c:IsCode(id) and c:IsAbleToHand() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_ONFIELD) and r==REASON_SYNCHRO end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,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 g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(s.target) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetValue(1) Duel.RegisterEffect(e1,tp) end function s.target(e,c) return c:IsRace(RACE_ZOMBIE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card destroys an opponent's monster by battle, your opponent cannot activate Trap Cards during the next turn.
--平穏の賢者 --Sage of Stillness local s,id=GetID() function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCondition(s.condition) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsRelateToBattle() and c:GetBattleTarget():IsMonster() end function s.operation(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(0,1) e1:SetCondition(s.accon) e1:SetValue(s.aclimit) e1:SetLabel(Duel.GetTurnCount()) e1:SetReset(RESET_PHASE|PHASE_END,2) Duel.RegisterEffect(e1,tp) end function s.accon(e) return e:GetLabel()~=Duel.GetTurnCount() end function s.aclimit(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsTrapEffect() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 5 WATER monsters During either player's turn: You can detach 1 Xyz Material from this card, then target 1 face-up monster on the field; its ATK becomes half its current ATK until the end of your turn.
--No.94 極氷姫クリスタル・ゼロ --Number 94: Crystalzero local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsAttribute,ATTRIBUTE_WATER),5,2) c:EnableReviveLimit() --atk down local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.xyz_number=94 function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(tc:GetAttack()/2) if Duel.IsTurnPlayer(1-tp) then e1:SetReset(RESETS_STANDARD_PHASE_END,2) else e1:SetReset(RESETS_STANDARD_PHASE_END,1) end tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a "Gladiator Beast" monster Special Summoned from the Deck/Extra Deck, you can Special Summon this card (from your hand). You can only Special Summon "Test Bear" once per turn this way. You can Tribute this card, then shuffle 1 "Gladiator Beast" monster from your hand or face-up field into the Deck/Extra Deck; Special Summon up to 2 "Gladiator Beast" monsters from your Deck. (This is treated as a Special Summon by a "Gladiator Beast" monster's effect.) You can only use this effect of "Test Bear" once per turn.
--スレイブベアー --Test Bear --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Special Summon this card (from your hand) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.selfspcon) c:RegisterEffect(e1) --Special Summon up to 2 "Gladiator Beast" monsters from your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCost(s.deckspcost) e2:SetTarget(s.decksptg) e2:SetOperation(s.deckspop) c:RegisterEffect(e2) end s.listed_series={SET_GLADIATOR_BEAST} function s.selfspconfilter(c) return c:IsSetCard(SET_GLADIATOR_BEAST) and c:IsSummonLocation(LOCATION_DECK|LOCATION_EXTRA) and c:IsFaceup() end function s.selfspcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.selfspconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.deckspcostfilter(c,tp,mzone_chk) return c:IsSetCard(SET_GLADIATOR_BEAST) and c:IsMonster() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToDeckOrExtraAsCost() and (mzone_chk or Duel.GetMZoneCount(tp,c)>0) end function s.deckspcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local mzone_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return c:IsReleasable() and Duel.IsExistingMatchingCard(s.deckspcostfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,tp,mzone_chk) end Duel.Release(c,REASON_COST) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local sc=Duel.SelectMatchingCard(tp,s.deckspcostfilter,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,tp,mzone_chk):GetFirst() if sc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,sc) else Duel.HintSelection(sc) end Duel.SendtoDeck(sc,nil,SEQ_DECKSHUFFLE,REASON_COST) end function s.deckspfilter(c,e,tp) return c:IsSetCard(SET_GLADIATOR_BEAST) and c:IsCanBeSpecialSummoned(e,100,tp,false,false) end function s.decksptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.deckspfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.deckspop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end ft=math.min(ft,2) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.deckspfilter,tp,LOCATION_DECK,0,1,ft,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,100,tp,tp,false,false,POS_FACEUP)>0 then for sc in g:Iter() do sc:RegisterFlagEffect(sc:GetOriginalCode(),RESET_EVENT|RESETS_STANDARD_DISABLE,0,1) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Your opponent cannot target "Blue-Eyes White Dragon" in your Monster Zone with card effects. If this face-up card is sent from the Spell & Trap Zone to the GY: Destroy all monsters you control. You can only use the following effect of "True Light" once per turn. You can activate 1 of these effects; ● Special Summon 1 "Blue-Eyes White Dragon" from your hand or GY. ● Set 1 Spell/Trap directly from your Deck, that specifically lists "Blue-Eyes White Dragon" in its text, with a different name from the cards you control and in your GY.
--真の光 --True Light --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) c:RegisterEffect(e1) --Targeting immunity local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsCode,CARD_BLUEEYES_W_DRAGON)) e2:SetValue(aux.tgoval) c:RegisterEffect(e2) --Destroy local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_TO_GRAVE) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) --Special Summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetRange(LOCATION_SZONE) e4:SetHintTiming(0,TIMING_END_PHASE) e4:SetCountLimit(1,id) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) --Set Spell/Trap local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,2)) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_SZONE) e5:SetHintTiming(0,TIMING_END_PHASE) e5:SetCountLimit(1,id) e5:SetTarget(s.settg) e5:SetOperation(s.setop) c:RegisterEffect(e5) end s.listed_names={CARD_BLUEEYES_W_DRAGON} function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_SZONE) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil) Duel.Destroy(g,REASON_EFFECT) end function s.spfilter(c,e,tp) return c:IsCode(CARD_BLUEEYES_W_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 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_GRAVE,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|LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if 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,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.setfilter(c,tp) return c:IsSpellTrap() and c:IsSSetable() and c:ListsCode(CARD_BLUEEYES_W_DRAGON) and not Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,c:GetCode()),tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,1,nil) end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) end function s.setop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil,tp) if #sg==0 then return end Duel.SSet(tp,sg) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 FIRE monster on the field; equip this card to it as an Equip Card that gives it 700 ATK, then you can change 1 Effect Monster on the field to face-down Defense Position. You can banish this card from your GY; Fusion Summon 1 FIRE Warrior or Dragon Fusion Monster from your Extra Deck, by shuffling its materials from your hand, field, and/or GY into the Deck, but destroy it during the End Phase. You can only use this effect of "Salamandra with Chain" once per turn.
--鎖付き飛龍炎刃 --Salamandra with Chain --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Equip this card to a FIRE monster local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCost(aux.RemainFieldCost) e1:SetTarget(s.eqptg) e1:SetOperation(s.eqpop) c:RegisterEffect(e1) --Fusion Summon 1 FIRE Warrior or Dragon Fusion Monster shuffling materials from your hand, field, and/or GY local params = {fusfilter=s.fusmonfilter, matfilter=Card.IsAbleToDeck, extrafil=s.extramat, extraop=Fusion.ShuffleMaterial, extratg=s.extratg, stage2=s.stage2} local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1,id) e2:SetCost(Cost.SelfBanish) e2:SetTarget(Fusion.SummonEffTG(params)) e2:SetOperation(Fusion.SummonEffOP(params)) c:RegisterEffect(e2) end function s.eqptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsAttribute(ATTRIBUTE_FIRE) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_FIRE),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_FIRE),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.posfilter(c) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsCanTurnSet() end function s.eqpop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Equip(tp,c,tc) then --Equipped monster gain 700 ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(700) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) --Equip limit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_EQUIP_LIMIT) e2:SetValue(function(e,cc) return cc:IsAttribute(ATTRIBUTE_FIRE) end) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e2) --Change 1 Effect Monster on the field to face-down Defense Position local pg=Duel.GetMatchingGroup(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #pg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local tc=pg:Select(tp,1,1,nil) Duel.HintSelection(tc,true) Duel.BreakEffect() Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) end else c:CancelToGrave(false) end end function s.fusmonfilter(c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_WARRIOR|RACE_DRAGON) end function s.extramat(e,tp,mg,sumtype) return Duel.GetMatchingGroup(aux.NecroValleyFilter(Fusion.IsMonsterFilter(Card.IsAbleToDeck)),tp,LOCATION_GRAVE,0,nil) end function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_HAND|LOCATION_MZONE|LOCATION_GRAVE) end function s.stage2(e,tc,tp,sg,chk) if chk==0 then --Destroy it during the End Phase aux.DelayedOperation(tc,PHASE_END,id,e,tp,function(cc) Duel.Destroy(cc,REASON_EFFECT) end,nil,0,1,aux.Stringid(id,3)) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must be Special Summoned (from your hand or GY) by Tributing 2 Link Monsters. If this card is Special Summoned: You can activate this effect; if your opponent controls 3 or more cards, they must send cards to the GY so they control 2 cards. You can only use this effect of "Evil★Twins Ki-sikil & Lil-la" once per turn. While you have a "Ki-sikil" monster in your GY and you have a "Lil-la" monster in your GY, this card gains 2200 ATK/DEF.
--Evil★Twins キスキル・リィラ --Evil★Twins Ki-sikil & Lil-la --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Cannot be Special Summoned except by procedure local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1) --Special Summon by tributing 2 Link monsters local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetRange(LOCATION_GRAVE) c:RegisterEffect(e3) --Make opponent send cards to GY local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TOGRAVE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetCountLimit(1,id) e4:SetTarget(s.tgtg) e4:SetOperation(s.tgop) c:RegisterEffect(e4) --Gain ATK/DEF with Kiskil and Lilla in GY local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_UPDATE_ATTACK) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e5:SetRange(LOCATION_MZONE) e5:SetCondition(s.atkcon) e5:SetValue(2200) c:RegisterEffect(e5) local e6=e5:Clone() e6:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e6) end s.listed_series={SET_KI_SIKIL,SET_LIL_LA} function s.rfilter(c,tp) return c:IsLinkMonster() and (c:IsControler(tp) or c:IsFaceup()) end function s.spcon(e,c) if c==nil then return true end return Duel.CheckReleaseGroup(c:GetControler(),s.rfilter,2,false,2,true,c,nil,nil,nil,nil,c:GetControler()) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local g=Duel.SelectReleaseGroup(tp,s.rfilter,2,2,false,true,true,c,nil,nil,false,nil,tp) if g then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Release(g,REASON_COST) g:DeleteGroup() end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>2 end end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) local ct=#g-2 if ct>0 then Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE) local sg=g:Select(1-tp,ct,ct,nil) Duel.SendtoGrave(sg,REASON_RULE,PLAYER_NONE,1-tp) end end function s.atkcon(e) local g=Duel.GetFieldGroup(e:GetHandler():GetControler(),LOCATION_GRAVE,0) return g:IsExists(Card.IsSetCard,1,nil,SET_KI_SIKIL) and g:IsExists(Card.IsSetCard,1,nil,SET_LIL_LA) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a monster is banished by the effect of "Galaxy-Eyes Photon Dragon": You can send this card from your hand to the Graveyard; inflict 3000 damage to your opponent. You can only use the effect of "Dimension Wanderer" once per turn.
--ディメンション・ワンダラー --Dimension Wanderer local s,id=GetID() function s.initial_effect(c) --damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_REMOVE) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) e1:SetCost(Cost.SelfToGrave) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={CARD_GALAXYEYES_P_DRAGON} function s.condition(e,tp,eg,ep,ev,re,r,rp) return (r&REASON_EFFECT)~=0 and re and re:GetHandler():IsCode(CARD_GALAXYEYES_P_DRAGON) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(3000) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,3000) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each time this card inflicts Battle Damage to your opponent: It gains 100 ATK and loses 100 DEF. While you control another face-up "Elemental HERO" monster, your opponent cannot target this card for an attack, and this card can attack your opponent directly.
--E・HERO クノスペ --Elemental HERO Knospe local s,id=GetID() function s.initial_effect(c) --direct attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCondition(s.atcon) c:RegisterEffect(e1) --atk/def local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCondition(s.adcon) e2:SetOperation(s.adop) c:RegisterEffect(e2) -- local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.atcon) e3:SetValue(aux.imval1) c:RegisterEffect(e3) end s.listed_series={SET_ELEMENTAL_HERO} function s.adcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end function s.adop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() and c:GetDefense()>=100 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetValue(100) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetValue(-100) c:RegisterEffect(e2) end end function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_ELEMENTAL_HERO) end function s.atcon(e) return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Cyberse monster + 1 Link Monster After this card is Fusion Summoned, you take no damage for the rest of this turn. If this card attacks a monster that was Special Summoned from the Extra Deck, this card gains ATK equal to its original ATK during the Damage Step only. When this card is destroyed by battle: You can target 1 Cyberse monster in your GY, except "Earth Golem @Ignister"; Special Summon it. You can only use this effect of "Earth Golem @Ignister" once per turn.
--アースゴーレム@イグニスター --Earth Golem @Ignister --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsRace,RACE_CYBERSE),aux.FilterBoolFunctionEx(Card.IsType,TYPE_LINK)) --change damage local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetOperation(s.regop) c:RegisterEffect(e1) --atk local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCondition(s.atkcon) e2:SetValue(s.atkval) c:RegisterEffect(e2) --spsummon 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:SetCode(EVENT_BATTLE_DESTROYED) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1,id) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_names={id} function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsFusionSummoned() then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CHANGE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetValue(0) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_NO_EFFECT_DAMAGE) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e3:SetReset(RESET_PHASE|PHASE_END) e3:SetTargetRange(1,0) Duel.RegisterEffect(e3,tp) end function s.atkcon(e) local ph=Duel.GetCurrentPhase() local c=e:GetHandler() local tc=c:GetBattleTarget() return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and Duel.GetAttacker()==c and tc and tc:GetSummonLocation()==LOCATION_EXTRA end function s.atkval(e,c) return c:GetBaseAttack() end function s.filter(c,e,tp) return c:IsRace(RACE_CYBERSE) 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,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(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 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) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase, you can Normal Summon 1 "Synchron" monster in addition to your Normal Summon/Set. (You can only gain this effect once per turn.) If another "Synchron" monster is sent to your GY as material for the Synchro Summon of a Warrior or Machine Synchro Monster, while you control this card: You can Special Summon 1 "Synchron Token" (Machine/EARTH/Level 2/ATK 1000/DEF 0). You can only use this effect of "Synchron Carrier" once per turn.
--シンクロン・キャリアー --Synchron Carrier local s,id=GetID() function s.initial_effect(c) --extra summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_SYNCHRON)) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={62125439} s.listed_series={SET_SYNCHRON} function s.filter(c,tp) return c:IsSetCard(SET_SYNCHRON) and c:IsMonster() and c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil,tp) and r==REASON_SYNCHRO and re:GetHandler():IsRace(RACE_WARRIOR|RACE_MACHINE) 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.IsPlayerCanSpecialSummonMonster(tp,id+1,SET_SYNCHRON,TYPES_TOKEN,1000,0,2,RACE_MACHINE,ATTRIBUTE_EARTH) end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,SET_SYNCHRON,TYPES_TOKEN,1000,0,2,RACE_MACHINE,ATTRIBUTE_EARTH) then local token=Duel.CreateToken(tp,id+1) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Your opponent cannot target "Vernusylph" monsters you control with card effects. You can discard this card, and 1 monster or "Vernusylph" card; add 1 EARTH monster from your GY to your hand, except "Vernusylph of the Flowering Fields", then you can Special Summon 1 EARTH monster from your GY, also you cannot activate non-EARTH monster effects for the rest of this turn. You can only use this effect of "Vernusylph of the Flowering Fields" once per turn.
--花と野原の春化精 --Vernusylph of the Flowering Fields --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Effect targetting protection local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_VERNUSYLPH)) e1:SetValue(aux.tgoval) c:RegisterEffect(e1) --Add 1 "Vernalizer Fairy" card from the GY to the hand c:RegisterEffect(Effect.CreateVernalizerSPEffect(c,id,0,CATEGORY_TOHAND,s.thtg,s.thop)) end s.listed_names={id} s.listed_series={SET_VERNUSYLPH} function s.thfilter(c) return c:IsAttribute(ATTRIBUTE_EARTH) and not c:IsCode(id) 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_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) 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_GRAVE,0,1,1,nil) if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,g) return true end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned, place 1 Spell Counter on it (max. 1). You can remove 1 Spell Counter from this card to have 1 face-up monster you control gain 500 ATK, until the End Phase.
--マジカルフィシアリスト --Frequency Magician local s,id=GetID() function s.initial_effect(c) c:EnableCounterPermit(COUNTER_SPELL) c:SetCounterLimit(COUNTER_SPELL,1) --summon success local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_COUNTER) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.addct) e1:SetOperation(s.addc) c:RegisterEffect(e1) --attackup local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCost(s.atkcost) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end s.counter_place_list={COUNTER_SPELL} function s.addct(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,COUNTER_SPELL) end function s.addc(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then e:GetHandler():AddCounter(COUNTER_SPELL,1) end end function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,COUNTER_SPELL,1,REASON_COST) end e:GetHandler():RemoveCounter(tp,COUNTER_SPELL,1,REASON_COST) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(500) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If "Obsidim, the Ashened City" is in the Field Zone, you can Special Summon this card (from your hand). You can only Special Summon "Spearhead of the Ashened City" once per turn this way. If your opponent controls a monster with 2800 or more ATK: You can Tribute this card, then target 1 card your opponent controls; return it to the hand. You can only use this effect of "Spearhead of the Ashened City" once per turn.
--灰滅せし都の先懸 --Spearhead of the Ashened City --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Special Summon this card (from your hand) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.selfspcon) c:RegisterEffect(e1) --Return 1 card your opponent controls to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttackAbove,2800),tp,0,LOCATION_MZONE,1,nil) end) e2:SetCost(Cost.SelfTribute) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_names={CARD_OBSIDIM_ASHENED_CITY} function s.selfspcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_OBSIDIM_ASHENED_CITY),0,LOCATION_FZONE,LOCATION_FZONE,1,nil) end function s.thfilter(c,rc) return c:IsAbleToHand() and not (rc and rc:GetEquipGroup():IsContains(c)) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.thfilter(chkc,c) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,0,LOCATION_ONFIELD,1,nil,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil) 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() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a monster(s) was destroyed during this turn, while you controlled it: Excavate the top 5 cards of your Deck, then you can Special Summon 1 excavated "Performapal" monster, also shuffle the rest back into your Deck.
--イリュージョン・バルーン --Illusion Balloons local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_DESTROYED) ge1:SetOperation(s.checkop) Duel.RegisterEffect(ge1,0) end) end s.listed_series={SET_PERFORMAPAL} function s.checkop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() local p1=false local p2=false for tc in aux.Next(eg) do if tc:IsPreviousLocation(LOCATION_MZONE) then if tc:IsPreviousControler(0) then p1=true else p2=true end end end if p1 then Duel.RegisterFlagEffect(0,id,RESET_PHASE|PHASE_END,0,1) end if p2 then Duel.RegisterFlagEffect(1,id,RESET_PHASE|PHASE_END,0,1) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFlagEffect(tp,id)~=0 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.filter(c,e,tp) return c:IsSetCard(SET_PERFORMAPAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end Duel.ConfirmDecktop(tp,5) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local g=Duel.GetDecktopGroup(tp,5):Filter(s.filter,nil,e,tp) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end Duel.ShuffleDeck(tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can add 1 "Dream Mirror" monster from your Deck to your hand. If "Dream Mirror of Joy" is in a Field Zone, all monsters you control gain 500 ATK/DEF. If "Dream Mirror of Terror" is in a Field Zone, all monsters your opponent controls lose 500 ATK/DEF. You can only activate 1 "Dream Mirror Phantasms" per turn.
--夢幻の夢魔鏡 --Dream Mirror Phantasms --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --When activated, add 1 "Dream Mirror" monster from deck local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Your monsters gain 500 ATK/DEF while "Dream Mirror of Joy" is on the field local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCondition(s.condition(CARD_DREAM_MIRROR_JOY)) e2:SetValue(500) c:RegisterEffect(e2) local e3=e2:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e3) --Your opponent's monsters lose 500 ATK/DEF while "Dream Mirror of Terror" is on the field local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetRange(LOCATION_SZONE) e4:SetTargetRange(0,LOCATION_MZONE) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetCondition(s.condition(CARD_DREAM_MIRROR_TERROR)) e4:SetValue(-500) c:RegisterEffect(e4) local e5=e4:Clone() e4:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e5) end s.listed_series={SET_DREAM_MIRROR} s.listed_names={CARD_DREAM_MIRROR_JOY,CARD_DREAM_MIRROR_TERROR} function s.filter(c) return c:IsSetCard(SET_DREAM_MIRROR) and c:IsMonster() and c:IsAbleToHand() end function s.activate(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end function s.condition(cid) return function(e,c) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,cid),0,LOCATION_FZONE,LOCATION_FZONE,1,nil) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 Illusion or Spellcaster monster you control; return that face-up monster to the hand or Extra Deck, then Special Summon 1 Illusion or Spellcaster monster from your GY or banishment. If this card is sent to the GY to activate a monster effect: You can Set this card. You can only use each effect of "Susurrus of the Sinful Spoils" once per turn.
--罪宝の囁き --Susurrus of the Sinful Spoils --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Return 1 Illusion or Spellcaster to the hand or Extra Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetTarget(s.rttg) e1:SetOperation(s.rtop) c:RegisterEffect(e1) --Set this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_LEAVE_GRAVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsMonsterEffect() end) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) end s.listed_series={SET_WHITE_FOREST} function s.rtfilter(c,tp) return c:IsRace(RACE_ILLUSION|RACE_SPELLCASTER) and c:IsFaceup() and Duel.GetMZoneCount(tp,c)>0 and (c:IsAbleToExtra() or c:IsAbleToHand()) end function s.spfilter(c,e,tp) return c:IsRace(RACE_ILLUSION|RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.rttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.rtfilter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(s.rtfilter,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.rtfilter,tp,LOCATION_MZONE,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_REMOVED) end function s.rtop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and (tc:IsType(TYPE_EXTRA) and (Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_EXTRA)) or (Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND))) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) if #g>0 then Duel.BreakEffect() Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsSSetable() end 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() if c:IsRelateToEffect(e) and c:IsSSetable() then Duel.SSet(tp,c) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Special Summoned. Must be Normal Summoned/Set by Tributing 3 monsters. The ATK/DEF of all other monsters on the field are halved.
--邪神ドレッド・ルート --The Wicked Dreadroot local s,id=GetID() function s.initial_effect(c) --summon with 3 tribute local e1=aux.AddNormalSummonProcedure(c,true,false,3,3) local e2=aux.AddNormalSetProcedure(c,true,false,3,3) --cannot special summon local e3=Effect.CreateEffect(c) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e3) --half atk local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_SET_ATTACK_FINAL) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e4:SetTarget(s.atktg) e4:SetValue(s.atkval) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_SET_DEFENSE_FINAL) e5:SetValue(s.defval) c:RegisterEffect(e5) end function s.atktg(e,c) return c~=e:GetHandler() end function s.atkval(e,c) return math.ceil(c:GetAttack()/2) end function s.defval(e,c) return math.ceil(c:GetDefense()/2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Zombie monsters gain 500 ATK during damage calculation only. Once per turn, when a card(s) is sent from your opponent's Deck to the GY: Target 1 card on the field; send 1 DARK "Vampire" monster from your hand or Deck to the GY, and if you do, destroy that target.
--ヴァンパイア帝国 --Vampire Kingdom local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --atk local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_FZONE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_ZOMBIE)) e2:SetCondition(s.atkcon) e2:SetValue(500) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOGRAVE+CATEGORY_HANDES+CATEGORY_DECKDES) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_series={SET_VAMPIRE} function s.atkcon(e) return Duel.IsPhase(PHASE_DAMAGE_CAL) end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_DECK) and c:IsPreviousControler(tp) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,1-tp) end function s.tgfilter(c) return c:IsSetCard(SET_VAMPIRE) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end if chk==0 then return e:GetHandler():IsRelateToEffect(e) and not e:GetHandler():IsStatus(STATUS_CHAINING) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_GRAVE) if ct>0 then local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, if you Normal or Special Summon a "Gunkan" monster(s), even during the Damage Step: You can place 1 "Gunkan" card from your Deck on top of your Deck. Once per turn, if a face-up "Gunkan" monster(s) you control that was Special Summoned from the Extra Deck is sent to your GY by an opponent's card: Activate this effect; your opponent pays LP exactly equal to that monster's DEF in the GY, then you can apply this effect. ● Special Summon 1 "Gunkan Suship Shari" from your hand, then Special Summon 1 "Gunkan" Xyz Monster from your Extra Deck, by using that card you control as material. (This is treated as an Xyz Summon.)
--軍貫処『海せん』 --Gunkan Sushipyard Seaside Supper Spot --Scripted by The Razgriz 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 "Gunkan" card from your Deck on top of your Deck local e1a=Effect.CreateEffect(c) e1a:SetDescription(aux.Stringid(id,0)) e1a:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1a:SetCode(EVENT_SUMMON_SUCCESS) e1a:SetRange(LOCATION_FZONE) e1a:SetCountLimit(1,0,EFFECT_COUNT_CODE_SINGLE) e1a:SetCondition(s.decktopcon) e1a:SetTarget(s.decktoptg) e1a:SetOperation(s.decktopop) c:RegisterEffect(e1a) local e1b=e1a:Clone() e1b:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e1b) --Your opponent pays LP exactly equal to that monster's DEF in the 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_F) e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1) e3:SetCondition(s.xyzcon) e3:SetTarget(s.xyztg) e3:SetOperation(s.xyzop) c:RegisterEffect(e3) end s.listed_series={SET_GUNKAN} s.listed_names={CARD_SUSHIP_SHARI} function s.decktopconfilter(c,tp) return c:IsSetCard(SET_GUNKAN) and c:IsSummonPlayer(tp) and c:IsFaceup() end function s.decktopcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.decktopconfilter,1,nil,tp) end function s.decktoptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,SET_GUNKAN) end end function s.decktopop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local sc=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,SET_GUNKAN):GetFirst() if sc then Duel.ShuffleDeck(tp) Duel.MoveSequence(sc,0) Duel.ConfirmDecktop(tp,1) end end function s.xyzconfilter(c,tp) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsReasonPlayer(1-tp) and c:IsSetCard(SET_GUNKAN) and c:IsPreviousSetCard(SET_GUNKAN) and c:IsSummonLocation(LOCATION_EXTRA) end function s.xyzcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.xyzconfilter,1,nil,tp) end function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=eg:Filter(s.xyzconfilter,nil,tp) Duel.SetTargetCard(g) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND|LOCATION_EXTRA) end function s.spfilter(c,e,tp) return c:IsCode(CARD_SUSHIP_SHARI) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.xyzfilter(c,e,tp) return c:IsSetCard(SET_GUNKAN) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c) end function s.xyzop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g==0 then return end local def=0 for tc in g:Iter() do if tc:GetPreviousDefenseOnField()<0 then def=0 end def=def+tc:GetPreviousDefenseOnField() end if not Duel.CheckLPCost(1-tp,def) then return end Duel.PayLPCost(1-tp,def) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) Duel.BreakEffect() if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local xyzc=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() if xyzc then Duel.BreakEffect() xyzc:SetMaterial(sg) Duel.Overlay(xyzc,sg) if Duel.SpecialSummon(xyzc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then xyzc:CompleteProcedure() end end end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can add 1 "Myutant" monster from your Deck to your hand, except "Myutant M-05". You can Tribute this card, then banish 1 card from your hand or face-up field; Special Summon 1 monster from your hand or Deck, based on the banished card. ● Monster: "Myutant Beast" ● Spell: "Myutant Mist" ● Trap: "Myutant Arsenal" You can only use each effect of "Myutant M-05" once per turn.
--被検体ミュートリアM-05 --Myutant M-05 --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --If Normal or Special Summoned, add 1 "Myutant" monster from Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Special Summon 1 "Myutant" monster from hand or Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCost(s.spcost) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_MYUTANT} s.listed_names={CARD_MYUTANT_BEAST,CARD_MYUTANT_MIST,CARD_MYUTANT_ARSENAL} function s.thfilter(c) return c:IsSetCard(SET_MYUTANT) and c:IsMonster() and c:IsAbleToHand() and not c:IsCode(id) 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 Duel.SetOperationInfo(0,CATEGORY_TOHAND,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 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) end end function s.spfilter(c,e,tp,code) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.getspcode(c) local type=c:GetOriginalType() if type&TYPE_MONSTER==TYPE_MONSTER then return CARD_MYUTANT_BEAST end if type&TYPE_SPELL==TYPE_SPELL then return CARD_MYUTANT_MIST end return type&TYPE_TRAP==TYPE_TRAP and CARD_MYUTANT_ARSENAL or -1 end function s.spcostfilter(c,e,tp,ft) return (c:IsFaceup() or not c:IsOnField()) and c:IsAbleToRemoveAsCost() and (ft>0 or Duel.GetMZoneCount(tp,c)>0) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,c,e,tp,s.getspcode(c)) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local ft=Duel.GetMZoneCount(tp,c) if chk==0 then return c:IsReleasable() and Duel.IsExistingMatchingCard(s.spcostfilter,tp,LOCATION_ONFIELD|LOCATION_HAND,0,1,c,e,tp,ft) end Duel.Release(c,REASON_COST) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local rg=Duel.SelectMatchingCard(tp,s.spcostfilter,tp,LOCATION_ONFIELD|LOCATION_HAND,0,1,1,c,e,tp,ft) e:SetLabel(s.getspcode(rg:GetFirst())) Duel.Remove(rg,POS_FACEUP,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local code=e:GetLabel() if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 or not code 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,code) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 "Mayakashi" or "Shiranui" Synchro or Link Monster; neither player can Special Summon monsters from the hand, Deck, or Extra Deck for the rest of this turn. You can banish this card from your GY, then target 1 of your banished Zombie monsters; return it to the GY. You can only use 1 "Ghost Meets Girl - A Masterful Mayakashi Shiranui Saga" effect per turn, and only once that turn.
--逢華妖麗譚-魔妖不知火語 --Ghost Meets Girl - A Masterful Mayakashi Shiranui Saga --Scripted by Nellag 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:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetCountLimit(1,id) e1:SetCost(s.cost) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Return 1 of your banished Zombies to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) 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) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end --"Shiranui" + "Mayakashi" s.listed_series={SET_SHIRANUI,SET_MAYAKASHI} function s.cfilter(c) return c:IsSetCard({SET_SHIRANUI,SET_MAYAKASHI}) and (c:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_LINK)) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local g=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil) Duel.Release(g,REASON_COST) end function s.activate(e,tp,eg,ep,ev,re,r,rp) --Cannot Special Summon from the hand, Deck, or Extra Deck local e0=Effect.CreateEffect(e:GetHandler()) e0:SetDescription(aux.Stringid(id,2)) e0:SetType(EFFECT_TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e0:SetTargetRange(1,1) e0:SetTarget(s.splimit) e0:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e0,tp) end function s.splimit(e,c,tp) return c:IsLocation(LOCATION_HAND|LOCATION_DECK|LOCATION_EXTRA) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and chkc:IsFaceup() and chkc:IsRace(RACE_ZOMBIE) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsRace,RACE_ZOMBIE),tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g = Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsRace,RACE_ZOMBIE),tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoGrave(tc,REASON_EFFECT|REASON_RETURN) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Tuners + 1 non-Tuner DARK Dragon Synchro Monster When this card is Synchro Summoned: You can activate this effect; for the rest of this turn, your opponent cannot activate cards or effects on the field. Your opponent cannot activate cards or effects in response to this effect's activation. If this card destroys a monster by battle: Inflict damage to your opponent equal to that monster's original ATK. If this card in its owner's possession is destroyed by an opponent's card: You can target 1 Level 8 or lower DARK Dragon Synchro Monster in your GY; Special Summon it.
--琰魔竜王 レッド・デーモン・カラミティ --Hot Red Dragon Archfiend King Calamity local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Synchro Summon Procedure Synchro.AddProcedure(c,nil,2,2,Synchro.NonTunerEx(s.matfilter),1,1) --Opponent cannot activate card or effects of cards they control for the rest of the turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(function(e) return e:GetHandler():IsSynchroSummoned() end) e1:SetTarget(s.limtg) e1:SetOperation(s.limop) c:RegisterEffect(e1) --Inflict damage equal to the ATK of a monster destroyed by battle local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DAMAGE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EVENT_BATTLE_DESTROYING) e3:SetCondition(aux.bdcon) e3:SetTarget(s.damtg) e3:SetOperation(s.damop) c:RegisterEffect(e3) --Special Summon 1 Level 8 or lower DARK Synchro monster from the GY local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DESTROYED) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetCondition(s.spcon) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) --Multiple tuners local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e5:SetCode(EFFECT_MULTIPLE_TUNERS) c:RegisterEffect(e5) end s.synchro_nt_required=1 function s.matfilter(c,val,scard,sumtype,tp) return c:IsRace(RACE_DRAGON,scard,sumtype,tp) and c:IsAttribute(ATTRIBUTE_DARK,scard,sumtype,tp) and c:IsType(TYPE_SYNCHRO,scard,sumtype,tp) end function s.limtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetChainLimit(s.chainlm) end function s.chainlm(e,rp,tp) return tp==rp end function s.limop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,3)) e1:SetTargetRange(0,1) e1:SetValue(s.aclimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.aclimit(e,re,tp) return re:GetHandler():IsOnField() or re:IsHasType(EFFECT_TYPE_ACTIVATE) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local dam=e:GetHandler():GetBattleTarget():GetBaseAttack() if dam<0 then dam=0 end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and e:GetHandler():IsPreviousControler(tp) end function s.spfilter(c,e,tp) return c:IsLevelBelow(8) and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) 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.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) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Monsters you control gain 300 ATK for each different Attribute you control. "Charmer" and "Familiar-Possessed" monsters you control cannot be destroyed by card effects. If a Spellcaster monster(s) with 1850 original ATK is Normal or Special Summoned to your field: Draw 1 card. You can only use this effect of "Awakening of the Possessed" once per turn.
--憑依覚醒 --Awakening of the Possessed --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Monsters you control gain 300 ATK for each different Attribute you control local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetValue(s.atkval) c:RegisterEffect(e2) --"Charmer" and "Familiar-Possessed" monsters you control cannot be destroyed by card effects local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTarget(s.indtg) e3:SetValue(1) c:RegisterEffect(e3) --Draw 1 card local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_DRAW) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetRange(LOCATION_SZONE) e4:SetCondition(s.drcon) e4:SetTarget(s.drtg) e4:SetOperation(s.drop) e4:SetCountLimit(1,id) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e5) end s.listed_series={SET_CHARMER,SET_FAMILIAR_POSSESSED} function s.atkval(e,c) local g=Duel.GetMatchingGroup(Card.IsFaceup,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil) return 300*g:GetBinClassCount(Card.GetAttribute) end function s.indtg(e,c) return c:IsFaceup() and c:IsSetCard({SET_CHARMER,SET_FAMILIAR_POSSESSED}) end function s.cfilter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:GetBaseAttack()==1850 and c:IsRace(RACE_SPELLCASTER) end function s.drcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) 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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can discard 1 card, then activate 1 of these effects; ● Add 1 Level 4 or lower "Dragunity" monster from your Deck to your hand. ● Send 1 Dragon monster from your Deck to the GY.
--竜の渓谷 --Dragon Ravine local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Activate 1 of these effects local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1) e2:SetCost(s.effcost) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) c:RegisterEffect(e2) end s.listed_series={SET_DRAGUNITY} function s.effcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.thfilter(c) return c:IsLevelBelow(4) and c:IsSetCard(SET_DRAGUNITY) and c:IsAbleToHand() end function s.tgfilter(c) return c:IsRace(RACE_DRAGON) and c:IsAbleToGrave() end 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_DECK,0,1,nil) 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_TOHAND+CATEGORY_SEARCH) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) elseif op==2 then e:SetCategory(CATEGORY_TOGRAVE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local op=e:GetLabel() if op==1 then --Search 1 Level 4 or lower "Dragunity" monster 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 Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end elseif op==2 then --Send 1 Dragon monster from your Deck to the GY Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent's monster declares an attack on your Normal Monster: Destroy all monsters on the field, except Attack Position Normal Monsters.
--ジャスティブレイク --Justi-Break local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local at=Duel.GetAttackTarget() return Duel.IsTurnPlayer(1-tp) and at and at:IsFaceup() and at:IsType(TYPE_NORMAL) end function s.filter(c) return not (c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsAttackPos()) 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,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When an opponent's monster declares an attack: Target the attacking monster; negate the attack, and if you do, inflict damage to your opponent equal to its ATK.
--魔法の筒 --Magic Cylinder local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DAMAGE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return tp==1-Duel.GetTurnPlayer() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local tg=Duel.GetAttacker() if chkc then return chkc==tg end if chk==0 then return tg and tg:IsOnField() and tg:IsCanBeEffectTarget(e) end Duel.SetTargetCard(tg) local dam=tg:GetAttack() Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then if Duel.NegateAttack() then Duel.Damage(1-tp,tc:GetAttack(),REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, if a face-up Link Monster you control is destroyed by battle, or leaves the field because of an opponent's card effect: You can Special Summon 1 "World Legacy" monster from your hand or Deck in Defense Position. You can only control 1 "World Legacy's Corruption".
--星遺物が導く果て --World Legacy's Corruption -- local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_WORLD_LEGACY} function s.cfilter(c,tp,rp) return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and (c:GetPreviousTypeOnField()&TYPE_LINK)~=0 and (c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT))) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp,rp) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_WORLD_LEGACY) 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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 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) if 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_DECK|LOCATION_HAND,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a Cyberse Link Monster you control is destroyed by an opponent's card effect while this card is in your hand or GY (except during the Damage Step): You can Special Summon this card. You can discard 1 Spell, then target 1 Cyberse monster in your GY; Special Summon it, but it cannot attack directly this turn. You can only use each effect of "Salvagent Driver" once per turn.
--サルベージェント・ドライバー --Salvagent Driver local s,id=GetID() function s.initial_effect(c) --Special summon itself from hand or GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon1) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) c:RegisterEffect(e1) --Special summon 1 cyberse monster from GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCost(s.spcost2) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end function s.cfilter(c,tp) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and (c:GetPreviousTypeOnField()&TYPE_LINK)~=0 and (c:GetPreviousRaceOnField()&RACE_CYBERSE)~=0 end function s.spcon1(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and eg:IsExists(s.cfilter,1,e:GetHandler(),tp) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop1(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 function s.costfilter(c) return c:IsSpell() and c:IsDiscardable() end function s.spcost2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.costfilter,1,1,REASON_COST|REASON_DISCARD) end function s.spfilter(c,e,tp) return c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg2(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) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then --Cannot attack directly this turn local e1=Effect.CreateEffect(e:GetHandler()) 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(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] All EARTH, WATER, FIRE, and WIND monsters you control gain 200 ATK/DEF for every different Attribute among the monsters you control. ---------------------------------------- [ Monster Effect ] If this card is Normal or Special Summoned: You can choose 4 monsters from your Deck (1 EARTH, 1 WATER, 1 FIRE, and 1 WIND), then place them on top of the Deck in any order.
--ダーク・ドリアード --Dark Doriado local s,id=GetID() function s.initial_effect(c) --Pendulum Summon Pendulum.AddProcedure(c) --Increase ATK of monsters you control local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_PZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(s.atktg) e1:SetValue(s.value) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) --Place 4 monsters on the top of the Deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetTarget(s.sttg) e3:SetOperation(s.stop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) end local ATTRIBUTES=ATTRIBUTE_EARTH|ATTRIBUTE_WATER|ATTRIBUTE_FIRE|ATTRIBUTE_WIND function s.atktg(e,c) return c:IsAttribute(ATTRIBUTES) end function s.value(e,c) local tp=e:GetHandlerPlayer() return Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetBinClassCount(Card.GetAttribute)*200 end function s.spfilter(c) return c:IsMonster() and c:IsAttribute(ATTRIBUTES) end function s.rescon(sg,e,tp,mg) return true,not sg:CheckDifferentPropertyBinary(function(c)return c:GetAttribute()&(ATTRIBUTES)end) end function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil) if chk==0 then return #g>=4 and aux.SelectUnselectGroup(g,e,tp,4,4,s.rescon,0) end end function s.stop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil) local sg=aux.SelectUnselectGroup(g,e,tp,4,4,s.rescon,1,tp,HINTMSG_TARGET) if sg then Duel.ConfirmCards(1-tp,sg) Duel.ShuffleDeck(tp) Duel.MoveToDeckTop(sg) Duel.SortDecktop(tp,tp,4) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate only while "Visas Starfrost" is on the field. Once per turn, if a monster(s) you control is destroyed by battle or card effect, and sent to the GY or banished: You can activate 1 of these effects; ● Special Summon 1 of those monsters in Defense Position. ● 1 Tuner on the field gains ATK equal to half the original ATK of 1 of those monsters. ● Shuffle 1 of those monsters into the Deck, and if you do, draw 1 card. ● Shuffle this card into the Deck, and if you do, add 1 Field Spell from your GY to your hand.
--新世壊=アムリターラ --New World - Amritara --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) c:RegisterEffect(e1) --Activate 1 of these effects local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_DESTROYED) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1) e2:SetCondition(s.effcon) e2:SetTarget(s.efftg) e2:SetOperation(s.effop) c:RegisterEffect(e2) end s.listed_names={CARD_VISAS_STARFROST} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_VISAS_STARFROST),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and c:IsFaceup() end function s.effcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local g=eg:Filter(s.cfilter,nil,tp) local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:IsExists(Card.IsCanBeSpecialSummoned,1,nil,e,0,tp,false,false,POS_FACEUP_DEFENSE) local b2=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsType,TYPE_TUNER),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and g:IsExists(Card.IsAttackAbove,1,nil,1) local b3=g:IsExists(Card.IsAbleToDeck,1,nil) and Duel.IsPlayerCanDraw(tp,1) local b4=c:IsAbleToDeck() and Duel.IsExistingMatchingCard(aux.AND(Card.IsFieldSpell,Card.IsAbleToHand),tp,LOCATION_GRAVE,0,1,nil) if chk==0 then return b1 or b2 or b3 or b4 end Duel.SetTargetCard(g) local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,1)}, {b2,aux.Stringid(id,2)}, {b3,aux.Stringid(id,3)}, {b4,aux.Stringid(id,4)}) e:SetLabel(op) if op==1 then e:SetCategory(CATEGORY_SPECIAL_SUMMON) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) elseif op==2 then e:SetCategory(CATEGORY_ATKCHANGE) elseif op==3 then e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) elseif op==4 then e:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end end function s.effop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetTargetCards(e) local op=e:GetLabel() if #g==0 and op~=4 then return end --Special Summon 1 of them in Defense Position if op==1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:FilterSelect(tp,Card.IsCanBeSpecialSummoned,1,1,nil,e,0,tp,false,false,POS_FACEUP_DEFENSE) if #sg>0 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end --1 Tuner on the field gains ATK elseif op==2 and g:IsExists(Card.IsAttackAbove,1,nil,1) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) local tuner=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsType,TYPE_TUNER),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst() if tuner then Duel.HintSelection(tuner,true) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local tc=g:FilterSelect(tp,Card.IsAttackAbove,1,1,nil,1):GetFirst() Duel.HintSelection(tc,true) --Increase ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(tc:GetAttack()/2) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tuner:RegisterEffect(e1) end --Shuffle 1 of them into the Deck and draw 1 card elseif op==3 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local tc=g:FilterSelect(tp,Card.IsAbleToDeck,1,1,nil):GetFirst() if tc then Duel.HintSelection(tc,true) if Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK|LOCATION_EXTRA) then if tc:IsControler(tp) and tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end Duel.Draw(tp,1,REASON_EFFECT) end end --Shuffle this card into the Deck and add 1 Field Spell from your GY to your hand elseif op==4 and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and c:IsLocation(LOCATION_DECK) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local th=Duel.SelectMatchingCard(tp,aux.AND(Card.IsFieldSpell,Card.IsAbleToHand),tp,LOCATION_GRAVE,0,1,1,nil) if #th>0 then Duel.SendtoHand(th,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,th) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card destroys a monster with an A-Counter by battle, it can attack once again in a row.
--エーリアン・ハンター --Alien Hunter local s,id=GetID() function s.initial_effect(c) --chain attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_BATTLED) e1:SetOperation(s.regop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(s.atcon) e2:SetOperation(s.atop) c:RegisterEffect(e2) end s.counter_list={COUNTER_A} function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() if bc and bc:GetCounter(COUNTER_A)>0 then c:RegisterFlagEffect(id,RESET_PHASE|PHASE_DAMAGE,0,1) end end function s.atcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return aux.bdcon(e,tp,eg,ep,ev,re,r,rp) and c:CanChainAttack() and c:GetFlagEffect(id)~=0 end function s.atop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute this card; Special Summon 1 "Yubel" monster from your Deck. During your opponent's turn, when a monster effect is activated, while you control a "Yubel" monster (Quick Effect): You can Tribute this card; the activated effect becomes "Destroy 1 "Yubel" monster on the field". During your End Phase, if you control "Yubel" and this card is in your GY: You can add this card to your hand, or Special Summon it. You can only use each effect of "Samsara D Lotus" once per turn.
--サクリファイス・D・ロータス --Samsara D Lotus --Ashaki local s,id=GetID() function s.initial_effect(c) --Special Summon 1 "Yubel" monster from your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfTribute) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Change a monster effect to "Destroy 1 "Yubel" monster on the field" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.chcon) e2:SetCost(Cost.SelfTribute) e2:SetTarget(s.chtg) e2:SetOperation(s.chop) c:RegisterEffect(e2) --Add this card to your hand or Special Summon it local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND+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,2}) e3:SetCondition(s.thcon) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_series={SET_YUBEL} s.listed_names={CARD_YUBEL} function s.spfilter(c,e,tp) return c:IsSetCard(SET_YUBEL) 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.GetMZoneCount(tp,e:GetHandler())>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.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_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.chcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_YUBEL),tp,LOCATION_MZONE,0,1,nil) and re:IsMonsterEffect() and Duel.IsTurnPlayer(1-tp) end function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_YUBEL),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end end function s.chop(e,tp,eg,ep,ev,re,r,rp) local g=Group.CreateGroup() Duel.ChangeTargetCard(ev,g) Duel.ChangeChainOperation(ev,s.repop) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsSetCard,SET_YUBEL),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) if #g>0 then Duel.HintSelection(g,true) Duel.Destroy(g,REASON_EFFECT) end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_YUBEL),tp,LOCATION_ONFIELD,0,1,nil) end function s.thtg(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)) or c:IsAbleToHand() end Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,c,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,tp,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end aux.ToHandOrElse(c,tp, function() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end, function() Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end, aux.Stringid(id,3) ) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a card(s) is sent from the hand or Deck to your opponent's GY (except during the Damage Step): You can Special Summon this card from your hand, then you can Special Summon 1 Level 4 EARTH Fairy monster from your GY, except "Agido the Ancient Sentinel". If this card is sent from the hand or Deck to the GY: You can activate this effect; each player sends the top 5 cards of their Deck to the GY, then, if "Exchange of the Spirit" is in your GY, you can send 5 more cards from the top of either player's Deck to the GY. You can only use each effect of "Agido the Ancient Sentinel" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--古衛兵アギド --Agido the Ancient Sentinel --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_GRAVE) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Each player sends the top 5 cards of their Deck to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DECKDES) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_HAND|LOCATION_DECK) end) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end s.listed_names={id,CARD_EXCHANGE_SPIRIT} function s.spconfilter(c,tp) return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_HAND|LOCATION_DECK) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return 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,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spfilter(c,e,tp) return c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_FAIRY) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.BreakEffect() Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) and Duel.IsPlayerCanDiscardDeck(1-tp,5) end Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,PLAYER_ALL,5) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) if (Duel.DiscardDeck(tp,5,REASON_EFFECT)+Duel.DiscardDeck(1-tp,5,REASON_EFFECT))<=0 or not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,CARD_EXCHANGE_SPIRIT) then return end local b1=Duel.IsPlayerCanDiscardDeck(tp,5) local b2=Duel.IsPlayerCanDiscardDeck(1-tp,5) if (b1 or b2) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then local op=Duel.SelectEffect(tp, {b1,aux.Stringid(id,4)}, {b2,aux.Stringid(id,5)}) Duel.BreakEffect() Duel.DiscardDeck(op==1 and tp or 1-tp,5,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent Summons a monster(s): Halve that monster(s)'s original ATK.
--粘着落とし穴 --Adhesion Trap Hole local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end function s.filter(c,tp) return c:IsFaceup() and c:IsSummonPlayer(1-tp) and c:IsLocation(LOCATION_MZONE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(s.filter,1,nil,tp) end Duel.SetTargetCard(eg) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e):Match(s.filter,nil,tp) for tc in aux.Next(tg) do --Halve its original ATK local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetValue(tc:GetBaseAttack()/2) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with "Fortress Whale's Oath".
--要塞クジラ --Fortress Whale local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() end s.listed_names={77454922}
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once while face-up on the field, during damage calculation in your opponent's turn, if this card is being attacked (Quick Effect): You can target the attacking monster; make that target's ATK 0 during damage calculation only.
--風魔神-ヒューガ --Kazejin local s,id=GetID() function s.initial_effect(c) --atkdown local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e1:SetCountLimit(1) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) and Duel.GetAttackTarget()==e:GetHandler() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetAttacker():IsCanBeEffectTarget(e) end Duel.SetTargetCard(Duel.GetAttacker()) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetReset(RESET_PHASE|PHASE_DAMAGE_CAL) e1:SetValue(0) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 face-up monster you control; it gains ATK equal to the combined original ATK of the other monsters you control, until the end of this turn. It cannot attack directly during the turn you activate this card. You can only activate 1 "Snowman Effect" per turn.
--スノーマン・エフェクト --Snowman Effect --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_ATTACK_ANNOUNCE) ge1:SetOperation(s.checkop) Duel.RegisterEffect(ge1,0) end) end function s.checkop(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if tc:GetFlagEffect(id)==0 and Duel.GetAttackTarget()==nil then tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end end function s.filter(c,tp) return c:IsFaceup() and c:GetFlagEffect(id)==0 and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_MZONE,0,1,c) end function s.filter2(c) return c:IsFaceup() and c:GetBaseAttack()>0 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 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,tp) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local atk=0 local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,tc) local bc=g:GetFirst() for bc in aux.Next(g) do atk=atk+math.max(bc:GetBaseAttack(),0) end --Gain ATK local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(atk) tc:RegisterEffect(e1) --Cannot attack directly local e2=Effect.CreateEffect(c) e2:SetDescription(3207) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 2 "Gouki" monsters in your GY with different Levels; Special Summon them in Defense Position. You can only activate 1 "Gouki Re-Match" per turn.
--剛鬼再戦 --Gouki Re-Match local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_GOUKI} function s.spfilter(c,e,tp) return c:IsSetCard(SET_GOUKI) and c:HasLevel() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and c:IsCanBeEffectTarget(e) end function s.rfilter(c,lv) return c:GetLevel()==lv end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and g:GetClassCount(Card.GetLevel)>=2 end local sg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dpcheck(Card.GetLevel),1,tp,HINTMSG_SPSUMMON) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,2,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(Card.IsRelateToEffect,nil,e) if #sg>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if #sg>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) sg=sg:Select(tp,ft,ft,nil) end Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is destroyed by battle and sent to the Graveyard: Add 1 Plant-Type monster with 1500 or less DEF from your Deck to your hand.
--バイオレット・ウィッチ --Violet Witch local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.filter(c) return c:IsDefenseBelow(1500) and c:IsRace(RACE_PLANT) and c:IsAbleToHand() end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is in your GY: You can Tribute 1 monster; Special Summon this card, then your opponent can Special Summon 1 monster from their GY, but negate its effects. If this card is Special Summoned: You can target 1 Level 4 or lower "Ogdoadic" monster in your GY; Special Summon it, but banish it when it leaves the field. You can only use each effect of "Keurse, the Ogdoadic Light" once per turn.
--溟界の黄昏-カース --Keurse, the Ogdoadic Light --scripted by Xylen5967 local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end s.listed_series={SET_OGDOADIC} function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,aux.ReleaseCheckMMZ,nil) end local g=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,aux.ReleaseCheckMMZ,nil) Duel.Release(g,REASON_COST) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_GRAVE) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_GRAVE) end function s.spfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spop1(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,1-tp) and Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(1-tp,aux.NecroValleyFilter(s.spfilter),tp,0,LOCATION_GRAVE,1,1,nil,e,1-tp) local tc=sg:GetFirst() if tc then Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end Duel.SpecialSummonComplete() end end function s.spfilter2(c,e,tp) return c:IsSetCard(SET_OGDOADIC) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter2(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop2(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_FACEUP)>0 then local e1=Effect.CreateEffect(e:GetHandler()) 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:SetValue(LOCATION_REMOVED) tc:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Special Summoned by the effect of a "Dream Mirror" monster: You can target 1 Level 8 or lower "Dream Mirror" monster in your GY, except "Phantasos, the Dream Mirror Friend"; Special Summon it in Defense Position. During the Main or Battle Phase, if "Dream Mirror of Terror" is in a Field Zone (Quick Effect): You can Tribute this card; Special Summon 1 "Phantasos, the Dream Mirror Foe" from your Deck. You can only use each effect of "Phantasos, the Dream Mirror Friend" once per turn.
--夢魔鏡の聖獣-パンタス --Phantasos, the Dream Mirror Friend --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Special summon 1 level 8 or lower "Dream Mirror" monster from GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon1) e1:SetTarget(s.sptg1) e1:SetOperation(s.spop1) c:RegisterEffect(e1) --Special summon 1 "Phantasos, the Dream Mirror Foe" from deck local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_START|TIMING_BATTLE_END) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetCost(Cost.SelfTribute) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={CARD_DREAM_MIRROR_TERROR,99792080} s.listed_series={SET_DREAM_MIRROR} function s.spcon1(e,tp,eg,ep,ev,re,r,rp) if not re then return false end return re:IsMonsterEffect() and re:GetHandler():IsSetCard(SET_DREAM_MIRROR) end function s.spfilter1(c,e,tp) return c:IsSetCard(SET_DREAM_MIRROR) and c:IsLevelBelow(8) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter1(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,LOCATION_GRAVE) end function s.spop1(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function s.sscond(c) return c:IsFaceup() and c:IsCode(CARD_DREAM_MIRROR_TERROR) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.sscond,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil,tp) and (Duel.IsMainPhase() or Duel.IsBattlePhase()) end function s.spfilter(c,e,tp) return c:IsCode(99792080) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if e:GetHandler():GetSequence()<5 then ft=ft+1 end if chk==0 then return ft>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.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_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can send this card from your hand to the GY; send 1 LIGHT Reptile monster from your Deck to the GY. If this card is Normal or Special Summoned: You can add 1 "Ogdoadic" Spell/Trap from your Deck to your hand. You can only use each effect of "Nauya, the Ogdoadic Remnant" once per turn.
--冥界の淳一ナイア --Nauya, the Ogdoadic Remnant --scripted by Xylen5967 local s,id=GetID() function s.initial_effect(c) --Send to GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfToGrave) e1:SetTarget(s.tgtg) e1:SetOperation(s.tgop) c:RegisterEffect(e1) --Search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end s.listed_series={SET_OGDOADIC} function s.tgfilter(c) return c:IsRace(RACE_REPTILE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToGrave() 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) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end function s.thfilter(c) return c:IsSpellTrap() and c:IsSetCard(SET_OGDOADIC) 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 Duel.SetOperationInfo(0,CATEGORY_TOHAND,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 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) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be destroyed by battle while you control another monster. Neither player can target face-up Spells/Traps you control with card effects.
--イビルセラ・ルテア --Ibicella Lutea local s,id=GetID() function s.initial_effect(c) --indes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCondition(s.indcon) e1:SetValue(1) c:RegisterEffect(e1) --cannot be target local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_ONFIELD,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsSpellTrap)) e2:SetValue(1) c:RegisterEffect(e2) end function s.indcon(e) return Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can discard this card; add 1 "Labyrinth Wall" card from your Deck to your hand. At the start of the Damage Step, if your opponent's monster battles, while you control a "Labyrinth Wall" card: You can banish this card from your GY; destroy that opponent's monster. You can only use each effect of "Shadow Ghoul of the Labyrinth" once per turn.
--迷宮に潜むシャドウ・グール --Shadow Ghoul of the Labyrinth --Scripted by Satella local s,id=GetID() function s.initial_effect(c) --Search 1 "Labyrinth Wall" card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfDiscard) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Destroy 1 opponent's battling monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_START) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.descon) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end s.listed_seires={SET_LABYRINTH_WALL} function s.thfilter(c) return c:IsSetCard(SET_LABYRINTH_WALL) 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 Duel.SetOperationInfo(0,CATEGORY_TOHAND,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 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) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetBattleMonster(1-tp) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_LABYRINTH_WALL),tp,LOCATION_ONFIELD,0,1,nil) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,Duel.GetBattleMonster(1-tp),1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetBattleMonster(1-tp) if tc and tc:IsRelateToBattle() then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card can only be Ritual Summoned with the Ritual Spell Card, "Final Ritual of the Ancients". Once per turn, by discarding 1 Spell Card from your hand, take control of 1 monster on your opponent's side of the field until the end of this turn.
--大邪神レシェフ --Reshef the Dark Being local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={60369732} function s.cfilter(c) return c:IsDiscardable() and c:IsSpell() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST|REASON_DISCARD) 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(1-tp) and chkc:IsControlerCanBeChanged() end if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp,PHASE_END,1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can excavate the top card of your Deck, and if it is a Plant-Type monster, send it to the Graveyard. Otherwise, place it on the bottom of your Deck. If this card is excavated from the Deck and sent to the Graveyard by a card effect: You can choose 1 "Sylvan" card from your Deck and place it on top of your Deck.
--森羅の花卉士 ナルサス --Sylvan Flowerknight local s,id=GetID() function s.initial_effect(c) --Excavate the top card of your Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Place 1 "Sylvan" card on the top of your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_TO_GRAVE) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCondition(s.tdcon) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end s.listed_series={SET_SYLVAN} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end Duel.ConfirmDecktop(tp,1) local g=Duel.GetDecktopGroup(tp,1) local tc=g:GetFirst() if tc:IsRace(RACE_PLANT) then Duel.DisableShuffleCheck() Duel.SendtoGrave(g,REASON_EFFECT+REASON_EXCAVATE) else Duel.MoveSequence(tc,1) end end function s.tdcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_DECK) and c:IsReason(REASON_EXCAVATE) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,SET_SYLVAN) end end function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,SET_SYLVAN) local tc=g:GetFirst() if tc then Duel.ShuffleDeck(tp) Duel.MoveSequence(tc,0) Duel.ConfirmDecktop(tp,1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card resolves: Banish 1 WATER monster from your hand, Graveyard, or face-up on your field. Then, when this face-up card on the field is destroyed: Special Summon that banished monster to your side of the field.
--異次元海溝 --Different Dimension Deepsea Trench local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) e1:SetLabelObject(e2) end function s.filter(c) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToRemove() and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true,true)) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_HAND|LOCATION_GRAVE|LOCATION_MZONE,0,1,1,nil):GetFirst() if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,0) e:GetLabelObject():SetLabelObject(tc) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=e:GetLabelObject() return tc and c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetLabelObject():GetFlagEffect(id)~=0 and e:GetLabelObject():GetReasonEffect():GetHandler()==e:GetHandler() end Duel.SetTargetCard(e:GetLabelObject()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetLabelObject(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: Place 1 A-Counter on 1 face-up monster on your opponent's side of the field. (If a monster with an A-Counter battles an "Alien" monster, it loses 300 ATK and DEF for each A-Counter during damage calculation only.) After this card has been flipped face-up, when it is destroyed by battle and sent to the Graveyard, draw 1 card.
--エーリアン・グレイ --Alien Grey local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_COUNTER) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_FLIP) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetOperation(s.flop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DRAW) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_BATTLE_DESTROYED) e3:SetCondition(s.drcon) e3:SetTarget(s.drtg) e3:SetOperation(s.drop) c:RegisterEffect(e3) --atk def local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e4:SetCondition(s.adcon) e4:SetTarget(s.adtg) e4:SetValue(s.adval) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e5) end s.listed_series={SET_ALIEN} s.counter_place_list={COUNTER_A} function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,COUNTER_A,1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then tc:AddCounter(COUNTER_A,1) end end function s.flop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD_EXC_GRAVE,0,0) end function s.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE) and e:GetHandler():GetFlagEffect(id)~=0 end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) 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.adcon(e) return Duel.IsPhase(PHASE_DAMAGE_CAL) and Duel.GetAttackTarget() end function s.adtg(e,c) local bc=c:GetBattleTarget() return bc and c:GetCounter(COUNTER_A)~=0 and bc:IsSetCard(SET_ALIEN) end function s.adval(e,c) return c:GetCounter(COUNTER_A)*-300 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Equip only to a Warrior-Type, Beast-Warrior-Type, or Spellcaster-Type monster. Its ATK becomes 0. During each of your Standby Phases, inflict 500 damage to the controller of the equipped monster.
--疫病 --Pestilence local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR|RACE_SPELLCASTER|RACE_BEASTWARRIOR)) --Atk,def local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_SET_ATTACK) e2:SetValue(0) c:RegisterEffect(e2) --damage local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCode(EVENT_PHASE|PHASE_STANDBY) e4:SetRange(LOCATION_SZONE) e4:SetCountLimit(1) e4:SetCondition(s.damcon) e4:SetTarget(s.damtg) e4:SetOperation(s.damop) c:RegisterEffect(e4) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local damp=e:GetHandler():GetEquipTarget():GetControler() Duel.SetTargetPlayer(damp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,damp,500) end function s.damop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local damp=e:GetHandler():GetEquipTarget():GetControler() local d=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) Duel.Damage(damp,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can only control 1 face-up "Gravekeeper's Chief". Your GY is unaffected by "Necrovalley". When this card is Tribute Summoned: You can target 1 "Gravekeeper's" monster in your GY; Special Summon that target.
--墓守の長 --Gravekeeper's Chief local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) --immune to necro valley local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_NECRO_VALLEY_IM) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(1,0) c:RegisterEffect(e1) --summon success local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_GRAVEKEEPERS} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsTributeSummoned() end function s.filter(c,e,tp) return c:IsSetCard(SET_GRAVEKEEPERS) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(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 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) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During either player's turn, when a card or effect is activated that will inflict damage when it resolves: You can Special Summon this card from your hand, and if you do, inflict 400 damage to your opponent.
--アチャチャチャンバラー --Achacha Chanbara local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return aux.damcon1(e,tp,eg,ep,ev,re,r,rp) or aux.damcon1(e,1-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 not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,400) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.Damage(1-tp,400,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, this Defense Position card cannot be destroyed by battle.
--ゴゴゴゴーレム --Gogogo Golem local s,id=GetID() function s.initial_effect(c) --battle indes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e1:SetCountLimit(1) e1:SetValue(s.valcon) c:RegisterEffect(e1) end function s.valcon(e,re,r,rp) return (r&REASON_BATTLE)~=0 and e:GetHandler():IsDefensePos() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can take 1 "Amazoness" monster from your Deck, and either add it to your hand or (if it is a Pendulum Monster) place it in your Pendulum Zone. When you take battle damage while you control an "Amazoness" Monster Card: You can gain LP equal to the damage you took. You can only use this effect of "Amazoness Hot Spring" once per turn.
--アマゾネスの秘湯 --Amazoness Hot Spring --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_BATTLE_START|TIMING_END_PHASE) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Gain LP equal to the battle damage taken local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.lpcond) e2:SetTarget(s.lptg) e2:SetOperation(s.lpop) c:RegisterEffect(e2) end s.listed_series={SET_AMAZONESS} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.pendfilter(c,tp) return c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and Duel.CheckPendulumZones(tp) end function s.cfilter(c,tp) return c:IsMonster() and c:IsSetCard(SET_AMAZONESS) and (c:IsAbleToHand() or s.pendfilter(c,tp)) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_DECK,0,nil,tp) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local tc=g:Select(tp,1,1,nil) aux.ToHandOrElse(tc,tp,function(tc) return s.pendfilter(tc,tp) end, function(tc) Duel.MoveToField(tc:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) end, aux.Stringid(id,3) ) end end function s.amzfilter(c) return c:IsFaceup() and c:IsSetCard(SET_AMAZONESS) and c:IsOriginalType(TYPE_MONSTER) end function s.lpcond(e,tp,eg,ep,ev,re,r,rp) return ep==tp and Duel.IsExistingMatchingCard(s.amzfilter,tp,LOCATION_ONFIELD,0,1,nil) end function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev) end function s.lpop(e,tp,eg,ep,ev,re,r,rp) Duel.Recover(tp,ev,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon 2 "Trickstar Tokens" (Fairy/LIGHT/Level 1/ATK 0/DEF 0). If a "Trickstar" monster(s) you control that was Special Summoned from the Extra Deck would be destroyed by battle or card effect, you can banish this card from your GY instead. You cannot Normal or Special Summon monsters the turn you activate this card, except "Trickstar" monsters. You can only activate 1 "Trickstar Festival" per turn.
--トリックスター・フェス --Trickstar Festival local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) 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:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --destroy replace local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_GRAVE) e2:SetTarget(s.reptg) e2:SetValue(s.repval) e2:SetOperation(s.repop) c:RegisterEffect(e2) Duel.AddCustomActivityCounter(id,ACTIVITY_SUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end s.listed_names={TOKEN_TRICKSTAR} s.listed_series={SET_TRICKSTAR} function s.counterfilter(c) return c:IsSetCard(SET_TRICKSTAR) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SUMMON)==0 and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_SUMMON) Duel.RegisterEffect(e2,tp) aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil) end function s.splimit(e,c) return not c:IsSetCard(SET_TRICKSTAR) 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.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_TRICKSTAR,SET_TRICKSTAR,TYPES_TOKEN,0,0,1,RACE_FAIRY,ATTRIBUTE_LIGHT) end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_TRICKSTAR,SET_TRICKSTAR,TYPES_TOKEN,0,0,1,RACE_FAIRY,ATTRIBUTE_LIGHT) then for i=1,2 do local token=Duel.CreateToken(tp,TOKEN_TRICKSTAR) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) end Duel.SpecialSummonComplete() end end function s.repfilter(c,tp) return c:IsFaceup() and c:IsSetCard(SET_TRICKSTAR) and c:IsLocation(LOCATION_MZONE) and c:IsSummonLocation(LOCATION_EXTRA) and c:IsControler(tp) and c:IsReason(REASON_EFFECT|REASON_BATTLE) 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():IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end return Duel.SelectEffectYesNo(tp,e:GetHandler(),96) end function s.repval(e,c) return s.repfilter(c,e:GetHandlerPlayer()) end function s.repop(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a WATER monster: Target 1 Spell in your opponent's GY; banish it, and if you do, for the rest of this turn negate all Spell effects on your opponent's field.
--白の咆哮 --White Howling --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.filter(c) return c:IsSpell() and c:IsAbleToRemove() 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_GRAVE) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then --disable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_DISABLE) e2:SetTargetRange(0,LOCATION_SZONE) e2:SetTarget(s.distg) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) --disable effect local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_CHAIN_SOLVING) e3:SetRange(LOCATION_MZONE) e3:SetOperation(s.disop) e3:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e3,tp) end end function s.distg(e,c) return c:IsSpell() end function s.disop(e,tp,eg,ep,ev,re,r,rp) local tl,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_PLAYER) if tl==LOCATION_SZONE and p~=tp and re:IsSpellEffect() then Duel.NegateEffect(ev) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this Set card is destroyed and sent to the GY: Target 1 Continuous Spell or Field Spell in your GY; add it to your hand.
--Z-ONE --Z-ONE local s,id=GetID() function s.initial_effect(c) --salvage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsPreviousPosition(POS_FACEDOWN) end function s.filter(c) return c:IsSpell() and c:IsType(TYPE_FIELD+TYPE_CONTINUOUS) and c:IsAbleToHand() 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) and s.filter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If an EARTH monster(s) is Normal or Special Summoned to your field (except during the Damage Step): You can Special Summon this card from your hand. You can banish this card from your GY, then target 1 Level 5 or higher Warrior monster you control and 1 Attack Position monster your opponent controls; your monster loses exactly 1500 ATK, and if it does, destroy that opponent's monster. You can only use each effect of "Senko the Skybolt Star" once per turn.
--天雷星センコウ --Senko the Skybolt Star --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon itself from hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,{id,0}) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --Target 1 monster to decrease ATK and 1 monster to destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCost(Cost.SelfBanish) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end function s.spcfilter(c,tp) return c:IsControler(tp) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.spcfilter,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,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 function s.tgfilter(c,e,tp) return (c:IsFaceup() and c:IsLevelAbove(5) and c:IsRace(RACE_WARRIOR) and c:IsControler(tp)) or (c:IsControler(1-tp) and c:IsAttackPos()) and c:IsCanBeEffectTarget(e) end function s.rescon(sg,e,tp,mg) return sg:FilterCount(Card.IsControler,nil,tp)==1 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local rg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp) if chk==0 then return aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,0) end local tg=aux.SelectUnselectGroup(rg,e,tp,2,2,s.rescon,1,tp,HINTMSG_TARGET) Duel.SetTargetCard(tg) local hg=tg:Filter(Card.IsControler,nil,tp) e:SetLabelObject(hg:GetFirst()) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,hg,1,tp,-1500) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg-hg,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g==0 then return end local tc1=g:GetFirst() local tc2=g:GetNext() if tc2==e:GetLabelObject() then tc1,tc2=tc2,tc1 end if tc1:IsControler(tp) and tc1:UpdateAttack(-1500,RESET_EVENT|RESETS_STANDARD,e:GetHandler())==-1500 and tc2 and tc2:IsControler(1-tp) then Duel.Destroy(tc2,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 4 monsters (Quick Effect): You can detach 1 material from this card; add 1 "Double or Nothing!" from your Deck to your hand, then Special Summon from your Extra Deck, 1 "Utopia" Xyz Monster, except "Number 39: Utopia Double", by using this face-up card you control as material, and if you do, its ATK becomes doubled, but it cannot attack directly. (This is treated as an Xyz Summon. Transfer its materials to the Summoned monster.) You can only use this effect of "Number 39: Utopia Double" once per turn.
--No.39 希望皇ホープ・ダブル --Number 39: Utopia Double --Logical Nonsense local s,id=GetID() function s.initial_effect(c) --Xyz Summon Xyz.AddProcedure(c,nil,4,2) c:EnableReviveLimit() --Add 1 "Double or Nothing!" from deck, then special summon 1 "Utopia" Xyz monster from extra deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.DetachFromSelf(1,1,nil)) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_END_PHASE) c:RegisterEffect(e1) end --Lists "Utopia" archetype s.listed_series={SET_UTOPIA} --Specifically lists "Double or Nothing!" s.listed_names={94770493} --Number 39 s.xyz_number=39 --Look for "Double or Nothing!" function s.thfilter(c) return c:IsCode(94770493) and c:IsAbleToHand() end --Check for "Utopia" Xyz monster, excluding "Number 39: Utopia Double" function s.spfilter(c,e,tp,mc,pg) return c:IsType(TYPE_XYZ) and c:IsSetCard(SET_UTOPIA) and not c:IsCode(id) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and mc:IsCanBeXyzMaterial(c,tp) 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) if chk==0 then local c=e:GetHandler() local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) return (#pg<=0 or (#pg==1 and pg:IsContains(c))) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler(),pg) 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_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end --Add 1 "Double or Nothing!", then Xyz summon 1 "Utopia" Xyz monster by using this card, and if you do, double its ATK function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() 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 return end Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) Duel.BreakEffect() local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ) if not (c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e)) 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,pg):GetFirst() if not sc then return end Duel.BreakEffect() sc:SetMaterial(c) Duel.Overlay(sc,c) if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)==0 then return end sc:CompleteProcedure() --Cannot attack directly 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) sc:RegisterEffect(e1) --Double its ATK local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_SET_ATTACK) e2:SetValue(sc:GetTextAttack()*2) e2:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You must send this card to the GY during your 2nd Standby Phase after activation. Once per turn, during your Main Phase, you can: Toss a coin and if the result is heads, send this card to the GY. If this card is sent from the Spell & Trap Zone to the GY: You can activate this effect; this turn, your opponent cannot activate cards or effects in response to the activation of your "Ancient Warriors" cards and effects, also until the end of the turn, all "Ancient Warriors" Effect Monsters you currently control gain this effect. ● When this card declares an attack: You can destroy 1 card your opponent controls. * The above text is unofficial and describes the card's functionality in the OCG.
--戦華史略-東南之風 --Ancient Warriors Saga - East-by-South Winds --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) c:RegisterEffect(e1) --Toss a coin and send this card to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_COIN+CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) --Register effect when sent to the GY local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetCode(EVENT_TO_GRAVE) e3:SetCondition(s.condition) e3:SetOperation(s.operation) c:RegisterEffect(e3) end s.listed_series={SET_ANCIENT_WARRIORS} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local c=e:GetHandler() --Send itself to the GY during the second Standby Phase local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetRange(LOCATION_SZONE) e1:SetCountLimit(1) e1:SetCondition(function(_,tp) return Duel.IsTurnPlayer(tp) end) e1:SetOperation(s.sop) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_STANDBY|RESET_SELF_TURN,2) c:SetTurnCounter(0) c:RegisterEffect(e1) end function s.sop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ct=c:GetTurnCounter() ct=ct+1 c:SetTurnCounter(ct) if ct==2 then Duel.SendtoGrave(c,REASON_RULE) end end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGrave() end Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) if Duel.TossCoin(tp,1)==COIN_HEADS then Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() --Your opponent cannot activate cards and effects in response to "Ancient Warriors" cards local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_CHAINING) e1:SetOperation(s.chainop) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) aux.RegisterClientHint(c,nil,tp,1,1,aux.Stringid(id,1),nil) local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_ANCIENT_WARRIORS),tp,LOCATION_MZONE,0,nil) for tc in g:Iter() do --Destroy 1 card the opponent controls local e2=Effect.CreateEffect(tc) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetTarget(s.destg) e2:SetOperation(s.desop) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end end function s.chainop(e,tp,eg,ep,ev,re,r,rp) if re:GetHandler():IsSetCard(SET_ANCIENT_WARRIORS) and ep==tp then Duel.SetChainLimit(s.chainlm) end end function s.chainlm(e,ep,tp) return tp==ep end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local tc=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst() if tc then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can target 1 Level 5 or higher monster on the field; it gains 1000 ATK/DEF until the end of this turn. Negate any opponent's Spell effect that resolves in the same column as a "Mekk-Knight" monster you control. * The above text is unofficial and describes the card's functionality in the OCG.
--星遺物の囁き --World Legacy Whispers local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetTarget(s.target) c:RegisterEffect(e1) --Negate Spell effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVING) e2:SetRange(LOCATION_SZONE) e2:SetCondition(s.discon) e2:SetOperation(s.disop) c:RegisterEffect(e2) end s.listed_series={SET_MEKK_KNIGHT} function s.atkfilter(c) return c:IsFaceup() and c:IsLevelAbove(5) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.atkfilter(chkc) end if chk==0 then if Duel.IsPhase(PHASE_DAMAGE) then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end return true end if Duel.IsPhase(PHASE_DAMAGE) or (Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,0))) then e:SetCategory(CATEGORY_ATKCHANGE) e:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e:SetOperation(s.activate) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) else e:SetCategory(0) e:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e:SetOperation(nil) end end function s.activate(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) and tc:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(1000) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) end end function s.cfilter(c,seq,p) return c:IsFaceup() and c:IsSetCard(SET_MEKK_KNIGHT) and c:IsColumn(seq,p,LOCATION_SZONE) end function s.discon(e,tp,eg,ep,ev,re,r,rp) if rp==tp or not re:IsSpellEffect() then return false end local rc=re:GetHandler() local p,loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) if re:IsHasType(EFFECT_TYPE_ACTIVATE) and (loc&LOCATION_SZONE==0 or rc:IsControler(1-p)) then if rc:IsLocation(LOCATION_SZONE) and rc:IsControler(p) then seq=rc:GetSequence() loc=LOCATION_SZONE else seq=rc:GetPreviousSequence() loc=rc:GetPreviousLocation() end end return loc&LOCATION_SZONE==LOCATION_SZONE and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,seq,p) end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 12 monsters You can also Xyz Summon this card by using a Rank 10 or 11 DARK Xyz Monster you control as the Xyz Material. (Xyz Materials attached to that monster also become Xyz Materials on this card.) If Summoned this way, the following effect cannot be activated this turn. Once per turn: You can detach 2 Xyz Materials from this card; banish as many Special Summoned monsters your opponent controls as possible, then attach 1 of those banished monsters to this card as Xyz Material. If this face-up card on the field would be destroyed by battle or card effect, you can detach 1 Xyz Material from this card instead.
--No.77 ザ・セブン・シンズ --Number 77: The Seven Sins local s,id=GetID() function s.initial_effect(c) --Xyz Summon Xyz.AddProcedure(c,nil,12,2,s.ovfilter,aux.Stringid(id,0),2,s.xyzop) c:EnableReviveLimit() --Banish as many Special Summoned monsters then attach 1 local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(Cost.DetachFromSelf(2,2,nil)) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --Protect itself from destruction local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetTarget(s.reptg) c:RegisterEffect(e2) end s.xyz_number=77 function s.ovfilter(c,tp,xyzc) local rk=c:GetRank() return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and (rk==10 or rk==11) end function s.xyzop(e,tp,chk) if chk==0 then return true end e:GetHandler():RegisterFlagEffect(id,RESET_EVENT|(RESETS_STANDARD_PHASE_END&~RESET_TOFIELD),0,1) return true end function s.rmfilter(c) return c:IsSpecialSummoned() and c:IsAbleToRemove() and c:IsMonster() end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetFlagEffect(id)==0 and Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.rmfilter,tp,0,LOCATION_MZONE,nil) if #g==0 then return end local c=e:GetHandler() if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)==0 or not c:IsRelateToEffect(e) then return end local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) if #og>0 then Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) local sg=og:Select(tp,1,1,nil) Duel.BreakEffect() Duel.Overlay(c,sg) end end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end if Duel.SelectEffectYesNo(tp,c,96) then c:RemoveOverlayCard(tp,1,1,REASON_EFFECT) return true else return false end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can banish 2 WATER monsters from your Graveyard; Special Summon 1 "Lekunga Token" (Plant-Type/WATER/Level 2/ATK 700/DEF 700) in Attack Position.
--レクンガ --Lekunga local s,id=GetID() function s.initial_effect(c) --token local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={62543394} function s.cfilter(c) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local rg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #rg>1 and aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),0) end local g=aux.SelectUnselectGroup(rg,e,tp,2,2,aux.ChkfMMZ(1),1,tp,HINTMSG_REMOVE) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,700,700,2,RACE_PLANT,ATTRIBUTE_WATER) end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,700,700,2,RACE_PLANT,ATTRIBUTE_WATER) then local token=Duel.CreateToken(tp,id+1) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 non-Tuner monster Once per turn: You can target 1 other "T.G." Synchro Monster you control; send it to the Graveyard, then, if all the Synchro Monsters that were used for its Synchro Summon are in your Graveyard, you can Special Summon all of them.
--TG レシプロ・ドラゴン・フライ --T.G. Recipro Dragonfly local s,id=GetID() function s.initial_effect(c) --Synchro Summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,1) c:EnableReviveLimit() --Send 1 "T.G." Synchro monster to the GY and special summon the materials local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_TG} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_TG) and c:IsType(TYPE_SYNCHRO) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.mgfilter(c,e,tp,sync) return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and (c:GetReason()&(REASON_MATERIAL+REASON_SYNCHRO))==(REASON_MATERIAL+REASON_SYNCHRO) and c:GetReasonCard()==sync and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end local mg=tc:GetMaterial() local ct=#mg local sumtype=tc:GetSummonType() if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and sumtype==SUMMON_TYPE_SYNCHRO and ct>0 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and ct<=Duel.GetLocationCount(tp,LOCATION_MZONE) and mg:FilterCount(aux.NecroValleyFilter(s.mgfilter),nil,e,tp,tc)==ct and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() Duel.SpecialSummon(mg,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent activates a card or effect that targets this face-down monster (Quick Effect): You can change this card to face-up Defense Position; negate the activation, and if you do, destroy that card. After this card was flipped face-up, while it is in the Monster Zone, negate all monster effects activated on your opponent's field. If this card on the field is destroyed by battle or card effect: You can add, from your Deck to your hand, 1 Level 9 monster with a different original Type and Attribute than this card. You can only use this effect of "Deus X-Krawler" once per turn.
--機怪神エクスクローラー --Deus X-Krawler --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Negate the activation of an opponent's card or effect that targets this face-down card, and if you do, destroy it local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.negcon) e1:SetCost(Cost.SelfChangePosition(POS_FACEUP_DEFENSE)) e1:SetTarget(s.negtg) e1:SetOperation(s.negop) c:RegisterEffect(e1) --After this card was flipped face-up, while it is in the Monster Zone, negate all monster effects activated on your opponent's field local e2a=Effect.CreateEffect(c) e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2a:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2a:SetCode(EVENT_FLIP) e2a:SetOperation(function(e) local c=e:GetHandler() c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) local chain_link=Duel.GetCurrentChain() if chain_link==0 then return end local fid=c:GetFieldID() local tp=e:GetHandlerPlayer() --Workaround to have e2b apply immediately if it's flipped face-up due to its own effect local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_CHAIN_SOLVING) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentChain()>chain_link and re:IsMonsterEffect() and rp==1-tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE and c:HasFlagEffect(id) and c:IsFaceup() and not c:IsDisabled() and c:IsFieldID(fid) end) e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end) e1:SetReset(RESET_CHAIN) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetOperation(function() e1:Reset() e2:Reset() end) e2:SetReset(RESET_CHAIN) Duel.RegisterEffect(e2,tp) end) c:RegisterEffect(e2a) local e2b=Effect.CreateEffect(c) e2b:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2b:SetCode(EVENT_CHAIN_SOLVING) e2b:SetRange(LOCATION_MZONE) e2b:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():HasFlagEffect(id) and re:IsMonsterEffect() and rp==1-tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE end) e2b:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end) c:RegisterEffect(e2b) --Add 1 Level 9 monster with a different original Type and Attribute than this card from your Deck to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,id) e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and r&(REASON_BATTLE|REASON_EFFECT)>0 end) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end function s.negcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (rp==1-tp and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and c:IsFacedown() and Duel.IsChainNegatable(ev)) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsContains(c) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local rc=re:GetHandler() Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,tp,0) if rc:IsDestructable() and rc:IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,tp,0) end end function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end function s.thfilter(c,race,attribute) return c:IsLevel(9) and c:IsAbleToHand() and not c:IsOriginalRace(race) and not c:IsOriginalAttribute(attribute) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local c=e:GetHandler() return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetOriginalRace(),c:GetOriginalAttribute()) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,c:GetOriginalRace(),c:GetOriginalAttribute()) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 2 monsters Once per turn: You can discard 1 card, then target 1 card your opponent controls, or up to 2 if this card has "Purrely Sleepy Memory" as material; return that card(s) to the hand. Up to thrice per turn, when you activate a "Purrely" Quick-Play Spell Card (Quick Effect): You can attach that card on the field to this card as material, then you can Set 1 "Purrely" Trap directly from your Deck.
--エピュアリィ・ノアール --Epurrely Noir --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon Procedure Xyz.AddProcedure(c,nil,2,2) --Return cards the opponent controls to the hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Attach a "Purrely" Quick-Play Spell local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(3) e2:SetCondition(s.attachcond) e2:SetOperation(s.attachop) c:RegisterEffect(e2) end s.listed_names={21347668} --Purrely Sleepy Memory s.listed_series={SET_PURRELY} 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) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end local ct=e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,21347668) and 2 or 1 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,ct,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) end end function s.attachcond(e,tp,eg,ep,ev,re,r,rp) if rp==1-tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end local rc=re:GetHandler() return rc:IsSetCard(SET_PURRELY) and rc:IsQuickPlaySpell() and rc:IsOnField() and rc:IsCanBeXyzMaterial(e:GetHandler(),tp,REASON_EFFECT) end function s.setfilter(c) return c:IsSetCard(SET_PURRELY) and c:IsTrap() and c:IsSSetable() end function s.attachop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=re:GetHandler() if c:IsRelateToEffect(e) and rc:IsRelateToEffect(re) and not c:IsImmuneToEffect(e) and not rc:IsImmuneToEffect(e) and rc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT) then Duel.Overlay(c,rc) if not c:GetOverlayGroup():IsContains(rc) then return end rc:CancelToGrave() local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK,0,nil) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local sg=g:Select(tp,1,1,nil) Duel.BreakEffect() Duel.SSet(tp,sg) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card you control would be used as Synchro Material for a Psychic monster, you can treat it as a non-Tuner. You can only use 1 of the following effects of "Mind Procedure" per turn, and only once that turn. If this card is Normal Summoned, or Special Summoned by a monster effect: You can pay 2000 LP; add 1 "Teleport" Normal or Quick-Play Spell from your Deck or GY to your hand. If this card is banished: You can pay 1000 LP; Special Summon it.
--メンタルプロシージャー --Mind Procedure --scripted by Naim local s,id=GetID() function s.initial_effect(c) --If this card you control would be used as Synchro Material for a Psychic monster, you can treat it as a non-Tuner local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_NONTUNER) e1:SetRange(LOCATION_MZONE) e1:SetValue(function(e,sc) return sc:IsRace(RACE_PSYCHIC) end) c:RegisterEffect(e1) --Add 1 "Teleport" Normal or Quick-Play Spell from your Deck or GY to your hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,id) e2:SetCost(Cost.PayLP(2000)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:IsMonsterEffect() end) c:RegisterEffect(e3) --Special Summn this card local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCode(EVENT_REMOVE) e4:SetCountLimit(1,id) e4:SetCost(Cost.PayLP(1000)) e4:SetTarget(s.sptg) e4:SetOperation(s.spop) c:RegisterEffect(e4) end s.listed_series={SET_TELEPORT} function s.thfilter(c) return c:IsSetCard(SET_TELEPORT) and (c:IsNormalSpell() or c:IsQuickPlaySpell()) 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|LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end 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,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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Reveal 1 card in your hand, and if you do, add 1 of the following cards from your Deck to your hand, then shuffle the revealed card into the Deck. ● "ZW -" monster ● "ZS -" monster ● "Zexal" Spell/Trap ● "Rank-Up-Magic" Spell ● "Rank-Down-Magic" Spell You can only activate 1 "Zexal Construction" per turn.
--ゼアル・コンストラクション --Zexal Construction --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_TODECK) 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) end s.listed_series={SET_ZEXAL,SET_ZW,SET_ZS,SET_RANK_UP_MAGIC,SET_RANK_DOWN_MAGIC} function s.filter(c) return c:IsAbleToDeck() and not c:IsPublic() end function s.thfilter(c) return c:IsAbleToHand() and ((c:IsMonster() and (c:IsSetCard(SET_ZW) or c:IsSetCard(SET_ZS))) or (c:IsSpell() and (c:IsSetCard(SET_ZEXAL) or c:IsSetCard(SET_RANK_UP_MAGIC) or c:IsSetCard(SET_RANK_DOWN_MAGIC))) or c:IsTrap() and c:IsSetCard(SET_ZEXAL)) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,e:GetHandler()) 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.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local rg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil) if rg:GetFirst() then Duel.ConfirmCards(1-tp,rg) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if tg:GetFirst() then Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) Duel.BreakEffect() Duel.SendtoDeck(rg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Must be Special Summoned with "Mask Change". When this card destroys an opponent's monster by battle and sends it to the GY: You can Special Summon 1 Level 4 or lower "HERO" monster from your Deck.
--M・HERO ダイアン --Masked HERO Dian local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Special summon condition 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(aux.FALSE) c:RegisterEffect(e1) --Special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_HERO} function s.spcon(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() return #eg==1 and tc:GetReasonCard()==e:GetHandler() and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE) end function s.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(SET_HERO) 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_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) 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.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Your opponent can discard 1 card to negate this effect, otherwise both players look at their opponent's Deck and choose 1 card, then add the card from their own Deck chosen by their opponent to their hand. You can only activate 1 "Margin Trading" per turn.
--信用取引 --Margin Trading --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) 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) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil,tp) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_DECK,1,nil,1-tp) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_ALL,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g1=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_DECK,0,nil,tp) local g2=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_DECK,nil,1-tp) if #g1==0 or #g2==0 then return end --Opponent can discard 1 card to negate this effect if Duel.IsChainDisablable(0) then local g=Duel.GetMatchingGroup(Card.IsDiscardable,tp,0,LOCATION_HAND,nil,REASON_EFFECT) if #g>0 and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DISCARD) local sg=g:Select(1-tp,1,1,nil) Duel.SendtoGrave(sg,REASON_EFFECT|REASON_DISCARD) return end end --Each player looks at the opponent's Deck Duel.ConfirmCards(tp,g2) Duel.ConfirmCards(1-tp,g1) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2)) local hg2=g2:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,2)) local hg1=g1:Select(1-tp,1,1,nil) if #hg1==0 or #hg2==0 then return end Duel.BreakEffect() Duel.SendtoHand(hg1,nil,REASON_EFFECT) Duel.ConfirmCards(tp,hg1) Duel.SendtoHand(hg2,nil,REASON_EFFECT) Duel.ConfirmCards(tp,hg2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 monster you control; destroy it, then send 2 cards from the top of your opponent's Deck to the GY.
--本陣強襲 --Assault on GHQ local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) 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) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,2) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.BreakEffect() Duel.DiscardDeck(1-tp,2,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When an opponent's monster declares an attack: Negate that attack, then Special Summon this card in Attack Position as an Effect Monster (Warrior/DARK/Level 2/ATK 0/DEF 0) with the following effect. (This card is NOT treated as a Trap.) ● (Quick Effect): You can send this card and 1 face-up card you control to the GY (either a "The Phantom Knights" monster or a "Phantom Knights" Continuous Spell/Trap); draw 2 cards.
--幻影騎士団ウロング・マグネリング --The Phantom Knights of Wrong Magnetring local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.drcon) e2:SetCost(s.drcost) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) end s.listed_series={SET_THE_PHANTOM_KNIGHTS,SET_PHANTOM_KNIGHTS} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker():IsControler(1-tp) 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.IsPlayerCanSpecialSummonMonster(tp,id,SET_THE_PHANTOM_KNIGHTS,TYPE_MONSTER|TYPE_EFFECT,0,0,2,RACE_WARRIOR,ATTRIBUTE_DARK) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if not Duel.NegateAttack() then return end Duel.BreakEffect() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler() if not c:IsRelateToEffect(e) or not Duel.IsPlayerCanSpecialSummonMonster(tp,id,SET_THE_PHANTOM_KNIGHTS,TYPE_MONSTER|TYPE_EFFECT,0,0,2,RACE_WARRIOR,ATTRIBUTE_DARK) then return end c:AddMonsterAttribute(TYPE_EFFECT) Duel.SpecialSummonStep(c,1,tp,tp,true,false,POS_FACEUP_ATTACK) c:AddMonsterAttributeComplete() Duel.SpecialSummonComplete() end function s.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 end function s.cfilter(c) if c:IsFacedown() or not c:IsAbleToGraveAsCost() then return false end return (c:IsSetCard(SET_THE_PHANTOM_KNIGHTS) and c:IsMonster()) or (c:IsSetCard(SET_PHANTOM_KNIGHTS) and c:IsSpellTrap() and c:IsType(TYPE_CONTINUOUS)) end function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,c) g:AddCard(c) Duel.SendtoGrave(g,REASON_COST) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) 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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate this card only if you control a Level 6 or higher "Yosenju" monster. While you have a "Yosenju" card in your Pendulum Zone, if a monster would be returned from the field to the hand by a card effect, shuffle it into the Deck instead, unless it is a "Yosenju" monster.
--妖仙郷の眩暈風 --Dizzying Winds of Yosen Village local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) c:RegisterEffect(e1) --todeck local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE) e2:SetRange(LOCATION_SZONE) e2:SetCode(EFFECT_TO_HAND_REDIRECT) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(s.tdtg) e2:SetCondition(s.tdcon) e2:SetValue(LOCATION_DECKSHF) c:RegisterEffect(e2) end s.listed_series={SET_YOSENJU} function s.filter(c) return c:IsFaceup() and c:IsLevelAbove(6) and c:IsSetCard(SET_YOSENJU) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end function s.tdtg(e,c) return (c:IsFacedown() or not c:IsSetCard(SET_YOSENJU)) and c:IsReason(REASON_EFFECT) end function s.tdcon(e) return Duel.IsExistingMatchingCard(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,nil,SET_YOSENJU) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can discard 1 card, then target 1 "Fire Formation" Spell/Trap you control; Set 1 "Fire Formation" Spell/Trap with a different name directly from your Deck. If this card is Special Summoned by the effect of a "Fire Fist" monster: You can Set 1 "Fire Formation" Spell/Trap directly from your Deck, with a different name from the cards in your GY. You can only use each effect of "Brotherhood of the Fire Fist - Ram" once per turn.
--魁炎星-シーブ --Brotherhood of the Fire Fist - Ram --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --When normal summoned, set 1 "Fire Formation" spell/trap from deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetCost(s.setcost) e1:SetTarget(s.settg) e1:SetOperation(s.setop) c:RegisterEffect(e1) --If special summoned by effect of a "Fire Fist" monster, set 1 "Fire Formation" spell/trap from deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.setcon2) e2:SetTarget(s.settg2) e2:SetOperation(s.setop2) c:RegisterEffect(e2) end s.listed_series={SET_FIRE_FORMATION,SET_FIRE_FIST} function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.setfilter(c,tp) return c:IsFaceup() and c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and Duel.IsExistingMatchingCard(s.setfilter2,tp,LOCATION_DECK,0,1,nil,c) end function s.setfilter2(c,tc) return c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and not c:IsCode(tc:GetCode()) and c:IsSSetable() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsOnField() and s.setfilter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.setfilter2,tp,LOCATION_DECK,0,1,1,nil,tc) if #g>0 then Duel.SSet(tp,g:GetFirst()) end end function s.setcon2(e,tp,eg,ep,ev,re,r,rp) return re and re:IsMonsterEffect() and re:GetHandler():IsSetCard(SET_FIRE_FIST) end function s.setfilter3(c,tp) return c:IsSetCard(SET_FIRE_FORMATION) and c:IsSpellTrap() and c:IsSSetable() and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,c:GetCode()) end function s.settg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter3,tp,LOCATION_DECK,0,1,nil,tp) end end function s.setop2(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.setfilter3,tp,LOCATION_DECK,0,1,1,nil,tp) if #g>0 then Duel.SSet(tp,g:GetFirst()) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute 1 Dinosaur monster; this card gains 500 ATK. If this card destroys an opponent's monster by battle and sends it to the GY: This card gains 300 ATK.
--ジュラック・ティラヌス --Jurrac Tyrannus local s,id=GetID() function s.initial_effect(c) --atkup local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetLabel(500) e1:SetCost(s.atkcost) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetLabel(300) e2:SetCondition(s.atkcon) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsRace,1,false,nil,e:GetHandler(),RACE_DINOSAUR) end local sg=Duel.SelectReleaseGroupCost(tp,Card.IsRace,1,1,false,nil,e:GetHandler(),RACE_DINOSAUR) Duel.Release(sg,REASON_COST) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(e:GetLabel()) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsFaceup() and c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE) and bc:IsMonster() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can Special Summon 1 Level 2 or lower Normal Monster from your hand or Deck in Defense Position.
--ドラコネット --Draconnet local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.spfilter(c,e,tp) return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(2) 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 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end 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)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 3 monsters Once per turn: You can detach 1 material from this card, then target 1 card you control and 1 card your opponent controls; destroy them. If this Xyz Summoned card is destroyed: You can target 2 "The Phantom Knights" monsters with the same Level in your GY; Special Summon them and increase their Levels by 1, also you cannot Special Summon monsters for the rest of this turn, except DARK monsters.
--幻影騎士団ブレイクソード --The Phantom Knights of Break Sword local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,nil,3,2) c:EnableReviveLimit() --Destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(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_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_THE_PHANTOM_KNIGHTS} function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g1=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tg=g:Filter(Card.IsRelateToEffect,nil,e) if #tg>0 then Duel.Destroy(tg,REASON_EFFECT) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsXyzSummoned() end function s.spfilter1(c,e,tp) return c:HasLevel() and c:IsSetCard(SET_THE_PHANTOM_KNIGHTS) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(s.spfilter2,tp,LOCATION_GRAVE,0,1,c,c:GetLevel(),e,tp) end function s.spfilter2(c,lv,e,tp) return c:GetLevel()==lv and c:IsSetCard(SET_THE_PHANTOM_KNIGHTS) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g1=Duel.SelectTarget(tp,s.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local tc1=g1:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g2=Duel.SelectTarget(tp,s.spfilter2,tp,LOCATION_GRAVE,0,1,1,tc1,tc1:GetLevel(),e,tp) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=tg:Filter(Card.IsRelateToEffect,nil,e) local ct=#g if ft>0 and ct<=ft and (ct==1 or not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) then local tc=g:GetFirst() for tc in aux.Next(g) do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(1) tc:RegisterEffect(e1) end Duel.SpecialSummonComplete() end local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e2:SetDescription(aux.Stringid(id,2)) e2:SetTargetRange(1,0) e2:SetTarget(s.splimit) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) end function s.splimit(e,c) return not c:IsAttribute(ATTRIBUTE_DARK) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Synchro Summoned. Must be Special Summoned (from your Extra Deck) by sending 2 monsters you control with a Level difference of 1 to the GY (1 Tuner and 1 non-Tuner). You can Tribute 1 Level 8 "Ursarctic" monster from your hand or field and this card; Special Summon 1 Level 7 "Ursarctic" Synchro Monster from your Extra Deck, ignoring its Summoning conditions, and if you do, it gains this effect. ● Your opponent cannot activate the effects of monsters with a Level, that were Special Summoned from the Extra Deck.
--ベアルクティ-ポーラ=スター --Ursarctic Polar Star --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() c:AddMustBeSpecialSummoned() --Must be Special Summoned (from your Extra Deck) by sending 2 monsters you control with a Level difference of 1 to the GY (1 Tuner and 1 non-Tuner) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_SPSUMMON_PROC) e0:SetRange(LOCATION_EXTRA) e0:SetCondition(s.sprcon) e0:SetTarget(s.sprtg) e0:SetOperation(s.sprop) c:RegisterEffect(e0) --Special Summon 1 Level 7 "Ursarctic" Synchro Monster from your Extra Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCost(aux.CostWithReplace(s.spcost,CARD_URSARCTIC_BIG_DIPPER,s.extracon)) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_URSARCTIC} function s.sprfilter(c) return c:IsFaceup() and c:IsAbleToGraveAsCost() and c:HasLevel() end function s.sprfilter1(c,tp,g,sc) local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil) return c:IsType(TYPE_TUNER) and g:IsExists(s.sprfilter2,1,c,tp,c,sc) end function s.sprfilter2(c,tp,mc,sc) local sg=Group.FromCards(c,mc) return (math.abs((c:GetLevel()-mc:GetLevel()))==1) and not c:IsType(TYPE_TUNER) and Duel.GetLocationCountFromEx(tp,tp,sg,sc)>0 end function s.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil) return g:IsExists(s.sprfilter1,1,nil,tp,g,c) end function s.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c) local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil) local g1=g:Filter(s.sprfilter1,nil,tp,g,c) local mg1=aux.SelectUnselectGroup(g1,e,tp,1,1,nil,1,tp,HINTMSG_TOGRAVE,nil,nil,true) if #mg1>0 then local mc=mg1:GetFirst() local g2=g:Filter(s.sprfilter2,mc,tp,mc,c,mc:GetLevel()) local mg2=aux.SelectUnselectGroup(g2,e,tp,1,1,nil,1,tp,HINTMSG_TOGRAVE,nil,nil,true) mg1:Merge(mg2) end if #mg1==2 then mg1:KeepAlive() e:SetLabelObject(mg1) return true end return false end function s.sprop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.SendtoGrave(g,REASON_COST) end function s.spcheck(sg,tp,exg,e) local c=e:GetHandler() return sg:IsExists(s.ursfilter,1,c) and sg:IsContains(c) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg+c) end function s.ursfilter(c) return c:IsSetCard(SET_URSARCTIC) and c:IsLevel(8) end function s.spfilter(c,e,tp,mustg) return c:IsLevel(7) and c:IsSetCard(SET_URSARCTIC) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,mustg,c)>0 end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,2,2,true,s.spcheck,nil,e) end local sg=Duel.SelectReleaseGroupCost(tp,nil,2,2,true,s.spcheck,nil,e) Duel.Release(sg,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) 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,true,false,POS_FACEUP)>0 then --It gains this effect: ● Your opponent cannot activate the effects of monsters with a Level, that were Special Summoned from the Extra Deck. local e1=Effect.CreateEffect(sc) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(0,1) e1:SetValue(s.aclimit) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1,true) if not sc:IsType(TYPE_EFFECT) then local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetValue(TYPE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e2,true) end sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1)) end end function s.aclimit(e,re,tp) local rc=re:GetHandler() return re:IsMonsterEffect() and rc:HasLevel() and rc:IsSummonLocation(LOCATION_EXTRA) and rc:IsLocation(LOCATION_MZONE) end function s.extracon(base,e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card can be treated as 2 Tributes for the Tribute Summon of a "Steelswarm" monster.
--インヴェルズ万能態 --Steelswarm Genome local s,id=GetID() function s.initial_effect(c) --double tribute local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DOUBLE_TRIBUTE) e1:SetValue(s.condition) c:RegisterEffect(e1) end s.listed_series={SET_STEELSWARM} function s.condition(e,c) return c:IsSetCard(SET_STEELSWARM) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a face-up Psychic-Type monster, you can Normal Summon this card without Tributing. If this card destroys an opponent's monster by battle, you take damage equal to half the destroyed monster's ATK. Then, you can Special Summon 1 monster from your Graveyard with ATK less than or equal to the damage you took.
--アーマード・サイキッカー --Armored Axon Kicker local s,id=GetID() function s.initial_effect(c) --Normal Summon without tributing local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SUMMON_PROC) e1:SetCondition(s.ntcon) c:RegisterEffect(e1) --Take damage and Special Summon 1 monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(s.damcon) e2:SetTarget(s.damtg) e2:SetOperation(s.damop) c:RegisterEffect(e2) end function s.ntcon(e,c,minc) if c==nil then return true end return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_PSYCHIC),c:GetControler(),LOCATION_MZONE,0,1,nil) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsRelateToBattle() and c:GetBattleTarget():IsMonster() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local bc=e:GetHandler():GetBattleTarget() local dam=bc:GetAttack()/2 if dam<0 then dam=0 end Duel.SetTargetParam(dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,dam) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spfilter(c,e,tp,atk) return c:IsAttackBelow(atk) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local dam=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) if Duel.Damage(tp,dam,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp,dam) if #g~=0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 "Rokket" monster, then target 1 "Borrel" Link Monster you control; equip it with this card. If this card is equipped to a monster by this effect, the equipped monster gains this effect. ● Once per turn (Quick Effect): You can target 1 monster you control; it cannot be destroyed by battle or card effect this turn.
--ヴァレル・レフリジェレーション --Borrel Cooling local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_ROKKET,SET_BORREL} function s.cfilter(c,tp) return c:IsSetCard(SET_ROKKET) and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,c) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,tp) end local rg=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,tp) Duel.Release(rg,REASON_COST) aux.RemainFieldCost(e,tp,eg,ep,ev,re,r,rp,1) end function s.tgfilter(c) return c:IsFaceup() and c:IsLinkMonster() and c:IsSetCard(SET_BORREL) 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.tgfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.eqlimit(e,c) return c:GetControler()==e:GetHandlerPlayer() and c:IsType(TYPE_LINK) and c:IsSetCard(SET_BORREL) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsLocation(LOCATION_SZONE) or not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then local fid=c:GetFieldID() Duel.Equip(tp,c,tc) tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid) --Equip limit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(s.eqlimit) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) --Granted effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetReset(RESET_EVENT|RESETS_STANDARD) e2:SetCountLimit(1) e2:SetTarget(s.indtg) e2:SetOperation(s.indop) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e3:SetRange(LOCATION_SZONE) e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e3:SetTarget(s.eftg) e3:SetLabelObject(e2) c:RegisterEffect(e3) else c:CancelToGrave(false) end end function s.eftg(e,c) return e:GetHandler():GetEquipTarget()==c end function s.indtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) end function s.indop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then --Cannot be destroyed by battle or card effect local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3008) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can place 1 "Obsidim, the Ashened City" from your Deck, face-up in either Field Zone. You can target 1 face-up card your opponent controls and 1 Level 8 or higher DARK Pyro monster in your GY; send that card on the field to the GY, and if you do, Special Summon that other monster from your GY to your opponent's field in Defense Position. You can only use this effect of "Inferno of the Ashened" once per turn. You can only activate 1 "Inferno of the Ashened" per turn.
--灰滅の劫火 --Inferno of the Ashened --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --When this card is activated: You can place 1 "Obsidim, the Ashened City" from your Deck face-up in either Field Zone local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Send 1 face-up card your opponent controls to the GY and Special Summon 1 Level 8 or higher DARK Pyro monster from your GY to your opponent's field in Defense Position local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.tgsptg) e2:SetOperation(s.tgspop) c:RegisterEffect(e2) end s.listed_names={CARD_OBSIDIM_ASHENED_CITY} function s.plfilter(c) return c:IsCode(CARD_OBSIDIM_ASHENED_CITY) and not c:IsForbidden() end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.plfilter,tp,LOCATION_DECK,0,nil,tp) if Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if sc then local op=Duel.SelectOption(tp,false,aux.Stringid(id,3),aux.Stringid(id,4)) local target_player=op==0 and tp or 1-tp Duel.MoveToField(sc,tp,target_player,LOCATION_FZONE,POS_FACEUP,true) end end end function s.tgfilter(c,tp) return c:IsFaceup() and c:IsAbleToGrave() and Duel.GetMZoneCount(1-tp,c)>0 end function s.spfilter(c,e,tp) return c:IsLevelAbove(8) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_PYRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp) end function s.tgsptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,0,LOCATION_ONFIELD,1,nil,tp) and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g1=Duel.SelectTarget(tp,s.tgfilter,tp,0,LOCATION_ONFIELD,1,1,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g2=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,tp,0) end function s.tgspop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg==0 then return end local fg,gg=tg:Split(Card.IsLocation,nil,LOCATION_ONFIELD) if #fg>0 and Duel.SendtoGrave(fg,REASON_EFFECT)>0 and fg:GetFirst():IsLocation(LOCATION_GRAVE) and #gg>0 then Duel.SpecialSummon(gg,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(This card is always treated as a "Rescue-ACE" card.) If you control a "Rescue-ACE" monster: Target 1 Effect Monster your opponent controls; this turn, that Effect Monster cannot attack, also its effects are negated. If you control "Rescue-ACE Hydrant" at resolution of this effect, that monster also cannot be used as material for a Fusion, Synchro, Xyz, or Link Summon this turn.
--CONTAIN! --CONTAIN! --Scripted by IanxWaifu local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_RESCUE_ACE} s.listed_names={CARD_R_ACE_HYDRANT} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_RESCUE_ACE),tp,LOCATION_MZONE,0,1,nil) 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_MZONE) and chkc:IsFaceup() and chkc:IsType(TYPE_EFFECT) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsType,TYPE_EFFECT),tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_EFFECT) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local c=e:GetHandler() --Negate its effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) tc:RegisterEffect(e2) --Cannot attack local e3=Effect.CreateEffect(c) e3:SetDescription(3206) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_CLIENT_HINT) e3:SetCode(EFFECT_CANNOT_ATTACK) e3:SetValue(1) e3:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e3) if not Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_R_ACE_HYDRANT),tp,LOCATION_ONFIELD,0,1,nil) then return end --Cannot be used as material for a Fusion/Synchro/Xyz/Link Summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CLIENT_HINT) e4:SetCode(EFFECT_CANNOT_BE_MATERIAL) e4:SetValue(aux.cannotmatfilter(SUMMON_TYPE_FUSION,SUMMON_TYPE_SYNCHRO,SUMMON_TYPE_XYZ,SUMMON_TYPE_LINK)) e4:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e4) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is face-up on the field at the end of the Battle Phase: Destroy this face-up card. You can send this card from your hand to the Graveyard; Special Summon up to 2 Zombie-Type monsters from your hand whose combined ATK is exactly 2000.
--スカル・コンダクター --Skull Conductor local s,id=GetID() function s.initial_effect(c) --Destroy this face-up card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_PHASE|PHASE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Special Summon up to 2 Zombie-Type monsters from your hand whose combined ATK is exactly 2000 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCost(Cost.SelfToGrave) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then Duel.Destroy(c,REASON_EFFECT) end end function s.spfilter(c,e,tp) return c:IsRace(RACE_ZOMBIE) and c:IsAttackAbove(0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.rescon(ft) return function(sg,e,tp,mg) return ft>=#sg and sg:GetSum(Card.GetAttack)==2000,ft<#sg end 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 ft<=0 then return false end ft=math.min(ft,2) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,e:GetHandler(),e,tp) return #g>0 and aux.SelectUnselectGroup(g,e,tp,1,ft,s.rescon(ft),0) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return false end ft=math.min(ft,2) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp) if #g==0 then return end local sg=aux.SelectUnselectGroup(g,e,tp,1,ft,s.rescon(ft),1,tp,HINTMSG_SPSUMMON,s.rescon(ft)) if #sg>0 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your opponent's Standby Phase, toss a coin: ● Heads: Your opponent cannot Normal or Flip Summon until the End Phase. ● Tails: You cannot Normal or Flip Summon during your next turn.
--死神の巡遊 --Tour of Doom local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_STANDBY_PHASE) c:RegisterEffect(e1) --Toss a coin and apply the appropriate effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_COIN) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_PHASE|PHASE_STANDBY) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(function(_,tp) return Duel.IsTurnPlayer(1-tp) end) e2:SetTarget(s.cointg) e2:SetOperation(s.coinop) c:RegisterEffect(e2) end s.toss_coin=true function s.cointg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1) end function s.coinop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local function register_eff(player) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,1)) e1:SetCode(EFFECT_CANNOT_SUMMON) if player==tp then e1:SetReset(RESET_PHASE|PHASE_END,2) e1:SetTargetRange(1,0) local cur_turn=Duel.GetTurnCount() e1:SetCondition(function()return Duel.GetTurnCount()~=cur_turn end) else e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(0,1) end Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_FLIP_SUMMON) Duel.RegisterEffect(e2,tp) end local res=Duel.TossCoin(tp,1) if res==COIN_HEADS then register_eff(1-tp) elseif res==COIN_TAILS then register_eff(tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(This card is always treated as a "Charmer" card.) You can discard this card and 1 EARTH monster; add 1 EARTH monster from your Deck to your hand with 1850 or less ATK, whose original Type is the same as one of the discarded monsters, also you cannot activate non-EARTH monster effects for the rest of this turn. When your EARTH monster is destroyed by battle: You can Special Summon this card from your hand. You can only use each effect of "Aussa the Earth Channeler" once per turn.
--地霊媒師アウス --Aussa the Earth Channeler local s,id=GetID() function s.initial_effect(c) --Search 1 EARTH monster with 1850 or less ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Special Summon itself from the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={id} s.listed_series={SET_CHARMER} function s.disfilter(c,tp,cc) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsDiscardable() and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,cc:GetOriginalRace(),c:GetOriginalRace()) end function s.thfilter(c,race1,race2) return c:IsMonster() and c:IsAttackBelow(1850) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(race1|race2) and c:IsAbleToHand() end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.disfilter,tp,LOCATION_HAND,0,1,c,tp,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_HAND,0,1,1,c,tp,c) e:SetLabel(c:GetOriginalRace(),g:GetFirst():GetOriginalRace()) g:AddCard(c) Duel.SendtoGrave(g,REASON_COST|REASON_DISCARD) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local race1,race2=e:GetLabel() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,race1,race2) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end --Cannot activate non-EARTH monster 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_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,0) e1:SetValue(function(_,re) return re:IsMonsterEffect() and re:GetHandler():IsAttributeExcept(ATTRIBUTE_EARTH) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.cfilter(c,tp) return c:GetPreviousAttributeOnField()&ATTRIBUTE_EARTH~=0 and c:IsPreviousControler(tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,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,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 3 monsters in your Graveyard; Special Summon all 3, but their effects are negated. Immediately after this effect resolves, Xyz Summon 1 "Utopia" or "Utopic" Xyz Monster using only those 3 monsters. You cannot Special Summon other monsters during the turn you activate this card.
--輝望道 --Shining Hope Road local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_UTOPIC} function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetLabelObject(e) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return se~=e:GetLabelObject() and c:GetFlagEffect(id)==0 end function s.filter(c,e,tp) return c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.xyzfilter(c,mg,tp) return c:IsSetCard(SET_UTOPIC) and c:IsXyzSummonable(nil,mg,3,3) end function s.rescon(exg) return function(sg) return #sg==3 and exg:IsExists(Card.IsXyzSummonable,1,nil,nil,sg,3,3) end end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local mg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,0,nil,e,tp) local exg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg) if chk==0 then return #exg>0 and Duel.IsPlayerCanSpecialSummonCount(tp,2) and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 end local sg=aux.SelectUnselectGroup(mg,e,tp,3,3,s.rescon(exg),1,tp,HINTMSG_SPSUMMON) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,2,0,0) end function s.filter2(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<3 then return end local g=Duel.GetTargetCards(e):Match(s.filter2,nil,e,tp) if #g~=3 then return end for tc in aux.Next(g) do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_DISABLE_EFFECT) tc:RegisterEffect(e2) end Duel.SpecialSummonComplete() Duel.BreakEffect() local xyzg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,tp) if #xyzg>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local xyz=xyzg:Select(tp,1,1,nil):GetFirst() xyz:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) Duel.XyzSummon(tp,xyz,g,nil,3,3) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If your opponent Normal or Special Summons a monster(s) (except during the Damage Step): You can take 1 "Orcust" or "World Legacy" monster from your hand or Deck, and either send it to the GY or banish it. You can only use this effect of "Orcustrated Einsatz" once per turn.
--オルフェゴール・アインザッツ --Orcustrated Einsatz --AlphaKretin local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Send to GY or banish 1 "Orcust" or "World Legacy" monster from your hand/Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id) e2:SetCondition(s.tgcon) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end s.listed_series={SET_WORLD_LEGACY,SET_ORCUST} function s.tgcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) end function s.tgfilter(c) return c:IsSetCard({SET_WORLD_LEGACY,SET_ORCUST}) and c:IsMonster() and (c:IsAbleToGrave() or c:IsAbleToRemove()) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil) end Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK|LOCATION_HAND) Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK|LOCATION_HAND) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK|LOCATION_HAND,0,1,1,nil) if #g>0 then local tc=g:GetFirst() if tc and tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectYesNo(tp,aux.Stringid(id,2))) then Duel.SendtoGrave(tc,REASON_EFFECT) else Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is used to Ritual Summon "Malacoda, Netherlord of the Burning Abyss". You must also Tribute monsters from your hand or field whose total Levels equal 6 or more. During your Main Phase, except the turn this card was sent to the Graveyard: You can banish this card from your Graveyard and send 1 "Burning Abyss" monster from your hand to the Graveyard; add 1 "Burning Abyss" card from your Deck to your hand. You can only use this effect of "Good & Evil in the Burning Abyss" once per turn.
--善悪の彼岸 --Good & Evil in the Burning Abyss local s,id=GetID() function s.initial_effect(c) Ritual.AddProcGreaterCode(c,6,nil,35330871) --search local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(aux.exccon) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) end s.listed_series={SET_BURNING_ABYSS} function s.cfilter(c) return c:IsSetCard(SET_BURNING_ABYSS) and c:IsMonster() and c:IsAbleToGraveAsCost() end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST,nil) end function s.filter(c) return c:IsSetCard(SET_BURNING_ABYSS) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,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 g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Main Phase, if a monster, whose effects are negated, is on the field (Quick Effect): You can Special Summon this card from your hand. If your opponent Special Summons a monster(s) (except during the Damage Step): You can activate 1 of these effects based on where it was Special Summoned from; ● Hand: Special Summon 1 monster from your hand. ● Deck: Draw 2 cards. ● Extra Deck: Destroy 1 of those monsters Special Summoned from the Extra Deck. You can only use each effect of "The Iris Swordsoul" once per turn.
--妖眼の相剣師 --The Iris Swordsoul --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Special Summon this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetHintTiming(0,TIMING_MAIN_END|TIMING_SUMMON|TIMING_SPSUMMON) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Special Summon 1 monster from your hand local e2=Effect.CreateEffect(c) 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_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetLabel(1) e2:SetCondition(s.hdexcon) e2:SetTarget(s.hdextg) e2:SetOperation(s.hdexop) c:RegisterEffect(e2) --Draw 2 cards local e3=e2:Clone() e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_DRAW) e3:SetLabel(2) c:RegisterEffect(e3) --Destroy 1 of those monsters Special Summoned from the Extra Deck local e4=e2:Clone() e4:SetDescription(aux.Stringid(id,3)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCategory(CATEGORY_DESTROY) e4:SetCode(EVENT_CUSTOM+id) e4:SetLabel(3) c:RegisterEffect(e4) local g=Group.CreateGroup() g:KeepAlive() e4:SetLabelObject(g) --Register summons local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetRange(LOCATION_MZONE) e5:SetLabelObject(g) e5:SetOperation(s.regop) c:RegisterEffect(e5) end function s.spcfilter(c) return c:IsFaceup() and c:IsDisabled() and c:IsType(TYPE_EFFECT) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsMainPhase() and Duel.IsExistingMatchingCard(s.spcfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) 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_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.hdexfilter(c,tp,loc) return c:IsOriginalType(TYPE_MONSTER) and c:IsSummonPlayer(1-tp) and c:IsSummonLocation(loc) and (loc~=LOCATION_EXTRA or c:IsOnField()) end function s.hdexcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local label=e:GetLabel() if c:GetFlagEffect(id+label)>0 then return false end local loc=0 if label==1 then loc=LOCATION_HAND elseif label==2 then loc=LOCATION_DECK elseif label==3 then loc=LOCATION_EXTRA eg=e:GetLabelObject() end if eg and eg:IsExists(s.hdexfilter,1,nil,tp,loc) then if Duel.GetCurrentChain()>0 then c:RegisterFlagEffect(id+label,RESET_CHAIN,0,1) end return true end return false end function s.spfilter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.hdextg(e,tp,eg,ep,ev,re,r,rp,chk) local label=e:GetLabel() if chk==0 then if label==1 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) elseif label==2 then return Duel.IsPlayerCanDraw(tp,2) elseif label==3 then local g=e:GetLabelObject():Filter(s.hdexfilter,nil,tp,LOCATION_EXTRA) return #g>0 end end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) if label==1 then Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) elseif label==2 then Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) elseif label==3 then local g=e:GetLabelObject():Filter(s.hdexfilter,nil,tp,LOCATION_EXTRA) Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end function s.hdexop(e,tp,eg,ep,ev,re,r,rp) local label=e:GetLabel() --Special Summon effect if label==1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then 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 --Draw effect elseif label==2 then local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) --Destroy effect elseif label==3 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=e:GetLabelObject():Match(Card.IsRelateToEffect,nil,e) g=g:FilterSelect(tp,s.hdexfilter,1,1,nil,tp,LOCATION_EXTRA) if #g>0 then Duel.HintSelection(g,true) Duel.Destroy(g,REASON_EFFECT) end end end function s.regop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFlagEffect(tp,id)>0 then return end local c=e:GetHandler() local tg=eg:Filter(s.hdexfilter,nil,tp,LOCATION_EXTRA) if #tg>0 and not tg:IsContains(c) then for tc in aux.Next(tg) do tc:RegisterFlagEffect(id,RESET_CHAIN,0,1) end local g=e:GetLabelObject() if Duel.GetCurrentChain()==0 then g:Clear() end g:Remove(function(c) return c:GetFlagEffect(id)==0 end,nil) g:Merge(tg) Duel.RaiseSingleEvent(c,EVENT_CUSTOM+id,e,0,tp,tp,0) end end