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:
If this card is Normal or Special Summoned: You can target 1 "Memento" card in your GY, except "Mementotlan Ghattic"; add it to your hand. If this card is sent to the GY by a "Memento" monster's effect: You can Special Summon this card. You can only use each effect of "Mementotlan Ghattic" once per turn.
--メメント・ウラモン --Mementotlan Ghattic --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Add 1 "Memento" card from your GY to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) 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 this card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(function(e,tp,eg,ep,ev,re) return e:GetHandler():IsReason(REASON_EFFECT) and re and re:IsMonsterEffect() and re:GetHandler():IsSetCard(SET_MEMENTO) end) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_MEMENTO} s.listed_names={id} function s.thfilter(c) return c:IsSetCard(SET_MEMENTO) and not c:IsCode(id) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,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) Duel.ConfirmCards(1-tp,tc) 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:
When an opponent's monster declares an attack, if you control an "Altergeist" card: You can Special Summon this card from your hand, and if you do, negate that attack. If this card is Special Summoned: You can target 1 face-up card your opponent controls; negate the effects of that card while it and this monster are face-up on the field.
--オルターガイスト・クンティエリ --Altergeist Kunquery local s,id=GetID() function s.initial_effect(c) --Negate attack 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:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Negate effects local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) end s.listed_series={SET_ALTERGEIST} function s.condition(e,tp,eg,ep,ev,re,r,rp) local at=Duel.GetAttacker() return at:IsControler(1-tp) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_ALTERGEIST),tp,LOCATION_ONFIELD,0,1,nil) end function s.target(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.operation(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.NegateAttack() end end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsNegatable() end if chk==0 then return Duel.IsExistingTarget(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then c:SetCardTarget(tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetCondition(s.rcon) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) if tc:IsType(TYPE_TRAPMONSTER) then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_TRAPMONSTER) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end end end function s.rcon(e) return e:GetOwner():IsHasCardTarget(e:GetHandler()) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a "Marincess" Link Monster: Target 1 face-up monster your opponent controls; negate that face-up monster's effects until the end of this turn, then, if you control a Link-2 or higher "Marincess" monster, all face-up monsters you currently control are unaffected by your opponent's card effects until the end of this turn. If you control a Link-3 or higher "Marincess" monster, you can activate this card from your hand.
--海晶乙女波動 --Marincess Wave --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Negate 1 of opponent's monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCondition(s.discon) e1:SetTarget(s.distg) e1:SetOperation(s.disop) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END) c:RegisterEffect(e1) --Activate it from hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetCondition(s.actcon) c:RegisterEffect(e2) end s.listed_series={SET_MARINCESS} function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_MARINCESS) and c:IsLinkMonster() end function s.discon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.disfilter(c) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled() end function s.distg(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:IsNegatableMonster() end if chk==0 then return Duel.IsExistingTarget(Card.IsNegatableMonster,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.IsNegatableMonster,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local c=e:GetHandler() if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e) then 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=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) if #g>0 and Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,nil):IsExists(Card.IsLinkAbove,1,nil,2) then Duel.BreakEffect() for gc in g:Iter() do --Your monsters are unaffected by opponent's card effects local e3=Effect.CreateEffect(c) e3:SetDescription(3110) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT) e3:SetRange(LOCATION_MZONE) e3:SetValue(s.efilter) e3:SetOwnerPlayer(tp) e3:SetReset(RESETS_STANDARD_PHASE_END) gc:RegisterEffect(e3) end end end end function s.efilter(e,re) return e:GetOwnerPlayer()~=re:GetOwnerPlayer() end function s.actfilter(c) return c:IsFaceup() and c:IsSetCard(SET_MARINCESS) and c:IsLinkMonster() and c:IsLinkAbove(3) end function s.actcon(e) return Duel.IsExistingMatchingCard(s.actfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters from your hand or Deck as Fusion Material, including a "Destiny HERO" monster that it lists as material, but destroy it during the End Phase of the next turn, also for the rest of this turn after this card resolves, you cannot Special Summon monsters, except DARK "HERO" monsters. You can only activate 1 "Fusion Destiny" per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--フュージョン・デステニー --Fusion Destiny local s,id=GetID() function s.initial_effect(c) --activate local e1=Fusion.CreateSummonEff(c,aux.FilterBoolFunction(Card.ListsArchetypeAsMaterial,SET_DESTINY_HERO),Fusion.InHandMat,s.fextra,nil,nil,s.stage2,nil,nil,nil,nil,nil,nil,nil,s.extratg) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) c:RegisterEffect(e1) end s.listed_series={SET_HERO,SET_DESTINY_HERO} function s.fcheck(tp,sg,fc) return sg:IsExists(aux.FilterBoolFunction(Card.IsSetCard,SET_DESTINY_HERO,fc,SUMMON_TYPE_FUSION,tp),1,nil) end function s.fextra(e,tp,mg) return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToGrave),tp,LOCATION_DECK,0,nil),s.fcheck end function s.extratg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_HAND|LOCATION_DECK) end function s.stage2(e,tc,tp,mg,chk) local c=e:GetHandler() if chk==0 then tc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,2) end if chk==1 then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCondition(s.descon) e2:SetOperation(s.desop) e2:SetReset(RESET_PHASE|PHASE_END,2) e2:SetCountLimit(1) e2:SetLabel(Duel.GetTurnCount()) e2:SetLabelObject(tc) Duel.RegisterEffect(e2,tp) end if chk==2 then if e:IsHasType(EFFECT_TYPE_ACTIVATE) then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) 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(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end end end function s.splimit(e,c) return not (c:IsSetCard(SET_HERO) and c:IsAttribute(ATTRIBUTE_DARK)) end function s.descon(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(id)~=0 end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() Duel.Destroy(tc,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is activated: You can target 1 Level 4 or lower "Dragunity" monster in your GY; add it to your hand. If your "Dragunity" monster whose original Level is 5 or higher attacks, it is unaffected by your opponent's card effects until the end of the Damage Step. You can only activate 1 "Dragunity Draft" per turn.
--ドラグニティ・ドラフト --Dragunity Draft --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCode(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Your Level 5 or higher "Dragunity" monsters are unaffected when attacking local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_SZONE) e2:SetCondition(s.imcon) e2:SetOperation(s.imop) c:RegisterEffect(e2) end s.listed_series={SET_DRAGUNITY} function s.thfilter(c,e) return c:IsSetCard(SET_DRAGUNITY) and c:IsMonster() and c:IsLevelBelow(4) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc,e) end if chk==0 then return true end local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_GRAVE,0,nil,e) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local sg=g:Select(tp,1,1,nil) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,1,0,LOCATION_GRAVE) 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) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.imcon(e,tp,eg,ep,ev,re,r,rp) local ac=Duel.GetAttacker() return ac and ac:IsControler(tp) and ac:IsSetCard(SET_DRAGUNITY) and ac:GetOriginalLevel()>=5 end function s.imop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetValue(s.efilter) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE) Duel.GetAttacker():RegisterEffect(e1) Duel.AdjustInstantly(Duel.GetAttacker()) end function s.efilter(e,te) return te:GetHandlerPlayer()~=e:GetOwnerPlayer() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] Once per turn, when a Fusion Monster(s) is Special Summoned to your side of the field (except during the Damage Step): You can Special Summon 1 face-up "Odd-Eyes" Pendulum Monster from your Extra Deck. ---------------------------------------- [ Monster Effect ] During your Main Phase: You can Fusion Summon 1 Dragon-Type Fusion Monster from your Extra Deck, using monsters you control as Fusion Materials. You can only use this effect of "Performapal Splashmammoth" once per Duel.
--EMマンモスプラッシュ --Performapal Splashmammoth local s,id=GetID() function s.initial_effect(c) --pendulum summon Pendulum.AddProcedure(c) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_PZONE) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --spsummon local params = {aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),Fusion.OnFieldMat} local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id,EFFECT_COUNT_CODE_DUEL) e3:SetTarget(Fusion.SummonEffTG(table.unpack(params))) e3:SetOperation(Fusion.SummonEffOP(table.unpack(params))) c:RegisterEffect(e3) end s.listed_series={SET_ODD_EYES} function s.cfilter(c,tp) return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsControler(tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.spfilter(c,e,tp) return c:IsFaceup() and c:IsSetCard(SET_ODD_EYES) and c:IsType(TYPE_PENDULUM) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Destroy as many Tokens you control as possible, then destroy cards on the field up to the number of Tokens destroyed by this effect.
--トークン復活祭 --Token Sundae 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_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c) return c:IsType(TYPE_TOKEN) end function s.dfilter(c) return not c:IsType(TYPE_TOKEN) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,0,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.cfilter,tp,LOCATION_MZONE,0,nil) local dt=Duel.Destroy(g,REASON_EFFECT) if dt==0 then return end local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) if #dg>0 then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local sg=dg:Select(tp,1,dt,nil) Duel.HintSelection(sg) Duel.Destroy(sg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can banish 1 FIRE monster from your Graveyard to target 1 card in your opponent's Graveyard; banish that target.
--火遁封印式 --Sealing Ceremony of Katon 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) --remove local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_REMOVE) e2:SetDescription(aux.Stringid(id,1)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCountLimit(1) e2:SetCost(s.rmcost) e2:SetTarget(s.rmtg) e2:SetOperation(s.rmop) c:RegisterEffect(e2) end function s.cfilter(c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.rmfilter(c) return c:IsAbleToRemove() and aux.SpElimFilter(c) end function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local cg=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) Duel.Remove(cg,POS_FACEUP,REASON_COST) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and chkc:IsControler(1-tp) and s.rmfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_MZONE|LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end 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 Winged Beast "Dragunity" monster from your hand, then equip it with this card. While this card is equipped to a monster, that monster can attack your opponent directly, but when it does so using this effect, the battle damage inflicted to your opponent is halved.
--ドラグニティ-ピルム --Dragunity Pilum local s,id=GetID() function s.initial_effect(c) --Equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP) 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) --Direct attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e2) --Reduce battle damage local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e3:SetCondition(s.rdcon) e3:SetValue(aux.ChangeBattleDamage(1,HALF_DAMAGE)) c:RegisterEffect(e3) end s.listed_series={SET_DRAGUNITY} function s.filter(c,e,tp) return c:IsSetCard(SET_DRAGUNITY) and c:IsRace(RACE_WINGEDBEAST) 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.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local tc=g:GetFirst() if not tc then return end Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) local c=e:GetHandler() if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end Duel.BreakEffect() if not Duel.Equip(tp,c,tc,false) then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) end function s.eqlimit(e,c) return e:GetLabelObject()==c end function s.rdcon(e) local c,tp=e:GetHandler():GetEquipTarget(),e:GetHandlerPlayer() return Duel.GetAttackTarget()==nil and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While you control "Shining Sarcophagus", you can Normal Summon this card without Tributing. Other monsters you control gain 500 ATK, during your turn only. If this card is Normal or Special Summoned: You can target 1 monster your opponent controls; take control of it until the End Phase, but that monster cannot attack unless you controlled "Shining Sarcophagus" when this effect was activated. You can only use this effect of "Archfiend's Advent" once per turn.
--デーモンの光来 --Archfiend's Advent --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Can be Normal Summoned without Tributing if you control "Shining Sarcophagus" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.notribcon) c:RegisterEffect(e1) --Take control of 1 of your opponent's monsters until the End Phase local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_CONTROL) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,id) e2:SetTarget(s.ctrltg) e2:SetOperation(s.ctrlop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --Other monsters you control gain 500 ATK during your turn local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(LOCATION_MZONE,0) e4:SetCondition(function(e) return Duel.IsTurnPlayer(e:GetHandlerPlayer()) end) e4:SetTarget(function(e,c) return c~=e:GetHandler() end) e4:SetValue(500) c:RegisterEffect(e4) end s.listed_names={CARD_SHINING_SARCOPHAGUS} function s.notribcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_SHINING_SARCOPHAGUS),tp,LOCATION_ONFIELD,0,1,nil) end function s.ctrltg(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,tp,0) e:SetLabel(Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_SHINING_SARCOPHAGUS),tp,LOCATION_ONFIELD,0,1,nil) and 1 or 0) end function s.ctrlop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp,PHASE_END,1) and e:GetLabel()==0 then --Cannot attack while you control it local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_CONTROL) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card destroys an opponent's monster by battle and sends it to the Graveyard: Inflict damage to your opponent equal to half the original ATK of that monster in the Graveyard.
--オッドアイズ・ドラゴン --Odd-Eyes Dragon local s,id=GetID() function s.initial_effect(c) --damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCondition(s.damcon) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) c:RegisterEffect(e1) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsMonster() 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():GetAttack()/2 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
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) by having exactly 5 WIND monsters in your GY. If this card is Special Summoned: Destroy all Spells and Traps your opponent controls. You can only use this effect of "Windrose the Elemental Lord" once per turn. If this face-up card leaves the field, skip the Battle Phase of your next turn.
--風霊神ウィンドローズ --Windrose the Elemental Lord local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --cannot special summon 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 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) --leave local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_LEAVE_FIELD_P) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e4:SetOperation(s.leaveop) c:RegisterEffect(e4) end function s.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetMatchingGroupCount(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_WIND)==5 end function s.desfilter(c) return c:IsSpellTrap() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_ONFIELD,nil) Duel.Destroy(g,REASON_EFFECT) end function s.leaveop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsFacedown() then return end local effp=e:GetHandler():GetControler() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SKIP_BP) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) if Duel.GetTurnPlayer()==effp then e1:SetLabel(Duel.GetTurnCount()) e1:SetCondition(s.skipcon) e1:SetReset(RESET_PHASE|PHASE_END|RESET_SELF_TURN,2) else e1:SetReset(RESET_PHASE|PHASE_END|RESET_SELF_TURN,1) end Duel.RegisterEffect(e1,effp) end function s.skipcon(e) return Duel.GetTurnCount()~=e:GetLabel() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During each of your End Phases, destroy this card unless you reveal 1 "Iron Core of Koa'ki Meiru" in your hand. Each time a "Koa'ki Meiru" monster on the field is destroyed during the End Phase, its owner can add 1 "Koa'ki Meiru" monster from their Deck to their hand.
--鋼核合成獣研究所 --Iron Core Specimen Lab 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) --maintain local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_FZONE) e2:SetCountLimit(1) e2:SetCondition(s.mtcon) e2:SetOperation(s.mtop) c:RegisterEffect(e2) --search local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetDescription(aux.Stringid(id,2)) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetRange(LOCATION_FZONE) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER) e4:SetCode(EVENT_CUSTOM+id) e4:SetTarget(s.target) e4:SetOperation(s.operation) c:RegisterEffect(e4) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_DESTROY) ge1:SetOperation(s.check) Duel.RegisterEffect(ge1,0) end) end s.listed_series={SET_KOAKI_MEIRU} s.listed_names={36623431} function s.cfilter(c) return c:IsCode(36623431) and not c:IsPublic() end function s.mtcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.mtop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.HintSelection(Group.FromCards(c)) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_HAND,0,nil) local sel=1 if #g~=0 then sel=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) else sel=Duel.SelectOption(tp,aux.Stringid(id,1))+1 end if sel==0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local cg=g:Select(tp,1,1,nil) Duel.ConfirmCards(1-tp,cg) Duel.ShuffleHand(tp) else Duel.Destroy(c,REASON_COST) end end function s.check(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetCurrentPhase()~=PHASE_END then return end local turnp=Duel.GetTurnPlayer() local g1=Group.CreateGroup() local g2=Group.CreateGroup() for tc in aux.Next(eg) do if tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and tc:IsSetCard(SET_KOAKI_MEIRU) then if tc:GetOwner()==turnp then g1:AddCard(tc) else g2:AddCard(tc) end end end if #g1>0 then Duel.RaiseEvent(g1,EVENT_CUSTOM+id,re,r,rp,turnp,0) end if #g2>0 then Duel.RaiseEvent(g2,EVENT_CUSTOM+id,re,r,rp,1-turnp,0) end end function s.filter(c) return c:IsMonster() and c:IsSetCard(SET_KOAKI_MEIRU) and c:IsAbleToHand() end function s.target(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.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:
Send any number of other Spells/Traps you control to the GY; gain 1000 LP for each card sent to the GY this way.
--非常食 --Emergency Provisions local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_RECOVER) 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 function s.costfilter(c) return c:IsSpellTrap() and c:IsAbleToGraveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_ONFIELD,0,1,5,e:GetHandler()) Duel.SendtoGrave(g,REASON_COST) e:SetLabel(#g) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=e:GetLabel() Duel.SetTargetPlayer(tp) Duel.SetTargetParam(ct*1000) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*1000) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ Level 2 Beast monsters You can detach 1 material from this card; your "Melffy" monsters can attack directly this turn. During your opponent's turn (Quick Effect): You can target 1 Beast Xyz Monster you control; return that monster to the Extra Deck, then you can Special Summon Level 2 or lower Beast monsters from your GY, up to the number of materials that monster had. You can only use this effect of "Joyous Melffys" once per turn.
--わくわくメルフィーズ --Joyous Melffys --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Xyz Summon c:EnableReviveLimit() Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_BEAST),2,2,nil,nil,Xyz.InfiniteMats) --Your "Melffy" monsters can attack directly this turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcond) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Return to the Extra Deck and Special Summon from the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,TIMING_END_PHASE) e2:SetCountLimit(1,id) e2:SetCondition(function (_,tp) return Duel.IsTurnPlayer(1-tp) end) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_MELFFY} function s.atkcond(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsAbleToEnterBP() and Duel.GetFlagEffect(tp,id)==0 end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_MELFFY)) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsRace(RACE_BEAST) and c:IsAbleToExtra() end function s.spfilter(c,e,tp) return c:IsRace(RACE_BEAST) and c:IsLevelBelow(2) 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_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,0,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local ft=math.min(tc:GetOverlayCount(),Duel.GetMZoneCount(tp,tc)) if tc and tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT)>0 then local og=Duel.GetOperatedGroup() local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp) if og:GetFirst():IsLocation(LOCATION_EXTRA) and ft>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end Duel.SpecialSummon(g:Select(tp,1,ft,nil),0,tp,tp,false,false,POS_FACEUP) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned: You can target 1 Level 3 or lower "Speedroid" monster in your GY; Special Summon it.
--SRダブルヨーヨー --Speedroid Double Yoyo 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_SPEEDROID} function s.filter(c,e,tp) return c:IsLevelBelow(3) and c:IsSetCard(SET_SPEEDROID) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc: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.operation(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:
Activate only if you control a face-up "Malefic" monster. Select 1 monster your opponent controls, and destroy it.
--Sin Claw Stream --Malefic Claw Stream 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_MALEFIC} function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_MALEFIC) 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.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 face-up monster your opponent controls; the ATK of all other monsters currently on the field become equal to that monster's current ATK, until the end of this turn.
--単一化 --Universal Adapter --Scripted by Eerie Code 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_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c,tp) return c:IsFaceup() and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end function s.filter2(c,atk) return c:IsFaceup() and c:GetAttack()~=atk 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,0,LOCATION_MZONE,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,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 not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end local atk=tc:GetAttack() local g=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc,atk) for sc in aux.Next(g) do local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(atk) e1:SetReset(RESETS_STANDARD_PHASE_END) sc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
(This card is always treated as an "Atlantean" card.) You can discard 1 card to the GY; WATER monsters you currently control become Level 7 until the end of this turn. If this card is sent to the GY to activate a WATER monster's effect: Special Summon 1 Level 4 or lower "Atlantean" or "Mermail" monster from your Deck, except "Mermail Shadow Squad", also you cannot Special Summon from the Extra Deck for the rest of this turn, except WATER monsters. You can only use each effect of "Mermail Shadow Squad" once per turn.
--水精鱗の深影隊 --Mermail Shadow Squad --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Make the Levels of all WATER monsters you currently control become 7 until the end of that turn local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_LVCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(s.lvcost) e1:SetTarget(s.lvtg) e1:SetOperation(s.lvop) c:RegisterEffect(e1) --Special Summon 1 Level 4 or lower "Atlantean" or "Mermail" monster from your Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_ATLANTEAN,SET_MERMAIL} s.listed_names={id} function s.lvcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsDiscardable,Card.IsAbleToGraveAsCost),tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,aux.AND(Card.IsDiscardable,Card.IsAbleToGraveAsCost),1,1,REASON_COST|REASON_DISCARD) end function s.lvfilter(c) return c:HasLevel() and not c:IsLevel(7) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsFaceup() end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.lvfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_LVCHANGE,g,#g,tp,7) end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.lvfilter,tp,LOCATION_MZONE,0,nil) if #g==0 then return end local c=e:GetHandler() for tc in g:Iter() do --Their Levels become 7 until the end of this turn local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(7) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and re and re:IsActivated() and re:IsMonsterEffect() and Duel.GetChainInfo(0,CHAININFO_TRIGGERING_ATTRIBUTE)&ATTRIBUTE_WATER>0 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.spfilter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(s.listed_series) 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) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then 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 local c=e:GetHandler() --Cannot Special Summon from the Extra Deck for the rest of this turn, except WATER 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 c:IsLocation(LOCATION_EXTRA) and not c:IsAttribute(ATTRIBUTE_WATER) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) --Clock Lizard check aux.addTempLizardCheck(c,tp,function(e,c) return not c:IsOriginalAttribute(ATTRIBUTE_WATER) end) 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 7 to the GY (1 Level 8 or higher Tuner and 1 non-Tuner Synchro Monster). Negate the effects of face-up monsters without a Level that were Special Summoned from the Extra Deck. If your opponent Special Summons a monster(s) (except during the Damage Step): You can add 1 "Ursarctic" card from your Deck to your hand. You can only use this effect of "Ursarctic Septentrion" once per turn.
--ベアルクティ-セプテン=トリオン --Ursarctic Septentrion local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Must be special summoned by its own method 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 procedure (from extra deck) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_EXTRA) e2:SetCondition(s.sprcon) e2:SetTarget(s.sprtg) e2:SetOperation(s.sprop) c:RegisterEffect(e2) --disable local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_DISABLE) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e3:SetTarget(s.distg) c:RegisterEffect(e3) --search local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCountLimit(1,id) e4:SetRange(LOCATION_MZONE) e4:SetCondition(s.thcon) e4:SetTarget(s.thtg) e4:SetOperation(s.thop) c:RegisterEffect(e4) 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 lv=c:GetLevel() local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil) return c:IsType(TYPE_TUNER) and c:IsLevelAbove(8) 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()))==7) and c:IsType(TYPE_SYNCHRO) 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,c) local c=e:GetHandler() 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.distg(e,c) return c:IsSummonLocation(LOCATION_EXTRA) and not c:HasLevel() end --to hand function s.thcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) end function s.thfilter(c) return c:IsSetCard(SET_URSARCTIC) 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:
When you Xyz Summon a monster: You can Special Summon this card from your hand. Once per turn: You can detach 1 Xyz Material from a monster you control, then target 1 face-up Xyz Monster on the field; reduce its Rank by 1, and if you do, it loses 300 ATK.
--黄血鬼 --Yellow-Bellied Oni 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_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --rankdown local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_MZONE) e2:SetCost(s.rdcost) e2:SetTarget(s.rdtg) e2:SetOperation(s.rdop) c:RegisterEffect(e2) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=eg:GetFirst() return #eg==1 and c:IsControler(tp) and c:IsXyzSummoned() 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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) 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.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.rdcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) end function s.filter(c) return c:IsFaceup() and c:GetRank()>1 end function s.rdtg(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,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.rdop(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_UPDATE_ATTACK) e1:SetValue(-300) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_RANK) e2:SetValue(-1) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a Spell/Trap Card, or monster effect, is activated, while you control both "Toon World" and a Toon monster(s): Negate the activation, and if you do, destroy that card. You can only activate 1 "Toon Terror" per turn.
--トゥーン・テラー --Toon Terror --Scripted by Hel local s,id=GetID() function s.initial_effect(c) --Negate the activation of a monster effect or spell/trap card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={15259703} function s.cfilter(c) return c:IsFaceup() and c:IsCode(15259703) end function s.cfilter2(c) return c:IsFaceup() and c:IsType(TYPE_TOON) end function s.condition(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) or not Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_MZONE,0,1,nil) or not Duel.IsChainNegatable(ev) then return false end return re:IsMonsterEffect() or re:IsHasType(EFFECT_TYPE_ACTIVATE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.activate(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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While you control this face-up card, when a "Saber" monster is destroyed by battle and sent to the Graveyard, draw 1 card.
--X-セイバー アクセル --X-Saber Axel local s,id=GetID() function s.initial_effect(c) --draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_SABER} function s.filter(c) return c:IsSetCard(SET_SABER) and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil) end function s.target(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,0,0,tp,1) 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.Draw(p,d,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Remove 2 Spell Counters on your side of the field to negate the activation of a Spell Card and destroy it.
--対抗魔術 --Anti-Spell local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.counter_list={COUNTER_SPELL} function s.condition(e,tp,eg,ep,ev,re,r,rp) return re:IsSpellEffect() and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,COUNTER_SPELL,2,REASON_COST) end Duel.RemoveCounter(tp,1,0,COUNTER_SPELL,2,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.activate(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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a "Steelswarm" monster is Tribute Summoned face-up by Tributing this card: You can Special Summon 1 Level 4 or lower "Steelswarm" monster from your Deck.
--インヴェルズを呼ぶ者 --Steelswarm Caller 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_BE_MATERIAL) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_STEELSWARM} function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_GRAVE) and r==REASON_SUMMON and c:GetReasonCard():IsSetCard(SET_STEELSWARM) end function s.filter(c,e,tp) return c:IsSetCard(SET_STEELSWARM) and c:IsLevelBelow(4) 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:
When your opponent's card(s) in their hand are discarded to the Graveyard, inflict 500 points of damage to their Life Points for each card that was discarded.
--魔力の棘 --Magical Thorn 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) --damage local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_TO_GRAVE) e2:SetOperation(s.damop) c:RegisterEffect(e2) end function s.filter(c,tp) return c:IsPreviousLocation(LOCATION_HAND) and c:GetControler()~=tp and not c:IsPreviousControler(tp) and c:IsReason(REASON_DISCARD) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local ct=eg:FilterCount(s.filter,nil,tp) Duel.Damage(1-tp,ct*500,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Destroy all monsters on the field.
--ブラック・ホール --Dark Hole 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_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) if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.Destroy(sg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute this card; add 1 "Uria, Lord of Searing Flames", "Hamon, Lord of Striking Thunder" or "Raviel, Lord of Phantasms" from your Deck or GY to your hand, then you can Special Summon 1 Level 10 Pyro, Thunder, or Fiend monster from your hand whose ATK equals its own DEF, ignoring its Summoning conditions, but it cannot attack directly this turn. You can banish this card from your GY; add 1 "Dimension Fusion Destruction" from your Deck to your hand. You can only use each effect of "Phantasmal Summoning Beast" once per turn.
--幻魔の召喚神 --Phantasmal Summoning Beast --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Search 1 "Uria, Lord of Searing Flames", "Hamon, Lord of Striking Thunder", or "Raviel, Lord of Phantasms" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfTribute) e1:SetTarget(s.mzthtg) e1:SetOperation(s.mzthop) c:RegisterEffect(e1) --Search 1 "Dimension Fusion Destruction" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.gythtg) e2:SetOperation(s.gythop) c:RegisterEffect(e2) end s.listed_names={6007213,32491822,69890967,89190953} function s.mzthfilter(c) return c:IsCode(6007213,32491822,69890967) and c:IsAbleToHand() end function s.mzthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.mzthfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spfilter(c,e,tp) return c:IsLevel(10) and c:IsRace(RACE_PYRO|RACE_THUNDER|RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsDefense(c:GetAttack()) and c:IsAttackAbove(0) and c:IsDefenseAbove(0) end function s.mzthop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.mzthfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) if #g==0 or Duel.SendtoHand(g,nil,REASON_EFFECT)==0 then return end Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() if not sc then return end Duel.BreakEffect() if Duel.SpecialSummonStep(sc,0,tp,tp,true,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) sc:RegisterEffect(e1) end Duel.SpecialSummonComplete() end end function s.gythfilter(c) return c:IsCode(89190953) and c:IsAbleToHand() end function s.gythtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.gythfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.gythop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.gythfilter,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:
You can banish both 1 face-up Spellcaster-Type monster you control, except this card, and 1 "Spellbook" card from your Graveyard to target 1 face-up monster your opponent controls; take control of that target until the End Phase. You can only use the effect of "Emperor of Prophecy" once per turn. This card cannot attack during the turn you activate this effect.
--魔導皇士 アンプール --Emperor of Prophecy local s,id=GetID() function s.initial_effect(c) --Take control 1 of opponent's monsters until end phase local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_CONTROL) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_SPELLBOOK} function s.cfilter1(c) return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToRemoveAsCost() end function s.cfilter2(c) return c:IsSetCard(SET_SPELLBOOK) and c:IsAbleToRemoveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 and Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_MZONE,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g1=Duel.SelectMatchingCard(tp,s.cfilter1,tp,LOCATION_MZONE,0,1,1,e:GetHandler()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g2=Duel.SelectMatchingCard(tp,s.cfilter2,tp,LOCATION_GRAVE,0,1,1,nil) g1:Merge(g2) Duel.Remove(g1,POS_FACEUP,REASON_COST) --Cannot attack this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetReset(RESETS_STANDARD_PHASE_END) e:GetHandler():RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsControlerCanBeChanged() 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 s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,s.filter,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:IsFaceup() and 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 Set 1 "Altergeist" Trap directly from your Deck. You can target 1 "Altergeist" card you control and 1 "Altergeist" 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. You can only use this effect of "Altergeist Marionetter" once per turn.
--オルターガイスト・マリオネッター --Altergeist Marionetter local s,id=GetID() function s.initial_effect(c) --Set 1 "Altergeist" Trap from the 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:SetTarget(s.settg) e1:SetOperation(s.setop) c:RegisterEffect(e1) --Send 1 face-up "Altergeist" card to the GY and Special Summon 1 "Altergeist" monster from the GY 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_MZONE) e2:SetCountLimit(1,id) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_ALTERGEIST} function s.setfilter(c) return c:IsSetCard(SET_ALTERGEIST) and c:IsTrap() and c:IsSSetable() 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) end end function s.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SSet(tp,g) end end function s.tgfilter(c,tp) return c:IsFaceup() and c:IsSetCard(SET_ALTERGEIST) and c:IsAbleToGrave() and Duel.GetMZoneCount(tp,c)>0 end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ALTERGEIST) 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 local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_ONFIELD,0,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,LOCATION_ONFIELD,0,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,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0) e:SetLabelObject(g1:GetFirst()) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc1,tc2=Duel.GetFirstTarget() if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end if tc1:IsRelateToEffect(e) and Duel.SendtoGrave(tc1,REASON_EFFECT)>0 and tc1:IsLocation(LOCATION_GRAVE) and tc2:IsRelateToEffect(e) and aux.nvfilter(tc2) then Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn: You can target 1 "Iron Chain" monster you control; it gains 300 ATK/DEF. * The above text is unofficial and describes the card's functionality in the OCG.
--C・コイル --Iron Chain Coil 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:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) end s.listed_series={SET_IRON_CHAIN} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_IRON_CHAIN) 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 s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(300) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Special Summoned: You can roll a six-sided die, and if you roll a 1 or 6, destroy up to 2 cards on the field. If this card is sent to the GY: You can roll a six-sided die, and if you roll a 2, 3, 4, or 5, Special Summon this card, also you cannot Special Summon from the Extra Deck while this card remains face-up in the Monster Zone. * The above text is unofficial and describes the card's functionality in the OCG.
--サイコ・ローヴァー --Psychic Rover --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Roll a die and destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DICE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Roll a die and Special Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.roll_dice=true function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1) Duel.SetPossibleOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local dc=Duel.TossDice(tp,1) if dc==1 or dc==6 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,2,nil) if #g>0 then Duel.HintSelection(g,true) Duel.Destroy(g,REASON_EFFECT) end 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_DICE,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local dc=Duel.TossDice(tp,1) if (dc==2 or dc==3 or dc==4 or dc==5) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then --Cannot Special Summon from the Extra Deck local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetRange(LOCATION_MZONE) e1:SetAbsoluteRange(tp,1,0) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) end) c:RegisterEffect(e1) end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
At the end of the Damage Step, if this card attacked and is still on the field: Target 1 Spell/Trap your opponent controls; destroy that target.
--アマゾネスの賢者 --Amazoness Sage local s,id=GetID() function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_DAMAGE_STEP_END) 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()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle() end function s.filter(c) return c:IsSpellTrap() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.filter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,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 and 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 a card(s) you control would be destroyed by battle or an opponent's card effect, you can destroy this card instead of 1 of those cards. If a card(s) your opponent controls would be destroyed by battle or card effect, you can banish this card from your GY instead of 1 of those cards. You can only use each effect of "Blockout Curtain" once per turn.
--遮攻カーテン --Blockout Curtain --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) --destroy replace yours local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetRange(LOCATION_SZONE) e2:SetTarget(s.reptg) e2:SetValue(s.repval) e2:SetOperation(s.repop) c:RegisterEffect(e2) --destroy replace opps local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EFFECT_DESTROY_REPLACE) e3:SetRange(LOCATION_GRAVE) e3:SetTarget(s.reptg2) e3:SetValue(s.repval2) e3:SetOperation(s.repop2) c:RegisterEffect(e3) end function s.repfilter(c,tp) return c:IsControler(tp) and not c:IsReason(REASON_REPLACE) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)) end function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED) and eg:IsExists(s.repfilter,1,nil,tp) end if Duel.SelectEffectYesNo(tp,c,aux.Stringid(id,0)) then local g=eg:Filter(s.repfilter,nil,tp) if #g==1 then e:SetLabelObject(g:GetFirst()) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local cg=g:Select(tp,1,1,nil) e:SetLabelObject(cg:GetFirst()) end c:SetStatus(STATUS_DESTROY_CONFIRMED,true) Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) return true else return false end end function s.repval(e,c) return c==e:GetLabelObject() end function s.repop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() c:SetStatus(STATUS_DESTROY_CONFIRMED,false) Duel.Destroy(c,REASON_EFFECT|REASON_REPLACE) end function s.repfilter2(c,tp) return c:IsControler(1-tp) and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_BATTLE|REASON_EFFECT) end function s.reptg2(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetFlagEffect(tp,id+1)==0 and c:IsAbleToRemove() and eg:IsExists(s.repfilter2,1,nil,tp) end if Duel.SelectEffectYesNo(tp,c,aux.Stringid(id,1)) then local g=eg:Filter(s.repfilter2,nil,tp) if #g==1 then e:SetLabelObject(g:GetFirst()) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local cg=g:Select(tp,1,1,nil) e:SetLabelObject(cg:GetFirst()) end Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE|PHASE_END,0,1) return true else return false end end function s.repval2(e,c) return c==e:GetLabelObject() end function s.repop2(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT|REASON_REPLACE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 face-up monster your opponent controls; equip that face-up monster to 1 "Mikanko" monster you control as an Equip Spell, then if a Ritual Monster Card is on the field, you can inflict 500 damage to your opponent for each Equip Spell you control. You can banish this card from your GY; Special Summon 1 of your "Mikanko" monsters that is banished or in your hand. You can only use each effect of "Mikanko Spiritwalk" once per turn.
--御巫かみかくし --Mikanko Spiritwalk --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Equip 1 monster the opponent controls to a "Mikanko" monster you control local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_EQUIP+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) --Special Summon 1 "Mikanko" monster from the hand or that is banished local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_MIKANKO} function s.eqfilter(c) return c:IsFaceup() and not c:IsForbidden() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.eqfilter(chkc) end local ft=e:GetHandler():IsLocation(LOCATION_HAND) and 1 or 0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>ft and Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_MIKANKO),tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) end function s.ritmonfilter(c) return c:IsFaceup() and c:IsOriginalType(TYPE_MONSTER) and c:IsOriginalType(TYPE_RITUAL) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not (tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local eqc=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsSetCard,SET_MIKANKO),tp,LOCATION_MZONE,0,1,1,nil):GetFirst() if not eqc then return end Duel.HintSelection(eqc,true) if Duel.Equip(tp,tc,eqc) then --Equip limit local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetValue(function(e,c) return c==eqc end) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsEquipSpell),tp,LOCATION_ONFIELD,0,nil) if Duel.IsExistingMatchingCard(s.ritmonfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and ct>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() Duel.Damage(1-tp,ct*500,REASON_EFFECT) end end end function s.spfilter(c,e,tp) return c:IsSetCard(SET_MIKANKO) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) 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_REMOVED|LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED|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_REMOVED|LOCATION_HAND,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:
If this card is Tributed by a card effect: You can add 1 Dragon-Type "Nekroz" Ritual Monster from your Deck to your hand. If this card is banished: You can target 1 of your banished "Nekroz" monsters, except this card; Special Summon that monster. You can only use 1 "Exa, Enforcer of the Nekroz" effect per turn, and only once that turn.
--影霊衣の戦士 エグザ --Exa, Enforcer of the Nekroz local s,id=GetID() function s.initial_effect(c) --tohand 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_RELEASE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetCondition(s.thcon) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) 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_REMOVE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,id) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_NEKROZ} function s.thcon(e,tp,eg,ep,ev,re,r,rp) return (r&REASON_EFFECT)~=0 end function s.thfilter(c) return c:IsSetCard(SET_NEKROZ) and c:IsType(TYPE_RITUAL) and c:IsRace(RACE_DRAGON) 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.spfilter(c,e,tp) return c:IsFaceup() and c:IsSetCard(SET_NEKROZ) 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_REMOVED) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) and chkc~=e:GetHandler() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_REMOVED,0,1,e:GetHandler(),e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,e:GetHandler(),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:
Cannot be Normal Summoned/Set. Must first be Special Summoned (from your hand) by Tributing 2 monsters, while you control "Toon World". Cannot attack the turn it is Special Summoned. You must pay 500 LP to declare an attack with this monster. If "Toon World" on the field is destroyed, destroy this card. Can attack your opponent directly, unless they control a Toon monster, in which case this card must target a Toon monster for its attacks.
--ブルーアイズ・トゥーン・ドラゴン --Blue-Eyes Toon Dragon local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Destroy itself local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCondition(s.sdescon) e2:SetOperation(s.sdesop) c:RegisterEffect(e2) --Direct attack local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_DIRECT_ATTACK) e3:SetCondition(s.dircon) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e4:SetCondition(s.atcon) e4:SetValue(s.atlimit) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e5:SetCondition(s.atcon) c:RegisterEffect(e5) --Cannot attack local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e6:SetCode(EVENT_SPSUMMON_SUCCESS) e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e6:SetOperation(s.atklimit) c:RegisterEffect(e6) --Attack cost local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_SINGLE) e7:SetCode(EFFECT_ATTACK_COST) e7:SetCost(s.atcost) e7:SetOperation(s.atop) c:RegisterEffect(e7) end s.listed_names={15259703} function s.spcon(e,c) if c==nil then return true end return Duel.CheckReleaseGroup(c:GetControler(),aux.TRUE,2,false,2,true,c,c:GetControler(),nil,false,nil) and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,15259703),c:GetControler(),LOCATION_ONFIELD,0,1,nil) 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,aux.TRUE,2,2,false,true,true,c,nil,nil,false,nil) 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.sfilter(c) return c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousCodeOnField()==15259703 and c:IsPreviousLocation(LOCATION_ONFIELD) end function s.sdescon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.sfilter,1,nil) end function s.sdesop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetHandler(),REASON_EFFECT) end function s.atkfilter(c) return c:IsFaceup() and c:IsType(TYPE_TOON) end function s.dircon(e) return not Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end function s.atcon(e) return Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end function s.atlimit(e,c) return not c:IsType(TYPE_TOON) or c:IsFacedown() end function s.atklimit(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e:GetHandler():RegisterEffect(e1) end function s.atcost(e,c,tp) return Duel.CheckLPCost(tp,500) end function s.atop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsAttackCostPaid()~=2 and e:GetHandler():IsLocation(LOCATION_MZONE) then Duel.PayLPCost(tp,500) Duel.AttackCostPaid() end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can banish 2 Dragon and/or Winged Beast monsters from your GY; Special Summon this card from your hand or GY. You can target 1 face-up monster; its effects are negated, also it loses 1000 ATK for each Equip Card you control. When your opponent's monster is destroyed by battle and sent to the GY: You can equip it to this card. You can only use each effect of "Dragunity Arma Gram" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--ドラグニティアームズ-グラム --Dragunity Arma Gram --Scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special summon procedure (from hand or GY) 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|LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Negate targeted monster's effects, also loses ATK local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) --Equip an opponent's monster destroyed by battle to this card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_EQUIP) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_BATTLE_DESTROYED) e3:SetCountLimit(1,{id,2}) e3:SetCondition(s.eqpcon) e3:SetTarget(s.eqptg) e3:SetOperation(s.eqpop) c:RegisterEffect(e3) aux.AddEREquipLimit(c,nil,aux.FilterBoolFunction(Card.IsMonster),Card.EquipByEffectAndLimitRegister,e3) end function s.spfilter(c) return c:IsRace(RACE_WINGEDBEAST|RACE_DRAGON) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,e:GetHandler()) 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.sptg(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,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.distg(c,eqpc) return c:IsNegatableMonster() or (eqpc and c:IsFaceup() and c:GetAttack()>0) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local eqpc=Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsType,TYPE_EQUIP),tp,LOCATION_ONFIELD,0,1,nil) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.distg(chkc,eqpc) end if chk==0 then return Duel.IsExistingTarget(s.distg,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,eqpc) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) local g=Duel.SelectTarget(tp,s.distg,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,eqpc) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) end function s.negop(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end if tc:IsCanBeDisabledByEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end local ct=Duel.GetMatchingGroupCount(aux.FaceupFilter(Card.IsType,TYPE_EQUIP),tp,LOCATION_SZONE,0,nil) if ct>0 then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetValue(-ct*1000) e3:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e3) end end function s.eqpfilter(c,tp) return c:IsMonster() and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:IsPreviousControler(1-tp) and s.exfilter(c,tp) end function s.exfilter(c,tp) return not c:IsForbidden() and c:CheckUniqueOnField(tp) end function s.eqpcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.eqpfilter,1,nil,tp) end function s.eqptg(e,tp,eg,ep,ev,re,r,rp,chk) local eqg=eg:Filter(s.eqpfilter,nil,tp) if chk==0 then return #eqg>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=#eqg end Duel.SetTargetCard(eqg) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,eqg,1,0,0) end function s.eqpop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) if ft<1 then return end local c=e:GetHandler() local tg=Duel.GetTargetCards(e):Filter(s.exfilter,nil,tp) if c:IsFaceup() and c:IsRelateToEffect(e) and #tg>0 and ft>0 then local eqg=nil if #tg>ft then eqg=tg:Select(tp,ft,ft,nil) else eqg=tg end for tc in eqg:Iter() do if Duel.Equip(tp,tc,c,true,true) then --Equip limit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(s.eqlimit) tc:RegisterEffect(e1) end end Duel.EquipComplete() end end function s.eqlimit(e,c) return e:GetOwner()==c end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Face-up "Watt" monsters you control can attack your opponent directly this turn.
--エレキー --Wattkey 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) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_WATT} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_WATT) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil) local tc=g:GetFirst() for tc in aux.Next(g) do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you have a "Gate Guardian" monster in your GY: Pay half your LP; Special Summon 1 Level 11 or higher "Gate Guardian" monster from your hand, Deck, or Extra Deck, ignoring its Summoning conditions. You can banish this card from your GY; add 1 of your "Sanga of the Thunder", "Kazejin", or "Suijin" from your Deck or banishment to your hand. You can only use each effect of "Dark Element" once per turn.
--ダーク・エレメント --Dark Element --scripted by pyrQ local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Add 1 "Sanga of the Thunder", "Kazejin", or "Suijin" to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_GATE_GUARDIAN} s.listed_names=CARDS_SANGA_KAZEJIN_SUIJIN function s.cfilter(c) return c:IsSetCard(SET_GATE_GUARDIAN) and c:IsMonster() end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2)) end function s.spfilter(c,e,tp,ft) if not (c:IsSetCard(SET_GATE_GUARDIAN) and c:IsMonster() and c:IsLevelAbove(11) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)) then return false end if c:IsLocation(LOCATION_HAND|LOCATION_DECK) then return ft>0 else return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_EXTRA,0,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_EXTRA,0,1,1,nil,e,tp,Duel.GetLocationCount(tp,LOCATION_MZONE)):GetFirst() if not sc then return end local code_chk=sc:IsCode(26746975) and e:GetHandler():IsCode(id) if Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP)>0 and code_chk then sc:CompleteProcedure() end end function s.thfilter(c) return c:IsCode(CARDS_SANGA_KAZEJIN_SUIJIN) and c:IsAbleToHand() and (c:IsLocation(LOCATION_DECK) or c:IsFaceup()) 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_REMOVED,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_REMOVED) 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|LOCATION_REMOVED,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:
You can Tribute Summon this card in face-up Attack Position by Tributing 1 "Fabled" monster. Once per turn, the first opponent's Normal Spell Card effect to resolve becomes "Your opponent discards 1 card".
--魔轟神ディアネイラ --Fabled Dianaira local s,id=GetID() function s.initial_effect(c) --Can be Tribute Summoned by Tributing 1 "Fabled" monster local e1=aux.AddNormalSummonProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.otfilter) --The effect of a Normal Spell activated by the opponent becomes "Your opponent discards 1 card" local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_CHAIN_SOLVING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.changecon) e1:SetOperation(s.changeop) c:RegisterEffect(e1) end s.listed_series={SET_FABLED} function s.otfilter(c,tp) return c:IsSetCard(SET_FABLED) and (c:IsControler(tp) or c:IsFaceup()) end function s.changecon(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp and re:GetHandler():IsNormalSpell() and re:IsHasType(EFFECT_TYPE_ACTIVATE) end function s.changeop(e,tp,eg,ep,ev,re,r,rp) local g=Group.CreateGroup() Duel.ChangeTargetCard(ev,g) Duel.ChangeChainOperation(ev,s.rep_op) end function s.rep_op(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,1-tp,id) Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT|REASON_DISCARD) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Discard 1 card; add 2 "Magician" Pendulum Monsters with different names from your Deck to your hand, also, until the end of your opponent's next turn after this card resolves, "Magician" cards in your Pendulum Zones cannot be destroyed by card effects. You can only activate 1 "Pendulum Call" per turn. You cannot activate this card if you activated a "Magician" monster's Pendulum Effect this turn.
--ペンデュラム・コール --Pendulum Call local s,id=GetID() function s.initial_effect(c) --Add 2 "Magician" monsters with different names from your Deck to your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) end s.listed_series={SET_MAGICIAN} function s.chainfilter(re,tp,cid) local rc=re:GetHandler() local loc=Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_LOCATION) return not (re:GetActiveType()==(TYPE_PENDULUM|TYPE_SPELL) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) and (loc&LOCATION_PZONE)==LOCATION_PZONE and rc:IsSetCard(SET_MAGICIAN)) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD) end function s.thfilter(c) return c:IsSetCard(SET_MAGICIAN) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) return g:GetClassCount(Card.GetCode)>=2 end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if #g>=2 then local thg=aux.SelectUnselectGroup(g,e,tp,2,2,aux.dncheck,1,tp,HINTMSG_ATOHAND) if #thg>0 then Duel.SendtoHand(thg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,thg) end end if e:IsHasType(EFFECT_TYPE_ACTIVATE) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e1:SetTargetRange(LOCATION_PZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_MAGICIAN)) e1:SetValue(1) e1:SetReset(RESET_PHASE|PHASE_END|RESET_OPPO_TURN) Duel.RegisterEffect(e1,tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, while you control this Tribute Summoned card: You can conduct up to 3 Normal Summons/Sets this turn, not just 1. While this Tribute Summoned card is in the Monster Zone, if your monster attacks a Defense Position monster, inflict piercing battle damage to your opponent. Once per opponent's turn (Quick Effect): You can banish 1 card from your hand; change all Special Summoned monsters your opponent controls to face-down Defense Position.
--ふわんだりぃず×すのーる --Floowandereeze & Snowl --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Can conduct 3 normal summons local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(s.trcon) e1:SetTarget(s.nstg) e1:SetOperation(s.nsop) c:RegisterEffect(e1) --Piercing damage local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_PIERCE) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetCondition(s.trcon) c:RegisterEffect(e2) --Flip opponent monsters face-down local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_POSITION) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.fdcon) e3:SetCost(s.fdcost) e3:SetTarget(s.fdtg) e3:SetOperation(s.fdop) e3:SetHintTiming(0,TIMING_END_PHASE) c:RegisterEffect(e3) end function s.trcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsTributeSummoned() end function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local ct=0 local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_SET_SUMMON_COUNT_LIMIT)} for _,te in ipairs(ce) do ct=math.max(ct,te:GetValue()) end return ct<3 end end function s.nsop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetValue(3) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.fdcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.fdcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.fdfilter(c) return c:IsCanTurnSet() and c:IsSpecialSummoned() end function s.fdtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.fdfilter,tp,0,LOCATION_MZONE,nil) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_POSITION,g,#g,0,0) end function s.fdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.fdfilter,tp,0,LOCATION_MZONE,nil) if #g>0 then Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While you control a monster, you take no battle damage.
--スピリットバリア --Spirit Barrier 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) --avoid battle damage local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e2:SetRange(LOCATION_SZONE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(1,0) e2:SetCondition(s.condition) c:RegisterEffect(e2) end function s.condition(e) return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)>0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 face-up monster your opponent controls and 1 Warrior monster you control; equip that opponent's face-up monster to your monster as an Equip Spell, and if you do, until the end of this turn, your opponent takes no damage from battles involving that monster you control. You can only activate 1 "Cross Over" per turn. While equipped, if the equipped monster would be destroyed by battle or card effect, destroy the monster equipped to it by this effect, instead.
--クロス・オーバー --Cross Over --Scripted by Eerie Code 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: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,chkc) local f1=aux.FaceupFilter(Card.IsRace,RACE_WARRIOR) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(f1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and (ft>1 or (ft>0 and e:GetHandler():IsLocation(LOCATION_SZONE))) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,f1,tp,LOCATION_MZONE,0,1,1,nil) e:SetLabelObject(g:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetTargetCards(e) if not g or #g<2 then return end local tc=g:GetFirst() local oc=g:GetNext() if oc==e:GetLabelObject() then tc,oc=oc,tc end if tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and tc:IsAbleToChangeControler() and Duel.Equip(tp,oc,tc,false) then --no battle damage local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_NO_BATTLE_DAMAGE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) --substitute local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_DESTROY_SUBSTITUTE) e2:SetReset(RESET_EVENT|RESETS_STANDARD) e2:SetValue(s.repval) oc:RegisterEffect(e2) --Equip limit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_EQUIP_LIMIT) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetValue(s.eqlimit) e3:SetReset(RESET_EVENT|RESETS_STANDARD) e3:SetLabelObject(tc) oc:RegisterEffect(e3) end end function s.eqlimit(e,c) return c==e:GetLabelObject() end function s.repval(e,re,r,rp) return (r&REASON_BATTLE+REASON_EFFECT)~=0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
3 Level 4 monsters When this card is Special Summoned: You can target 1 monster your opponent controls; this card gains ATK equal to that monster's current ATK. If your opponent controls more cards than you do: You can detach 1 material from this card, then choose 1 unused Main Monster Zone or Spell & Trap Zone; this card gains this effect. ● That unused zone cannot be used. * The above text is unofficial and describes the card's functionality in the OCG.
--No.57 奮迅竜トレスラグーン --Number 57: Tri-Head Dust Dragon local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,nil,4,3) c:EnableReviveLimit() --atkup local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --disable zone local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.zcon) e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.ztg) e2:SetOperation(s.zop) c:RegisterEffect(e2) end s.xyz_number=57 function s.atktg(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() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(tc:GetAttack()) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end function s.zcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0) end function s.ztg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)+Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0) +Duel.GetLocationCount(tp,LOCATION_SZONE,PLAYER_NONE,0)+Duel.GetLocationCount(1-tp,LOCATION_SZONE,PLAYER_NONE,0)>0 end local dis=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,0) Duel.Hint(HINT_ZONE,tp,dis) e:SetLabel(dis) end function s.zop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_DISABLE_FIELD) e1:SetOperation(s.disop) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) e1:SetLabel(e:GetLabel()) e:GetHandler():RegisterEffect(e1) end function s.disop(e,tp) return e:GetLabel() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you have no cards in your hand and this card is in your GY: You can banish 1 DARK monster from your GY, then target 1 DARK monster you control; it can attack directly this turn. You can only use this effect of "Infernity Queen" once per turn.
--インフェルニティ・クイーン --Infernity Queen --Scripted by The Razgriz local s,id=GetID() function s.initial_effect(c) --Make 1 DARK monster you control able to attack directly local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 and Duel.IsAbleToEnterBP() end) e1:SetCost(s.diratkcost) e1:SetTarget(s.diratktg) e1:SetOperation(s.diratkop) c:RegisterEffect(e1) end function s.diratkcostfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.diratkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.diratkcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.diratkcostfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.diratktgfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsFaceup() and not c:IsHasEffect(EFFECT_DIRECT_ATTACK) end function s.diratktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.diratktgfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.diratktgfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_APPLYTO) Duel.SelectTarget(tp,s.diratktgfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.diratkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then --It can attack directly this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3205) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, during your Main Phase, if this card was Normal or Special Summoned this turn: You can Special Summon 1 Level 4 or lower "Raidraptor" monster from your hand.
--RR-バニシング・レイニアス --Raidraptor - Vanishing Lanius local s,id=GetID() function s.initial_effect(c) --Special Summon 1 Level 4 or lower "Raidraptor" monster 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_MZONE) e1:SetCountLimit(1) e1:SetCondition(function(e) return e:GetHandler():IsStatus(STATUS_SUMMON_TURN|STATUS_SPSUMMON_TURN) end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end s.listed_series={SET_RAIDRAPTOR} function s.spfilter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(SET_RAIDRAPTOR) 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,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) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is treated as a Normal Monster while face-up on the field or in the GY. While this card is a Normal Monster on the field, you can Normal Summon it to have it become an Effect Monster with this effect. ● Once per turn: You can Special Summon 1 Insect or Plant monster from your hand or GY.
--ギガプラント --Gigaplant local s,id=GetID() function s.initial_effect(c) Gemini.AddProcedure(c) --Special Summon 1 Insect or Plant monster 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) e1:SetCondition(Gemini.EffectStatusCondition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsRace(RACE_INSECT|RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE|LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE|LOCATION_HAND) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE|LOCATION_HAND,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:
1 "Odd-Eyes" monster + 1 Pendulum Monster When this card is Special Summoned: You can target 1 face-up Attack Position monster your opponent controls; return it to the hand. When a Spell/Trap Card, or another monster's effect, is activated (Quick Effect): You can shuffle 1 face-up Pendulum Monster from your Extra Deck into the Deck, and if you do, negate the activation, and if you do that, destroy that card. You can only use each effect of "Odd-Eyes Vortex Dragon" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--オッドアイズ・ボルテックス・ドラゴン --Odd-Eyes Vortex Dragon local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_ODD_EYES),aux.FilterBoolFunctionEx(Card.IsType,TYPE_PENDULUM)) --Add to hand local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Negate the activation local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.discon) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) aux.DoubleSnareValidity(c,LOCATION_MZONE) end s.listed_series={SET_ODD_EYES} s.material_setcode=SET_ODD_EYES function s.filter(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,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) end end function s.discon(e,tp,eg,ep,ev,re,r,rp) return re:GetHandler()~=e:GetHandler() and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and (re:IsMonsterEffect() or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev) end function s.disfilter(c) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToDeck() end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.disfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_EXTRA,0,1,1,nil) if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can apply any of the following effects, in sequence, based on the number of "Solfachord" Pendulum Monster Cards you control with different names. ● 3+: Return 1 card from your Pendulum Zone to the hand, and if you do, place 1 face-up "Solfachord" Pendulum Monster from your Extra Deck in your Pendulum Zone. ● 5+: Special Summon 1 "Solfachord" Pendulum Monster from your hand. ● 7+: Destroy all face-up cards your opponent controls. You can only activate 1 "Solfachord Scale" per turn.
--ドレミコード・スケール --Solfachord Scale --Scripted by the Razgriz local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_SOLFACHORD} function s.filter(c) return c:IsFaceup() and c:IsOriginalType(TYPE_PENDULUM) and c:IsOriginalType(TYPE_MONSTER) and c:IsSetCard(SET_SOLFACHORD) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_ONFIELD,0,nil)>2 end function s.spfilter(c,e,tp) return c:IsType(TYPE_PENDULUM) and c:IsSetCard(SET_SOLFACHORD) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,0,nil) local ct=g:GetClassCount(Card.GetCode) local b1=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil) and ct>=3 local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and ct>=5 local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) and ct>=7 if chk==0 then return (b1 or b2 or b3) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,0,nil) local ct=g:GetClassCount(Card.GetCode) local b1=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil) and ct>=3 local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and ct>=5 local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) and ct>=7 local flag=0 if b1 and ((not b2 and not b3) or Duel.SelectYesNo(tp,aux.Stringid(id,0))) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local thg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,1,nil) if Duel.SendtoHand(thg,tp,REASON_EFFECT)>0 and Duel.GetOperatedGroup():GetFirst():IsLocation(LOCATION_HAND) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local tpg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil) if #tpg>0 then Duel.MoveToField(tpg:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end flag=1 g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,0,nil) ct=g:GetClassCount(Card.GetCode) b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and ct>=5 b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) and ct>=7 end if b2 and ((flag==0 and not b3) or Duel.SelectYesNo(tp,aux.Stringid(id,1))) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if #sg>0 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end flag=1 g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,0,nil) ct=g:GetClassCount(Card.GetCode) b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) and ct>=7 end if b3 and (flag==0 or Duel.SelectYesNo(tp,aux.Stringid(id,2))) then Duel.BreakEffect() local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil) Duel.Destroy(g,REASON_EFFECT) flag=1 end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a Link Monster's effect is activated that targets this face-up card on the field (Quick Effect): You can destroy this card, then make 1 face-up monster on the field unable to attack, also it has its effects negated. During the End Phase, if this card is in the GY because it was destroyed on the field by battle or card effect and sent there this turn: You can Special Summon 1 "Rokket" monster from your Deck, except "Anesthrokket Dragon". You can only use each effect of "Anesthrokket Dragon" once per turn.
--アネスヴァレット・ドラゴン --Anesthrokket Dragon local s,id=GetID() function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.descon) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --to grave local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_TO_GRAVE) e2:SetOperation(s.regop) c:RegisterEffect(e2) end s.listed_series={SET_ROKKET} s.listed_names={id} function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) if not g or not g:IsContains(c) then return false end return re:IsActiveType(TYPE_LINK) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDestructable() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #g==0 then return end Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local sg=g:Select(tp,1,1,nil) Duel.HintSelection(sg) local tc=sg:GetFirst() Duel.NegateRelatedChain(tc,RESET_TURN_SET) 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=e1:Clone() e2:SetCode(EFFECT_DISABLE_EFFECT) tc:RegisterEffect(e2) if tc:IsType(TYPE_TRAPMONSTER) then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e3) end local e4=e1:Clone() e4:SetCode(EFFECT_CANNOT_ATTACK) tc:RegisterEffect(e4) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD) then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1,{id,1}) e1:SetRange(LOCATION_GRAVE) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ROKKET) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.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:
[ Pendulum Effect ] If a monster(s) is Pendulum Summoned: Return this card to the hand. ---------------------------------------- [ Monster Effect ] When this card is Normal Summoned: You can return all cards you control in the same column as the cards in your Pendulum Zones to the hand (including the Pendulum Zone cards themselves), then you can add 1 monster with 2400 ATK/1000 DEF from your Deck to your hand, except "Han-Shi Kyudo Spirit". Once per turn, during the End Phase, if this card was Normal Summoned or flipped face-up this turn: Return this card to the hand.
--キュウドウ魂 HAN-SHI --Han-Shi Kyudo Spirit --scripted by Naim local s,id=GetID() function s.initial_effect(c) Pendulum.AddProcedure(c) Spirit.AddProcedure(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP) --Return this card from the Pendulum Zone local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_PZONE) e1:SetCondition(s.selfthcon) e1:SetTarget(s.selfthtg) e1:SetOperation(s.selfthop) c:RegisterEffect(e1) --Return cards in the pendulum zones and add 1 monster to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_names={id} function s.selfthcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_PENDULUM) end function s.selfthtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,0) end function s.selfthop(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 function s.pendfilter(c,tp) return c:IsControler(tp) and c:IsLocation(LOCATION_PZONE) end function s.pzfilter(c,tp) return c:IsAbleToHand() and (c:IsLocation(LOCATION_PZONE) or c:GetColumnGroup():IsExists(s.pendfilter,1,nil,tp)) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.pzfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end local g=Duel.GetMatchingGroup(s.pzfilter,tp,LOCATION_ONFIELD,0,nil,tp) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,tp,0) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thfilter(c) return c:IsAttack(2400) and c:IsDefense(1000) and c:IsAbleToHand() and not c:IsCode(id) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.pzfilter,tp,LOCATION_ONFIELD,0,nil,tp) if #g==0 or Duel.SendtoHand(g,nil,REASON_EFFECT)==0 or not Duel.GetOperatedGroup():IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then return end local hg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if #hg==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=hg:Select(tp,1,1,nil) if #sg>0 then Duel.BreakEffect() Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card destroys a monster by battle and sends it to the Graveyard, inflict 300 damage to your opponent. Once per turn, you can Special Summon 1 Level 4 or lower "Iron Chain" monster from your Graveyard, except "Iron Chain Repairman". This card cannot attack the turn you activate this effect.
--C・リペアラー --Iron Chain Repairman local s,id=GetID() function s.initial_effect(c) --When this card destroys a monster by battle, inflict 300 damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCondition(s.damcon) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) c:RegisterEffect(e1) --Special summon 1 level 4 or lower "Iron Chain" monster from GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_IRON_CHAIN} s.listed_names={id} function s.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsRelateToBattle() and c:IsFaceup() and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE) and bc:IsMonster() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(300) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,300) 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.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end --Cannot attack local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3206) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESETS_STANDARD_PHASE_END) e:GetHandler():RegisterEffect(e1) end function s.spfilter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(SET_IRON_CHAIN) and c:GetCode()~=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.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 c=e:GetHandler() 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:
Apply the following effect, then you can attach this card to a Rank 4 Xyz Monster you control. ● For the rest of this turn, all "Ryzeal" monsters you control gain 1000 ATK. If this card is sent to the GY, except from the field: You can target 1 card in your opponent's GY; banish it. You can only use each effect of "Ryzeal Mass Driver" once per turn.
--ライゼオル・マスドライバー --Ryzeal Mass Driver --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Apply the following effect then you can attach this card to a Rank 4 Xyz Monster you control as material local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP|TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetCondition(function() return not (Duel.IsPhase(PHASE_DAMAGE) and Duel.IsDamageCalculated()) end) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Banish 1 card from your opponent's GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e) return not e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end) e2:SetTarget(s.rmvtg) e2:SetOperation(s.rmvop) c:RegisterEffect(e2) end s.listed_series={SET_RYZEAL} function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_RYZEAL),tp,LOCATION_MZONE,0,nil) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,1000) end function s.xyzfilter(c,mc,tp) return c:IsType(TYPE_XYZ) and c:IsRank(4) and c:IsFaceup() and mc:IsCanBeXyzMaterial(c,tp,REASON_EFFECT) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() --"Ryzeal" monsters you control will gain 1000 ATK for the rest of this turn local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(function(e,c) return c:IsSetCard(SET_RYZEAL) end) e1:SetValue(1000) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) aux.RegisterClientHint(c,0,tp,1,0,aux.Stringid(id,2)) if c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil,c,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then c:CancelToGrave() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local tc=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,c,tp):GetFirst() if tc then Duel.HintSelection(tc) Duel.BreakEffect() if tc:IsImmuneToEffect(e) then return end Duel.Overlay(tc,c) end end end function s.rmvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0) end function s.rmvop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Special Summon 1 "Sunseed" monster from your Deck, and if you do, take 1000 damage. If you control no "Sunavalon" Link Monsters, you can only Special Summon "Sunseed Genius Loci" with this effect. For the rest of this turn after this card resolves, you cannot Special Summon monsters from the Extra Deck, except Plant monsters. If a Plant Link Monster(s) you control would be destroyed by battle or an opponent's card effect, you can banish this card from your GY instead. You can only activate 1 "Sunvine Sowing" per turn.
--聖蔓の播種 --Sunvine Sowing --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Special summon 1 "Sunseed" monster from Deck, take 1000 damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Substitute destruction for a plant link monster(s) 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) end --Lists "Sunseed" and "Sunavalon" archetypes s.listed_series={SET_SUNSEED,SET_SUNAVALON} --Specifically lists "Sunseed Genius Loci" s.listed_names={27520594} --Check for a "Sunavalon" link monster function s.linkchk(c) return c:IsLinkMonster() and c:IsSetCard(SET_SUNAVALON) end --Check for "Sunseed Genius Loci" or a "Sunseed" monster function s.spfilter(c,e,tp) return c:IsSetCard(SET_SUNSEED) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (Duel.IsExistingMatchingCard(s.linkchk,tp,LOCATION_MZONE,0,1,nil) or c:IsCode(27520594)) end --Activation legality function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000) end --Special summon 1 "Sunseed" monster from Deck, take 1000 damage function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) then Duel.Damage(tp,1000,REASON_EFFECT) end end if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end --Cannot Special Summon from the Extra Deck, except Plants local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) --Lizard check aux.addTempLizardCheck(e:GetHandler(),tp,s.lizfilter) end --Clock Lizard filter function s.lizfilter(e,c) return not c:IsOriginalRace(RACE_PLANT) end --Restricted to plant monsters for extra deck function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsRace(RACE_PLANT) and c:IsLocation(LOCATION_EXTRA) end --Substitute destruction for a plant link monster(s) function s.repfilter(c,tp) return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsRace(RACE_PLANT) and c:IsLinkMonster() and not c:IsReason(REASON_REPLACE) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)) 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:
Destroy 1 monster on the field with an A-Counter. Then, you can Special Summon 1 Level 4 "Alien" monster from your Deck. Destroy it during the End Phase.
--トライアングル・エリア --Mysterious Triangle local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_ALIEN} s.counter_list={COUNTER_A} function s.filter(c) return c:GetCounter(COUNTER_A)>0 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,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ALIEN) and c:GetLevel()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,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.BreakEffect() Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) local sc=sg:GetFirst() local fid=e:GetHandler():GetFieldID() sc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1,fid) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetLabel(fid) e1:SetLabelObject(sc) e1:SetCondition(s.descon) e1:SetOperation(s.desop) Duel.RegisterEffect(e1,tp) end end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:GetFlagEffectLabel(id)~=e:GetLabel() then e:Reset() return false else return true end end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetLabelObject(),REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can reveal 1 Ritual Spell in your hand; Special Summon both this card from your hand and 1 "Impcantation" monster from your Deck, except "Impcantation Candoll". If this card is Special Summoned from the Deck: You can add 1 Ritual Spell from your Deck to your hand. You can only use 1 "Impcantation Candoll" effect per turn, and only once that turn. You cannot Special Summon monsters from the Extra Deck.
--魔神儀-キャンドール --Impcantation Candoll 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_HAND) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,id) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) --spsummon limit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetTargetRange(1,0) e3:SetTarget(s.sumlimit) c:RegisterEffect(e3) --clock lizard aux.addContinuousLizardCheck(c,LOCATION_MZONE) end s.listed_series={SET_IMPCANTATION} s.listed_names={id} function s.filter(c,e,tp) return c:IsSetCard(SET_IMPCANTATION) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.costfilter(c) return c:IsRitualSpell() and not c:IsPublic() end function s.spcost(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.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) end function s.sptg(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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,e:GetHandler(),e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND|LOCATION_DECK) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,e:GetHandler(),e,tp) if #g>0 then g:AddCard(e:GetHandler()) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_DECK) end function s.thfilter(c) return c:IsRitualSpell() 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.sumlimit(e,c,sump,sumtype,sumpos,targetp) return c:IsLocation(LOCATION_EXTRA) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a monster is Normal or Special Summoned to a zone a Link Monster points to (except during the Damage Step): You can Special Summon this card from your GY (if it was there when the Summon resolved) or hand (even if not), but banish it when it leaves the field. You can only use this effect of "Sea Archiver" once per turn.
--シーアーカイバー --Sea Archiver 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_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCountLimit(1,id) 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) end function s.cfilter(c,g) return g:IsContains(c) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return #(eg&Duel.GetLinkedGroup(tp,LOCATION_MZONE,LOCATION_MZONE))>0 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_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Legendary Knight Timaeus" + "Legendary Knight Critias" + "Legendary Knight Hermos" Must be Special Summoned (from your Extra Deck) by sending the above cards you control to the GY. (You do not use "Polymerization".) Unaffected by other cards' effects. Once per battle, if this card battles, during damage calculation (Quick Effect): You can make this card's ATK/DEF become equal to the ATK of the monster on the field with the highest ATK (your choice, if tied). When this card is destroyed by battle: You can Special Summon 3 "Legendary Knight" monsters from your hand, Deck, and/or GY, ignoring their Summoning conditions.
--合神竜ティマイオス --Timaeus the Knight of Destiny local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,80019195,85800949,84565800) Fusion.AddContactProc(c,s.contactfil,s.contactop,true) --immune local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.econ) e3:SetValue(s.efilter) c:RegisterEffect(e3) --atk & def local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e4:SetRange(LOCATION_MZONE) e4:SetCondition(s.atkcon) e4:SetTarget(s.atktg) e4:SetOperation(s.atkop) c:RegisterEffect(e4) --spsummon local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_BATTLE_DESTROYED) e5:SetTarget(s.sptg) e5:SetOperation(s.spop) c:RegisterEffect(e5) end s.listed_series={SET_LEGENDARY_KNIGHT} s.material_setcode=SET_LEGENDARY_KNIGHT function s.contactfil(tp) return Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,nil) end function s.contactop(g) Duel.SendtoGrave(g,REASON_COST|REASON_MATERIAL) end function s.econ(e) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) end function s.efilter(e,te) return te:GetOwner()~=e:GetOwner() end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c==Duel.GetAttacker() or c==Duel.GetAttackTarget() end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,c) if #g==0 then return false end local g1,atk=g:GetMaxGroup(Card.GetAttack) return c:GetAttack()~=atk and c:GetFlagEffect(id)==0 end c:RegisterFlagEffect(id,RESET_CHAIN,0,1) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,c) if #g==0 then return end local g1,atk=g:GetMaxGroup(Card.GetAttack) if c:IsRelateToEffect(e) and c:IsFaceup() and atk>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(atk) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE_FINAL) c:RegisterEffect(e2) end end function s.spfilter(c,e,tp) return c:IsSetCard(SET_LEGENDARY_KNIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) end function s.sptg(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)>=3 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,3,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE) 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)<3 then return end local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,nil,e,tp) if #g>2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,3,3,nil) Duel.SpecialSummon(sg,0,tp,tp,true,true,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute Summon this card by Tributing 1 Effect Monster. During your opponent's Main Phase, if a card(s) is added from the Main Deck to their hand (except by drawing it) and this card is in your hand, you can: Immediately after this effect resolves, Tribute Summon this card. If this card is Normal or Special Summoned from the hand, you can: Make your opponent banish the top cards of their Deck face-down, equal to the number of cards in their hand, then, they shuffle their entire hand into the Deck, and if they do, they add the card(s) banished by this effect to their hand. You can only use this effect of "Bahalutiya, the Grand Radiance" once per turn.
--光の天穿バハルティヤ --Bahalutiya, the Grand Radiance --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --summon with 1 tribute local e1=aux.AddNormalSummonProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.otfilter) local e2=aux.AddNormalSetProcedure(c,true,true,1,1,SUMMON_TYPE_TRIBUTE,aux.Stringid(id,0),s.otfilter) --tribute summon local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SUMMON) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_TO_HAND) e3:SetRange(LOCATION_HAND) e3:SetCondition(s.tscon) e3:SetTarget(s.tstg) e3:SetOperation(s.tsop) c:RegisterEffect(e3) --hand local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_REMOVE+CATEGORY_TODECK+CATEGORY_TOHAND) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET) e4:SetCountLimit(1,id) e4:SetCondition(s.thcon) e4:SetTarget(s.thtg) e4:SetOperation(s.thop) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e5) end function s.otfilter(c,tp) return c:IsType(TYPE_EFFECT) and (c:IsControler(tp) or c:IsFaceup()) end function s.cfilter(c,tp) return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) and not c:IsReason(REASON_DRAW) end function s.tscon(e,tp,eg,ep,ev,re,r,rp) local ph=Duel.GetCurrentPhase() return Duel.IsTurnPlayer(1-tp) and (Duel.IsMainPhase()) and eg:IsExists(s.cfilter,1,nil,1-tp) end function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1) end Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,0,0) end function s.tsop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then local s1=c:IsSummonable(true,nil,1) local s2=c:IsMSetable(true,nil,1) if (s1 and s2 and Duel.SelectPosition(tp,c,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then Duel.Summon(tp,c,true,nil,1) else Duel.MSet(tp,c,true,nil,1) end end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_HAND) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND) local ct=#hg local dg=Duel.GetDecktopGroup(1-tp,ct) if chk==0 then return ct>0 and dg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==ct and hg:FilterCount(Card.IsAbleToDeck,nil)==ct end Duel.SetTargetPlayer(1-tp) Duel.SetOperationInfo(0,CATEGORY_REMOVE,dg,ct,1-tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,hg,ct,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local hg=Duel.GetFieldGroup(p,LOCATION_HAND,0) local ct=#hg local dg=Duel.GetDecktopGroup(p,ct) if ct>0 and dg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==ct and Duel.Remove(dg,POS_FACEDOWN,REASON_EFFECT)==ct then Duel.BreakEffect() local og=Duel.GetOperatedGroup() if Duel.SendtoDeck(hg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then Duel.SendtoHand(og,p,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Detach 1 material from a monster on either field, and if you do, excavate the top 4 cards of your Deck, choose 1 of them, and apply the appropriate effect based on its card type, also place the rest on top of the Deck in the same order. ● Monster/Spell: Add it to your hand. ● Trap: Set it. It can be activated this turn. You can only activate 1 "Puppet Shark" per turn.
--傀儡流儀-パペット・シャーク --Puppet Shark --scripted by pyrQ 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:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) 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.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 and Duel.CheckRemoveOverlayCard(tp,1,1,1,REASON_EFFECT) end Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.filter(c) return ((c:IsMonster() or c:IsSpell()) and c:IsAbleToHand()) or (c:IsTrap() and c:IsSSetable()) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.RemoveOverlayCard(tp,1,1,1,1,REASON_EFFECT)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 then Duel.ConfirmDecktop(tp,4) local g=Duel.GetDecktopGroup(tp,4) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) local sc=g:FilterSelect(tp,s.filter,1,1,nil):GetFirst() if not sc then return end Duel.DisableShuffleCheck() if (sc:IsMonster() or sc:IsSpell()) and Duel.SendtoHand(sc,nil,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,sc) Duel.ShuffleHand(tp) elseif sc:IsTrap() and Duel.SSet(tp,sc)>0 then sc:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) --It can be activated this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,3)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner monsters If this card is Special Summoned: You can add 1 "Black Garden" from your Deck or GY to your hand. You can banish this card from your GY, then target 1 "Rose Dragon" monster or 1 Dragon Synchro Monster in your GY; Special Summon it. You can only use each effect of "Garden Rose Maiden" once per turn.
--ガーデン・ローズ・メイデン --Garden Rose Maiden --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --search local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_names={71645242} s.listed_series={SET_ROSE_DRAGON} function s.thfilter(c) return c:IsCode(71645242) 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.spfilter(c,e,tp) return (c:IsSetCard(SET_ROSE_DRAGON) or (c:IsRace(RACE_DRAGON) 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 and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 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:
Target 1 face-up Special Summoned monster on the field; change it to face-down Defense Position. If you control a Level 5 or higher Illusion monster, while this card is in your GY: You can Set this card, but banish it when it leaves the field. You can only use 1 "Sinful Spoils of Slumber - Morrian" effect per turn, and only once that turn.
--微睡の罪宝-モーリアン --Sinful Spoils of Slumber - Morrian --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Change 1 Special Summoned monster to face-down position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetHintTiming(TIMING_BATTLE_PHASE,TIMINGS_CHECK_MONSTER_E|TIMING_BATTLE_PHASE) e1:SetTarget(s.postg) e1:SetOperation(s.posop) c:RegisterEffect(e1) --Set this card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetHintTiming(TIMING_END_PHASE,TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER_E) e2:SetCondition(s.setcon) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) end function s.posfilter(c) return c:IsFaceup() and c:IsSpecialSummoned() and c:IsCanTurnSet() end function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.posfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) end function s.posop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) end end function s.setconfilter(c) return c:IsFaceup() and c:IsRace(RACE_ILLUSION) and c:IsLevelAbove(5) end function s.setcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.setconfilter,tp,LOCATION_MZONE,0,1,nil) 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,0,0) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsSSetable() and Duel.SSet(tp,c)>0 then --Banish it when it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_REMOVED) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) c:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Vanquish Soul" monster you control; Special Summon up to 2 "Vanquish Soul" monsters from your hand, with different names from each other, neither of which has the same original Attribute as the targeted monster (but negate their effects and return them to the hand during the End Phase), then you can return to the hand all cards your opponent controls that are in the same columns as the targeted monster you control and the monster(s) Special Summoned by this effect. You can only activate 1 "Vanquish Soul Trinity Burst" per turn.
--VSトリニティ・バースト --Vanquish Soul Trinity Burst --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND) 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,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_VANQUISH_SOUL} function s.tgfilter(c,e,tp) return c:IsFaceup() and c:IsSetCard(SET_VANQUISH_SOUL) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,c:GetOriginalAttribute()) end function s.spfilter(c,e,tp,att) return c:IsSetCard(SET_VANQUISH_SOUL) and c:GetOriginalAttribute()~=att and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_ONFIELD) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if not tc:IsRelateToEffect(e) or tc:IsFacedown() or ft<=0 then return end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,nil,e,tp,tc:GetOriginalAttribute()) if #g==0 then return end local ct=math.min(2,ft) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ct=1 end local sg=aux.SelectUnselectGroup(g,e,tp,1,ct,aux.dncheck,1,tp,HINTMSG_SPSUMMON) local og=Group.CreateGroup() for sc in sg:Iter() do if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then --Negate their effects local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) sc:RegisterEffect(e2) og:AddCard(sc) end end if Duel.SpecialSummonComplete()==0 then return end if #og>0 then aux.DelayedOperation(og,PHASE_END,id,e,tp,function(ag) Duel.SendtoHand(ag,nil,REASON_EFFECT) end,nil,0) local thg=Group.CreateGroup() for oc in (og+tc):Iter() do thg:Merge(oc:GetColumnGroup():Filter(s.thfilter,nil,1-tp)) end if #thg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() Duel.SendtoHand(thg,nil,REASON_EFFECT) end end end function s.thfilter(c,p) return c:IsAbleToHand() and c:IsControler(p) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Each player can only control 1 Attribute of monster. Send all other face-up monsters they control to the GY.
--御前試合 --Gozen Match 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(TIMING_STANDBY_PHASE,TIMING_STANDBY_PHASE|TIMINGS_CHECK_MONSTER) e1:SetTarget(s.acttg) c:RegisterEffect(e1) --adjust local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCode(EVENT_ADJUST) e2:SetRange(LOCATION_SZONE) e2:SetOperation(s.adjustop) c:RegisterEffect(e2) --cannot summon,spsummon,flipsummon local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCode(EFFECT_FORCE_SPSUMMON_POSITION) e4:SetRange(LOCATION_SZONE) e4:SetTargetRange(1,1) e4:SetTarget(s.sumlimit) e4:SetValue(POS_FACEDOWN) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_CANNOT_SUMMON) c:RegisterEffect(e5) local e6=e4:Clone() e6:SetCode(EFFECT_CANNOT_FLIP_SUMMON) c:RegisterEffect(e6) --Cannot activate a monster's effect that flips itself face-up as cost if it's of a different Attribute than the other face-up monsters that player controls local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_FIELD) e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e7:SetCode(EFFECT_CANNOT_ACTIVATE) e7:SetRange(LOCATION_SZONE) e7:SetTargetRange(1,1) e7:SetValue(function(e,re,tp) return re:HasSelfChangePositionCost() and s[tp]>0 and re:GetHandler():IsAttributeExcept(s[tp]) end) c:RegisterEffect(e7) end s[0]=0 s[1]=0 function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end s[0]=0 s[1]=0 end function s.sumlimit(e,c,sump,sumtype,sumpos,targetp) local at=s.getattribute(Duel.GetMatchingGroup(Card.IsFaceup,targetp or sump,LOCATION_MZONE,0,nil)) if at==0 then return false end return c:GetAttribute()~=at end function s.getattribute(g) local aat=0 for tc in g:Iter() do aat=(aat|tc:GetAttribute()) end return aat end function s.rmfilter(c,at) return c:GetAttribute()==at end function s.adjustop(e,tp,eg,ep,ev,re,r,rp) local phase=Duel.GetCurrentPhase() if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end local g1=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g2=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local c=e:GetHandler() if #g1==0 then s[tp]=0 else local att=s.getattribute(g1) if (att&att-1)~=0 then if s[tp]==0 or (s[tp]&att)==0 then Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,0)) att=Duel.AnnounceAttribute(tp,1,att) else att=s[tp] end end g1:Remove(s.rmfilter,nil,att) s[tp]=att end if #g2==0 then s[1-tp]=0 else local att=s.getattribute(g2) if (att&att-1)~=0 then if s[1-tp]==0 or (s[1-tp]&att)==0 then Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,0)) att=Duel.AnnounceAttribute(1-tp,1,att) else att=s[1-tp] end end g2:Remove(s.rmfilter,nil,att) s[1-tp]=att end local readjust=false if #g1>0 then Duel.SendtoGrave(g1,REASON_RULE,PLAYER_NONE,tp) readjust=true end if #g2>0 then Duel.SendtoGrave(g2,REASON_RULE,PLAYER_NONE,1-tp) readjust=true end if readjust then Duel.Readjust() end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 4 monsters You can also Xyz Summon this card by using a "Ghostrick" Xyz Monster you control as material, except "Ghostrick Angel of Mischief". (Transfer its materials to this card.) When the number of materials on this card becomes 10, you win the Duel. Once per turn: You can detach 1 material from this card; add 1 "Ghostrick" Spell/Trap from your Deck to your hand. Once per turn: You can attach 1 "Ghostrick" card from your hand to this card as material.
--ゴーストリックの駄天使 --Ghostrick Angel of Mischief local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,nil,4,2,s.ovfilter,aux.Stringid(id,0)) c:EnableReviveLimit() --win local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EVENT_ADJUST) e1:SetRange(LOCATION_MZONE) e1:SetOperation(s.winop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCost(Cost.DetachFromSelf(1)) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) --material local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(s.mttg) e3:SetOperation(s.mtop) c:RegisterEffect(e3) end s.listed_series={SET_GHOSTRICK} s.listed_names={id} function s.ovfilter(c,tp,xyzc) return c:IsFaceup() and c:IsSetCard(SET_GHOSTRICK,xyzc,SUMMON_TYPE_XYZ,tp) and c:IsType(TYPE_XYZ,xyzc,SUMMON_TYPE_XYZ,tp) and not c:IsSummonCode(xyzc,SUMMON_TYPE_XYZ,tp,id) end function s.winop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():GetOverlayCount()==10 then Duel.Win(tp,WIN_REASON_GHOSTRICK_MISCHIEF) end end function s.thfilter(c) return c:IsSetCard(SET_GHOSTRICK) and c:IsSpellTrap() 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.mtfilter(c) return c:IsSetCard(SET_GHOSTRICK) end function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(s.mtfilter,tp,LOCATION_HAND,0,1,nil) end end function s.mtop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsFacedown() then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) local g=Duel.SelectMatchingCard(tp,s.mtfilter,tp,LOCATION_HAND,0,1,1,nil) if #g>0 then Duel.Overlay(c,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Negate all LIGHT monster effects activated on the field or in the GY.
--閃光を吸い込むマジック・ミラー --Light-Imprisoning Mirror 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) --disable local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_CHAIN_ACTIVATING) e2:SetOperation(s.disop) c:RegisterEffect(e2) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) if re:IsMonsterEffect() and (loc==LOCATION_MZONE or loc==LOCATION_GRAVE) and re:GetHandler():IsAttribute(ATTRIBUTE_LIGHT) then Duel.NegateEffect(ev) 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) by Tributing 1 "Blue-Eyes Ultimate Dragon". Gains 300 ATK for each Dragon monster in your GY. When a card or effect is activated that targets this card (Quick Effect): You can negate that effect.
--青眼の光龍 --Blue-Eyes Shining Dragon local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --cannot special summon 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:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --atkup local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetRange(LOCATION_MZONE) e3:SetValue(s.val) c:RegisterEffect(e3) --negate local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_DISABLE) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_CHAINING) e4:SetRange(LOCATION_MZONE) e4:SetCondition(s.discon) e4:SetTarget(s.distg) e4:SetOperation(s.disop) c:RegisterEffect(e4) --Double Snare local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE) e5:SetRange(LOCATION_MZONE) e5:SetCode(3682106) c:RegisterEffect(e5) end s.listed_names={23995346} function s.spcon(e,c) if c==nil then return true end return Duel.CheckReleaseGroup(c:GetControler(),Card.IsCode,1,false,1,true,c,c:GetControler(),nil,false,nil,23995346) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,false,true,true,c,nil,nil,false,nil,23995346) 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.val(e,c) return Duel.GetMatchingGroupCount(Card.IsRace,c:GetControler(),LOCATION_GRAVE,0,nil,RACE_DRAGON)*300 end function s.discon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end local loc,tg=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TARGET_CARDS) if not tg or not tg:IsContains(c) then return false end return Duel.IsChainDisablable(ev) and loc~=LOCATION_DECK end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function s.disop(e,tp,eg,ep,ev,re,r,rp,chk) Duel.NegateEffect(ev) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
At the start of the Battle Phase: You can change the equipped monster's battle position, and if you do, immediately after this effect resolves, Normal Summon 1 monster. You can only use this effect of "Supermagic Sword of Raptinus" once per turn. Apply this effect depending on the equipped monster's battle position. ● Attack Position: Your opponent cannot target the equipped monster with card effects. ● Defense Position: The equipped monster cannot be destroyed by battle.
--ラプテノスの超魔剣 --Supermagic Sword of Raptinus --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c) --Cannot target local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetValue(aux.tgoval) e1:SetCondition(s.indcon) c:RegisterEffect(e1) --Cannot destroy local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetValue(1) e2:SetCondition(s.ntcon) c:RegisterEffect(e2) --Normal Summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE|PHASE_BATTLE_START) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1,id) e3:SetTarget(s.nstg) e3:SetOperation(s.nsop) c:RegisterEffect(e3) end function s.indcon(e,c) return e:GetHandler():GetEquipTarget():IsAttackPos() end function s.ntcon(e,c) return e:GetHandler():GetEquipTarget():IsDefensePos() end function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk) local tc=e:GetHandler():GetEquipTarget() if chk==0 then return tc and tc:IsCanChangePosition() and Duel.IsExistingMatchingCard(Card.IsSummonable,tp,LOCATION_HAND|LOCATION_MZONE,0,1,nil,true,nil) end Duel.SetOperationInfo(0,CATEGORY_POSITION,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) end function s.nsop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetHandler():GetEquipTarget() if tc and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local sc=Duel.SelectMatchingCard(tp,Card.IsSummonable,tp,LOCATION_HAND|LOCATION_MZONE,0,1,1,nil,true,nil):GetFirst() if sc then Duel.Summon(tp,sc,true,nil) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
All face-up "Saber" monsters you control gain 400 ATK.
--総剣司令 ガトムズ --Commander Gottoms, Swordmaster local s,id=GetID() function s.initial_effect(c) --atk local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_SABER)) e1:SetValue(400) c:RegisterEffect(e1) end s.listed_series={SET_SABER}
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1+ non-Tuner monsters If this card is Synchro Summoned using a "Blackwing" monster as material, it is treated as a Tuner while face-up on the field. You can only use each of these effects of "Assault Blackwing - Sohaya the Rain Storm" once per turn. ● When this card is Synchro Summoned: You can target 1 "Assault Blackwing" monster in your GY; Special Summon it. ● During your Main Phase, if this card is in the GY because it was sent there this turn: You can banish 1 other "Assault Blackwing - Sohaya the Rain Storm" from your GY; Special Summon this card.
--A BF-五月雨のソハヤ --Assault Blackwing - Sohaya the Rain Storm local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) c:EnableReviveLimit() --add type local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.tncon) e1:SetOperation(s.tnop) c:RegisterEffect(e1) 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) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,id) e3:SetCondition(s.spcon1) e3:SetTarget(s.sptg1) e3:SetOperation(s.spop1) 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_IGNITION) e4:SetRange(LOCATION_GRAVE) e4:SetCountLimit(1,{id,1}) e4:SetCondition(s.spcon2) e4:SetCost(s.spcost) e4:SetTarget(s.sptg2) e4:SetOperation(s.spop2) c:RegisterEffect(e4) end s.listed_series={SET_ASSAULT_BLACKWING,SET_BLACKWING} s.listed_names={id} function s.valcheck(e,c) local g=c:GetMaterial() if g:IsExists(Card.IsSetCard,1,nil,SET_BLACKWING) then e:GetLabelObject():SetLabel(1) else e:GetLabelObject():SetLabel(0) end end function s.tncon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSynchroSummoned() and e:GetLabel()==1 end function s.tnop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetValue(TYPE_TUNER) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) end function s.spcon1(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSynchroSummoned() end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ASSAULT_BLACKWING) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) 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.spop1(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 function s.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetTurnID()==Duel.GetTurnCount() and not e:GetHandler():IsReason(REASON_RETURN) end function s.costfilter(c,tp) return c:IsCode(id) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or (c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5)) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,e:GetHandler(),tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,e:GetHandler(),tp) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.sptg2(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,0) end function s.spop2(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:
You can banish this card from your hand or GY; Special Summon 1 Level 4 or lower FIRE Warrior monster from your hand as a Tuner. If this card is Normal or Special Summoned: You can target 1 Level 4 or lower FIRE Warrior monster in your GY, except "Infernoble Knight Ricciardetto"; Special Summon it, also you cannot Special Summon monsters for the rest of this turn, except Warrior monsters. You can only use 1 "Infernoble Knight Ricciardetto" effect per turn, and only once that turn.
--焔聖騎士-リッチャルデット --Infernoble Knight Ricciardetto --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon 1 Level 4 or lower FIRE Warrior monster from your hand as a Tuner 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|LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfBanish) e1:SetTarget(s.handsptg) e1:SetOperation(s.handspop) c:RegisterEffect(e1) --Special Summon 1 Level 4 or lower FIRE Warrior monster from your GY local e2a=Effect.CreateEffect(c) e2a:SetDescription(aux.Stringid(id,1)) e2a:SetCategory(CATEGORY_SPECIAL_SUMMON) e2a:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2a:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2a:SetCode(EVENT_SUMMON_SUCCESS) e2a:SetCountLimit(1,id) e2a:SetTarget(s.gysptg) e2a:SetOperation(s.gyspop) c:RegisterEffect(e2a) local e2b=e2a:Clone() e2b:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2b) end s.listed_names={id} function s.handspfilter(c,e,tp) if not (c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_WARRIOR)) then return false end c:AssumeProperty(ASSUME_TYPE,c:GetType()|TYPE_TUNER) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.handsptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.handspfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.handspop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.handspfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then --Treated as a Tuner local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetValue(TYPE_TUNER) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) end Duel.SpecialSummonComplete() end function s.gyspfilter(c,e,tp) return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_WARRIOR) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.gysptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.gyspfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.gyspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.gyspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end function s.gyspop(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 --You cannot Special Summon for the rest of this turn, except Warrior monsters 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_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(function(e,c) return not c:IsRace(RACE_WARRIOR) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During the Damage Step, in either player's turn, when a face-up EARTH Normal Monster you control attacks or is attacked: You can send this card from your hand to the Graveyard; that monster gains 1000 ATK and DEF until the End Phase.
--ジェム・マーチャント --Gem-Merchant local s,id=GetID() function s.initial_effect(c) --atk,def up local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetRange(LOCATION_HAND) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCondition(s.condition) e1:SetCost(Cost.SelfToGrave) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.filter(c) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsType(TYPE_NORMAL) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local phase=Duel.GetCurrentPhase() if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() return (a:IsControler(tp) and s.filter(a) and a:IsRelateToBattle()) or (d and d:IsControler(tp) and d:IsFaceup() and s.filter(d) and d:IsRelateToBattle()) end function s.operation(e,tp,eg,ep,ev,re,r,rp,chk) local a=Duel.GetAttacker() if Duel.IsTurnPlayer(1-tp) then a=Duel.GetAttackTarget() end if not a:IsRelateToBattle() then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(1000) a:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) a:RegisterEffect(e2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Effect Monsters Gains 500 ATK for each monster this card points to. Cannot be destroyed by battle or your opponent's card effects, while this card points to a monster.
--コード・トーカー --Code Talker --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --link summon Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_EFFECT),2,2) c:EnableReviveLimit() --atk local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) --indes local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetCondition(s.incon) e2:SetValue(1) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e3:SetValue(s.inval) c:RegisterEffect(e3) end function s.atkval(e,c) return #(c:GetLinkedGroup():Filter(Card.IsMonster,nil))*500 end function s.incon(e) return #(e:GetHandler():GetLinkedGroup():Filter(Card.IsMonster,nil))>0 end function s.inval(e,re,tp) return tp~=e:GetHandlerPlayer() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If an Insect or Plant monster is in either GY, you can Special Summon this card (from your hand). You can only Special Summon "Fairyant the Circular Sorcerer" once per turn this way. If this card you control would be used as Synchro Material for an Insect or Plant monster, you can treat it as a non-Tuner.
--円喚師フェアリ --Fairyant the Circular Sorcerer --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon itself from the hand local e1=Effect.CreateEffect(c) 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.spcon) c:RegisterEffect(e1) --Can be used as a non-Tuner for the Synchro Summon of a Plant/Insect monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_NONTUNER) e2:SetRange(LOCATION_MZONE) e2:SetValue(function(e,sc) return sc:IsRace(RACE_PLANT|RACE_INSECT) end) c:RegisterEffect(e2) end function s.spcon(e,c) if c==nil then return true end return Duel.IsExistingMatchingCard(Card.IsRace,0,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,RACE_PLANT|RACE_INSECT) and Duel.GetLocationCount(e:GetHandlerPlayer(),LOCATION_MZONE)>0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Unchained" monster you control and 1 card on the field; destroy both. If this Set card is destroyed by card effect: You can Special Summon 1 "Unchained" monster from your Deck. You can only use each effect of "Escape of the Unchained" once per turn.
--破械唱導 --Escape of the Unchained --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Destroy both 1 "Unchained" monster you control and 1 card on the field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --Special Summon 1 "Unchained" monster from your Deck 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) e2:SetCode(EVENT_DESTROYED) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_UNCHAINED} function s.resconfilter(c,tp) return c:IsSetCard(SET_UNCHAINED) and c:IsMonster() and c:IsControler(tp) and c:IsFaceup() end function s.rescon(sg,e,tp,mg) return sg:IsExists(s.resconfilter,1,nil,tp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),e) if chk==0 then return aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end local tg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_DESTROY) Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,2,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg==2 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:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_UNCHAINED) 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_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:
If your LP are lower than 100: Draw 2 cards, then, if your LP are lower than 10, draw 2 additional cards.
--走魔灯 --End of the Line --Scripted by DyXel local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_FREE_CHAIN) 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 Duel.GetLP(tp)<100 end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local ct=Duel.GetLP(tp)<10 and 4 or 2 if chk==0 then return Duel.IsPlayerCanDraw(tp,ct) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) if Duel.Draw(p,2,REASON_EFFECT)~=2 then return end if Duel.GetLP(tp)<10 then Duel.BreakEffect() Duel.Draw(tp,2,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Tuner + 1 or more non-Tuner monsters Tokens you control cannot be destroyed by battle or card effects. If this card you control is destroyed by your opponent's card (either by battle or by card effect) and sent to your Graveyard: You can Tribute all Tokens you control, then target 1 Level 4 or lower "Mecha Phantom Beast" monster in your Graveyard; Special Summon that target.
--幻獣機コンコルーダ --Mecha Phantom Beast Concoruda local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Synchro Summon procedure Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99) --Tokens you control cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TOKEN)) e1:SetValue(1) c:RegisterEffect(e1) --Tokens you control cannot be destroyed by effects local e2=e1:Clone() e2:SetTargetRange(LOCATION_ONFIELD,0) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e2) --Special Summon 1 Level 4 or lower "Mecha Phantom Beast" monster from the Graveyard local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCode(EVENT_TO_GRAVE) e3:SetCondition(s.spcon) e3:SetCost(s.spcost) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_series={SET_MECHA_PHANTOM_BEAST} function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_TOKEN) e:SetLabel(#g) if chk==0 then return #g>0 and g:FilterCount(Card.IsReleasable,nil)==#g end Duel.Release(g,REASON_COST) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_MECHA_PHANTOM_BEAST) and c:IsLevelBelow(4) 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)>-e:GetLabel()+1 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:
This card can be treated as 2 Tributes for the Tribute Summon of an EARTH Normal Monster.
--ガイアフレーム --Earth Effigy 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 function s.condition(e,c) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsType(TYPE_NORMAL) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
3 Normal Monsters Must be Fusion Summoned. You can only control 1 "First of the Dragonlords". Cannot be destroyed by battle, and is unaffected by other monsters' effects. Once, while face-up on the field, when a Spell/Trap Card or effect is activated (Quick Effect): You can destroy all Spells and Traps on the field. You can only use this effect of "First of the Dragonlords" once per turn.
--始祖の竜王 --First of the Dragonlords --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Fusion Materials: 3 Normal Monsters Fusion.AddProcMixN(c,true,true,aux.FilterBoolFunctionEx(Card.IsType,TYPE_NORMAL),3) c:AddMustBeFusionSummoned() --You can only control 1 "First of the Dragonlords" c:SetUniqueOnField(1,0,id) --Cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) c:RegisterEffect(e1) --Unaffected by other monsters' effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetRange(LOCATION_MZONE) e2:SetValue(function(e,te) return te:IsMonsterEffect() and te:GetOwner()~=e:GetOwner() end) c:RegisterEffect(e2) --Destroy all Spells and Traps on the field local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re:IsSpellTrapEffect() end) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_names={id} function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsSpellTrap,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,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:
Target 1 face-up "Heroic" monster you control; this turn, double its ATK, but it cannot attack your opponent directly. You can only activate 1 "Heroic Chance" per turn.
--ヒロイック・チャンス --Heroic Chance local s,id=GetID() function s.initial_effect(c) --Targeted "Heroic" monster's ATK becomes doubled, cannot attack directly local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_HEROIC} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_HEROIC) 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) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then --ATK becomes doubled of its current ATK local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(tc:GetAttack()*2) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) --Cannot attack directly local e2=Effect.CreateEffect(e:GetHandler()) e2:SetDescription(3206) e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) e2:SetType(EFFECT_TYPE_SINGLE) 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:
If a Level 7 or lower "Red-Eyes" monster(s) you control is destroyed by your opponent's attack or card effect and sent to your GY, while this card is in your hand: You can Special Summon this card in Defense Position, and if you do, Special Summon as many of those destroyed monsters as possible in the same position they were in when destroyed. You can Tribute this card; you can Normal Summon 1 "Red-Eyes" monster during your Main Phase this turn in addition to your Normal Summon/Set. (You can only gain this effect once per turn.)
--真紅眼の遡刻竜 --Red-Eyes Retro Dragon 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_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_GRAVE) e1:SetRange(LOCATION_HAND) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Additional Normal Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCondition(function(_,tp) return Duel.IsPlayerCanAdditionalSummon(tp) end) e2:SetCost(Cost.SelfTribute) e2:SetTarget(s.sumtg) e2:SetOperation(s.sumop) c:RegisterEffect(e2) end s.listed_series={SET_RED_EYES} function s.spfilter(c,e,tp) return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetReasonPlayer()==1-tp and c:IsReason(REASON_DESTROY) and (c:IsReason(REASON_EFFECT) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))) and c:IsPreviousSetCard(SET_RED_EYES) and c:IsSetCard(SET_RED_EYES) and c:GetPreviousLevelOnField()<=7 and c:IsLevelBelow(7) and c:IsControler(tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,c:GetPreviousPosition()) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local g=eg:Filter(s.spfilter,nil,e,tp) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and #g>0 end Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g+c,#g+1,tp,LOCATION_HAND|LOCATION_GRAVE) end function s.filter(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false,c:GetPreviousPosition()) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local g=Duel.GetTargetCards(e):Filter(s.filter,nil,e,tp) if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0 then local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if #g>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) g=g:Select(tp,ft,ft,nil) end for tc in g:Iter() do local pos=tc:GetPreviousPosition() Duel.SpecialSummonStep(tc,0,tp,tp,false,false,pos) end end Duel.SpecialSummonComplete() end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanSummon(tp) end end function s.sumop(e,tp,eg,ep,ev,re,r,rp) --Additional Normal Summon 1 "Red-Eyes" monster local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e1:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,SET_RED_EYES)) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your "Salamangreat" monster is targeted for an attack by an opponent's monster: You can send this card from your hand to the GY, then target those 2 monsters that would battle; gain LP equal to the ATK of that opponent's monster, also your targeted monster cannot be destroyed by battle this turn. When your "Salamangreat" monster destroys an opponent's monster by battle and sends it to the GY, while this card is in your GY: You can add this card to your hand. You can only use this effect of "Salamangreat Raccoon" once per turn.
--転生炎獣ラクーン --Salamangreat Raccoon --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Gain LP equal to opponent's attacking monster's ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BE_BATTLE_TARGET) e1:SetRange(LOCATION_HAND) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCondition(s.lpcon) e1:SetCost(Cost.SelfToGrave) e1:SetTarget(s.lptg) e1:SetOperation(s.lpop) c:RegisterEffect(e1) --Add this card from GY to 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:SetCode(EVENT_BATTLE_DESTROYED) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_SALAMANGREAT} function s.lpcon(e,tp,eg,ep,ev,re,r,rp) local d=Duel.GetAttackTarget() return d and d:IsControler(tp) and d:IsFaceup() and d:IsSetCard(SET_SALAMANGREAT) end function s.lpfilter(c,e) return c and c:IsOnField() and c:IsFaceup() and c:IsCanBeEffectTarget(e) end function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local at=Duel.GetAttacker() local tg=Duel.GetAttackTarget() if chkc then return chkc==at or chkc==tg end if chk==0 then return s.lpfilter(at,e) and s.lpfilter(tg,e) end local g=Group.FromCards(at,tg) Duel.SetTargetCard(g) local rec=at:GetAttack() Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec) end function s.lpop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) local at=Duel.GetAttacker() if at and g:IsContains(at) and at:IsFaceup() then Duel.Recover(tp,at:GetAttack(),REASON_EFFECT) end local tg=g:Filter(Card.IsControler,nil,tp):GetFirst() if tg and tg:IsFaceup() then --Cannot be destroyed by battle local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3000) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END) tg:RegisterEffect(e1) end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() local bc=tc:GetBattleTarget() return #eg==1 and tc:IsLocation(LOCATION_GRAVE) and tc:IsReason(REASON_BATTLE) and bc:IsRelateToBattle() and bc:IsControler(tp) and bc:IsSetCard(SET_SALAMANGREAT) 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,0,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) Duel.ConfirmCards(1-tp,c) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card in your hand, field, or GY can be used as a substitute for any 1 Fusion Material whose name is mentioned on the Fusion Monster Card, but the other materials must be correct. * The above text is unofficial and describes the card's functionality in the OCG.
--心眼の女神 --Goddess with the Third Eye local s,id=GetID() function s.initial_effect(c) --fusion substitute local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_FUSION_SUBSTITUTE) e1:SetCondition(s.subcon) c:RegisterEffect(e1) end function s.subcon(e) return e:GetHandler():IsLocation(LOCATION_HAND|LOCATION_ONFIELD|LOCATION_GRAVE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Send 1 face-up monster you control to the GY; apply this effect, depending on the Type it had on the field. ● Plant: During the End Phase of this turn, draw 2 cards, then discard 1 card. ● Non-Plant: Add 1 Level 4 or lower Plant monster from your Deck to your hand. You can only activate 1 "Frozen Rose" per turn.
--冷薔薇の抱香 --Frozen Rose --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --activate (draw and discard) 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:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.check=false function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) s.check=true if chk==0 then return true end end function s.cfilter(c,chk,p,chk1,chk2) return c:IsFaceup() and c:IsAbleToGraveAsCost() and ((chk == 0 and c:IsRace(RACE_PLANT)==p) or ((c:IsRace(RACE_PLANT) and chk1) or (not c:IsRace(RACE_PLANT) and chk2))) end function s.thfilter(c) return c:IsRace(RACE_PLANT) and c:IsLevelBelow(4) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local chk1 = Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,0,true) local chk2 = Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,0,false) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) if chk==0 then if not s.check then return false end s.check=false return chk1 or chk2 end e:SetLabel(0) e:SetCategory(0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,1,nil,chk1,chk2) local opt=g:GetFirst():IsRace(RACE_PLANT) and 0 or 1 Duel.SendtoGrave(g,REASON_COST) if opt == 0 then e:SetLabel(1) e:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) else e:SetLabel(2) e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_DECK) end end function s.drop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,PLAYER_ALL,id) if Duel.Draw(tp,2,REASON_EFFECT)==2 then Duel.ShuffleHand(tp) Duel.BreakEffect() Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) local opt=e:GetLabel() if opt==1 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetOperation(s.drop) Duel.RegisterEffect(e1,tp) elseif opt==2 then 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 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Banish 2 face-up "Blackwing" Tuner monsters you control; draw 2 cards.
--ブラック・ブースト --Blackboost local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) 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_BLACKWING} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_BLACKWING) and c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,0,2,2,nil) 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.IsPlayerCanDraw(tp,2) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) end function s.activate(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:
If a "Destiny HERO" monster attacks a monster with a higher ATK, the attacking monster gains 1000 ATK during damage calculation only.
--ダーク・シティ --Dark City 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 up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_FZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetCondition(s.atkcon) e2:SetTarget(s.atktg) e2:SetValue(s.atkval) c:RegisterEffect(e2) end s.listed_series={SET_DESTINY_HERO} function s.atkcon(e) s[0]=false return Duel.IsPhase(PHASE_DAMAGE_CAL) and Duel.GetAttackTarget() end function s.atktg(e,c) return c==Duel.GetAttacker() and c:IsSetCard(SET_DESTINY_HERO) end function s.atkval(e,c) local d=Duel.GetAttackTarget() if s[0] or c:GetAttack()<d:GetAttack() then s[0]=true return 1000 else return 0 end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
As long as this card remains in face-up Attack Position on your side of the field, increase your Life Points by 1000 points during each of your Standby Phases.
--そよ風の精霊 --Spirit of the Breeze local s,id=GetID() function s.initial_effect(c) --recover local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetRange(LOCATION_MZONE) 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 tp==Duel.GetTurnPlayer() and e:GetHandler():IsAttackPos() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1000) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local c=e:GetHandler() if c:IsPosition(POS_FACEUP_ATTACK) and c:IsRelateToEffect(e) then Duel.Recover(p,d,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While you control another "Ice Barrier" monster, each time your opponent activates a card or effect by paying LP, they lose 500 LP immediately after it resolves. You can only use each of the following effects of "Judge of the Ice Barrier" once per turn. You can target 1 or 2 "Ice Barrier" monsters in your GY and 1 or 2 cards in your opponent's GY; shuffle them into the Deck. If you control an "Ice Barrier" monster: You can banish this card from your GY, then target 1 Attack Position monster on the field; change it to Defense Position. * The above text is unofficial and describes the card's functionality in the OCG.
--氷結界の浄玻璃 --Judge of the Ice Barrier --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Opponent loses 500 LP each time they pay LP local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_PAY_LPCOST) e1:SetRange(LOCATION_MZONE) e1:SetOperation(s.regop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.dmgcon) e2:SetOperation(s.dmgop) c:RegisterEffect(e2) --Shuffle targeted cards into the deck local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) --Change targeted monster to defense position local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_POSITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_GRAVE) e4:SetCountLimit(1,{id,1}) e4:SetCost(Cost.SelfBanish) e4:SetCondition(s.poscon) e4:SetTarget(s.postg) e4:SetOperation(s.posop) c:RegisterEffect(e4) end --Lists "Ice Barrier" archetype s.listed_series={SET_ICE_BARRIER} function s.regop(e,tp,eg,ep,ev,re,r,rp) if not (re and re:IsActivated()) then return end e:GetHandler():RegisterFlagEffect(Duel.GetCurrentChain(),RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1) end --If you control another "Ice Barrier" monster function s.dmgcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (ep==1-tp and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_ICE_BARRIER),tp,LOCATION_MZONE,0,1,c)) then return false end return c:GetFlagEffect(Duel.GetCurrentChain())>0 end --Opponent loses 500 LP each time they pay LP function s.dmgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local lp=Duel.GetLP(1-tp) Duel.SetLP(1-tp,lp-500) end --Check for an "Ice Barrier" monster function s.tdfilter(c) return c:IsSetCard(SET_ICE_BARRIER) and c:IsMonster() and c:IsAbleToDeck() end --Check for an attack position monster function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g1=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,2,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g2=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,2,nil) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,#g1,0,0) end --Shuffle targeted cards into the deck function s.tdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g>0 then Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end --If you control an "Ice Barrier" monster function s.poscon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,SET_ICE_BARRIER),tp,LOCATION_MZONE,0,1,nil) end --Check for an attack position monster function s.posfilter(c) return c:IsAttackPos() and c:IsCanChangePosition() end --Activation legality function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.posfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) local g=Duel.SelectTarget(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0) end --Change targeted monster to defense position function s.posop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Sangan" + "Witch of the Black Forest"
--クリッチー --Sanwitch local s,id=GetID() function s.initial_effect(c) --fusion material c:EnableReviveLimit() Fusion.AddProcMix(c,true,true,78010363,26202165) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can target 1 face-up "Wind-Up" monster you control; increase its Level by 1 and its ATK by 600, until the End Phase. This effect can only be used once while this card is face-up on the field.
--ゼンマイウォリアー --Wind-Up Warrior local s,id=GetID() function s.initial_effect(c) --atk/lv up local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET+EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_ATKCHANGE) 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_WIND_UP} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_WIND_UP) and c:IsLevelAbove(1) 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) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.operation(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 e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(600) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_UPDATE_LEVEL) e2:SetReset(RESETS_STANDARD_PHASE_END) e2:SetValue(1) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
"Ancient Gear Golem", and monsters that mention it, in your Monster Zone are unaffected by your opponent's activated monster effects. If your opponent controls a monster: You can Fusion Summon 1 Fusion Monster that mentions "Ancient Gear Golem" from your Extra Deck, by banishing monsters from your field or GY as material, including "Ancient Gear Golem" you control, and if you do, it can make up to 3 attacks during each Battle Phase. You can only use this effect of "Ancient Gear Duel" once per turn.
--古代の機械競闘 --Ancient Gear Duel --scripted by Naim 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) --"Ancient Gear Golem" and monsters that mention it are unaffected by your opponent's activated monster effects local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetRange(LOCATION_SZONE) e2:SetTarget(function(e,c) return c:IsCode(CARD_ANCIENT_GEAR_GOLEM) or c:ListsCode(CARD_ANCIENT_GEAR_GOLEM) end) e2:SetValue(s.immval) c:RegisterEffect(e2) --Fusion Summon 1 Fusion Monster that mentions "Ancient Gear Golem" local params={fusfilter=function(c) return c:ListsCode(CARD_ANCIENT_GEAR_GOLEM) end, matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove), extrafil=s.fmatextra, extratg=s.extratarget, extraop=Fusion.BanishMaterial, stage2=s.stage2} local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_SZONE) e3:SetHintTiming(0,TIMING_MAIN_END|TIMINGS_CHECK_MONSTER_E) e3:SetCountLimit(1,id) e3:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end) e3:SetTarget(Fusion.SummonEffTG(params)) e3:SetOperation(Fusion.SummonEffOP(params)) c:RegisterEffect(e3) end s.listed_names={CARD_ANCIENT_GEAR_GOLEM} function s.immval(e,te) return te:GetOwnerPlayer()==1-e:GetHandlerPlayer() and te:IsActivated() and te:IsMonsterEffect() end function s.aggfilter(c,tp) return c:IsCode(CARD_ANCIENT_GEAR_GOLEM) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) end function s.fcheck(tp,sg,fc) return sg:IsExists(s.aggfilter,1,nil,tp) end function s.fmatextra(e,tp,mg) if not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil),s.fcheck end return nil,s.fcheck end function s.extratarget(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_MZONE|LOCATION_GRAVE) end function s.stage2(e,tc,tp,sg,chk) if chk==0 then --Can make up to 3 attacks during each Battle Phase local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetValue(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 Tribute any number of Tokens, then target 1 monster you control with 0 ATK; it gains ATK equal to the number Tributed x 1000 (until the end of this turn), and if it does, it can attack monsters up to the number Tributed during each Battle Phase this turn. You can only use this effect of "Token Support" once per turn. At the end of your opponent's Battle Phase: You can Special Summon "Support Tokens" (Beast/EARTH/Level 1/ATK 0/DEF 0) up to the number of Tokens destroyed during this Battle Phase.
--共闘闘君 --Token Support --scripted by Naim local s,id=GetID() local TOKEN_ALLIANCE=id+1 function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --Increase the ATK of a monster by 1000 per Token tributed also it can make up to that many attacks on monsters during each Battle Phase local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_SZONE) e1:SetCountLimit(1,id) e1:SetCost(s.atkcost) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --Special Summon "Alliance Tokens" up to the number of Token destroyed during the Battle Phase 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_PHASE|PHASE_BATTLE) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) and Duel.HasFlagEffect(0,id) end) e2:SetTarget(s.tkntg) e2:SetOperation(s.tknop) c:RegisterEffect(e2) --Registers Tokens destroyed during the Battle Phase 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_names={TOKEN_ALLIANCE} --"Alliance Token" function s.checkop(e,tp,eg,ep,ev,re,r,rp) if not Duel.IsBattlePhase() then return end local ct=eg:FilterCount(Card.IsType,nil,TYPE_TOKEN) if ct==0 then return end for i=1,ct do Duel.RegisterFlagEffect(0,id,RESET_PHASE|PHASE_BATTLE,0,1) end end function s.atkcostfilter(c,tp) return c:IsType(TYPE_TOKEN) and Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAttack,0),tp,LOCATION_MZONE,0,1,c) end function s.spcheck(sg,tp,exg) return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAttack,0),tp,LOCATION_MZONE,0,1,sg) end function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.atkcostfilter,1,false,s.spcheck,nil,tp) end local g=Duel.SelectReleaseGroupCost(tp,s.atkcostfilter,1,99,false,s.spcheck,nil,tp) local ct=Duel.Release(g,REASON_COST) e:SetLabel(ct) 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() and chkc:IsAttack(0) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAttack,0),tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAttack,0),tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,tp,1000*e:GetLabel()) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local ct=e:GetLabel() --Gains 1000 ATK for each Token Tributed local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(ct*1000) e1:SetReset(RESETS_STANDARD_PHASE_END) if tc:IsFaceup() then tc:RegisterEffect(e1) end --Can make multiple attacks on monsters local e2=e1:Clone() e2:SetCode(EFFECT_EXTRA_ATTACK_MONSTER) e2:SetValue(ct-1) tc:RegisterEffect(e2) end end function s.tkntg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_ALLIANCE,0,TYPES_TOKEN,0,0,1,RACE_BEAST,ATTRIBUTE_EARTH) end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) end function s.tknop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_ALLIANCE,0,TYPES_TOKEN,0,0,1,RACE_BEAST,ATTRIBUTE_EARTH) then return end if ft>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end local ct=Duel.AnnounceNumberRange(tp,1,math.min(ft,Duel.GetFlagEffect(0,id))) for i=1,ct do local token=Duel.CreateToken(tp,TOKEN_ALLIANCE) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
While you control another "Noble Knight" monster, your opponent cannot target monsters you control with less than 1800 ATK, except this card, with card effects, and their monsters cannot target them with attacks. If a "Noble Arms" Equip Spell becomes equipped to this card: Target 1 face-up card on the field; destroy that target. You can only use this effect of "Noble Knight Drystan" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--聖騎士トリスタン --Noble Knight Drystan local s,id=GetID() function s.initial_effect(c) --cannot be battle target local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e1:SetCondition(s.con) e1:SetValue(s.atlimit) c:RegisterEffect(e1) --cannot be effect 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_MZONE,0) e2:SetCondition(s.con) e2:SetTarget(s.tglimit) e2:SetValue(aux.tgoval) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_EQUIP) e3:SetCountLimit(1,id) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_series={SET_NOBLE_KNIGHT,SET_NOBLE_ARMS} function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_NOBLE_KNIGHT) end function s.con(e) return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) end function s.atlimit(e,c) return c~=e:GetHandler() and c:IsFaceup() and c:GetAttack()<1800 end function s.tglimit(e,c) return c~=e:GetHandler() and c:GetAttack()<1800 end function s.descon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsSetCard,1,nil,SET_NOBLE_ARMS) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsFaceup() end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Tribute 1 Winged Beast monster, then target 2 cards on the field; destroy them.
--ゴッドバードアタック --Icarus Attack local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) return true end function s.spcheck(sg,tp,exg,dg) local a=0 for c in aux.Next(sg) do if dg:IsContains(c) then a=a+1 end for tc in aux.Next(c:GetEquipGroup()) do if dg:IsContains(tc) then a=a+1 end end end return #dg-a>=2 end function s.cfilter(c) return c:IsRace(RACE_WINGEDBEAST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end local dg=Duel.GetMatchingGroup(Card.IsCanBeEffectTarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),e) if chk==0 then if e:GetLabel()==1 then e:SetLabel(0) return Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,s.spcheck,nil,dg) else return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end end if e:GetLabel()==1 then e:SetLabel(0) local sg=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,s.spcheck,nil,dg) Duel.Release(sg,REASON_COST) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,2,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(Card.IsRelateToEffect,nil,e) Duel.Destroy(sg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this face-up card is removed from your side of the field, destroy "Andro Sphinx" and "Sphinx Teleia" on your side of the field and remove them from play.
--光のピラミッド --Pyramid of Light 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) --Register when this card leaves the field local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_LEAVE_FIELD_P) e2:SetOperation(s.checkop) c:RegisterEffect(e2) --Destroy and banish "Andro Sphinx" and "Sphinx Teleia you control local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetOperation(s.desop) e3:SetLabelObject(e2) c:RegisterEffect(e3) end s.listed_names={15013468,51402177} --"Andro Sphinx","Sphinx Teleia function s.checkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and not c:IsDisabled() then e:SetLabel(1) else e:SetLabel(0) end end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if e:GetLabelObject():GetLabel()==1 and c:IsPreviousControler(tp) then local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsCode,15013468,51402177),tp,LOCATION_ONFIELD,0,nil) if #g>0 then Duel.Hint(HINT_CARD,1-tp,id) Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned if you control a Level 5 or higher monster. When this card is Normal Summoned: You can target 1 monster with 0 DEF in your Graveyard; Special Summon that target in face-up Defense Position. Its effects are negated. You cannot Special Summon any other monsters, except from the Extra Deck, during the turn you activate this effect.
--カメンレオン --Masked Chameleon local s,id=GetID() function s.initial_effect(c) --cannot summon local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_SUMMON) e1:SetCondition(s.sumcon) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end function s.counterfilter(c) return c:IsSummonLocation(LOCATION_EXTRA) end function s.cfilter(c) return c:IsFaceup() and c:IsLevelAbove(5) end function s.sumcon(e) return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local fid=e:GetHandler():GetFieldID() e:SetLabel(fid) 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:SetLabel(fid) e1:SetTarget(s.sumlimit) Duel.RegisterEffect(e1,tp) aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,1),nil) --lizard check aux.addTempLizardCheck(e:GetHandler(),tp) end function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) return e:GetLabel()~=se:GetLabel() and not c:IsLocation(LOCATION_EXTRA) end function s.filter(c,e,tp) return c:IsDefenseBelow(0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) 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) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then 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=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute 1 Cyberse monster; Special Summon 1 "Mathmech" monster from your Deck. If this card is sent to the GY: You can target 1 Cyberse monster you control in the Extra Monster Zone; it can make up to 2 attacks on monsters during each Battle Phase this turn. You can only use each effect of "Mathmech Nabla" once per turn.
--斬機ナブラ --Mathmech Nabla --Scripted by Eerie Code 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_MZONE) e1:SetCountLimit(1,id) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --double attack 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_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.atkcon) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end s.listed_series={SET_MATHMECH} function s.costfilter(c,tp) return c:IsRace(RACE_CYBERSE) and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup()) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_MATHMECH) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,nil,nil,tp) end local sg=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,nil,nil,tp) Duel.Release(sg,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return 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.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() or Duel.IsBattlePhase() end function s.atkfilter(c) return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsInExtraMZone(tp) and s.atkfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_EMZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_EMZONE,0,1,1,nil) end function s.atkop(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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(1) tc:RegisterEffect(e1) tc:RegisterFlagEffect(0,RESETS_STANDARD_PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a monster(s) is Summoned: Destroy all monsters on the field.
--激流葬 --Torrential Tribute local s,id=GetID() function s.initial_effect(c) --Activate(summon) local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) e2:SetTarget(s.target) e2:SetOperation(s.activate) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_ACTIVATE) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetTarget(s.target) e3:SetOperation(s.activate) c:RegisterEffect(e3) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(aux.TRUE,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(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end end