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:
Reveal 1 monster in your hand and send 1 Level 8 Fusion Monster from your Extra Deck to the GY with the same Type that has 2500 ATK or DEF, then you can apply this effect. ● Discard the revealed monster, and if you do, add 1 "Fallen of Albaz", or 1 monster that mentions it, from your Deck to your hand. During the End Phase, if a Fusion Monster was sent to your GY this turn: You can add this card from the GY to your hand. You can only use 1 "Branded in High Spirits" effect per turn, and only once that turn.
--烙印の気炎 --Branded in High Spirits --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Send to GY, discard, and search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_HANDES+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --Add self 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_PHASE+PHASE_END) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) --Check for Fusion Monsters sent to the GY aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_TO_GRAVE) ge1:SetOperation(s.checkop) Duel.RegisterEffect(ge1,0) end) end s.listed_names={CARD_ALBAZ} function s.checkop(e,tp,eg,ep,ev,re,r,rp) for tc in aux.Next(eg) do if tc:IsType(TYPE_FUSION) then Duel.RegisterFlagEffect(tc:GetControler(),id,RESET_PHASE|PHASE_END,0,1) end end end function s.revfilter(c,tp) return c:IsMonster() and not c:IsPublic() and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_EXTRA,0,1,nil,c:GetRace()) end function s.tgfilter(c,race) return c:IsLevel(8) and c:IsType(TYPE_FUSION) and (c:IsAttack(2500) or c:IsDefense(2500)) and c:IsRace(race) and c:IsAbleToGrave() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.revfilter,tp,LOCATION_HAND,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thfilter(c) return (c:IsCode(CARD_ALBAZ) or (c:IsMonster() and c:ListsCode(CARD_ALBAZ))) and c:IsAbleToHand() end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local rg=Duel.SelectMatchingCard(tp,s.revfilter,tp,LOCATION_HAND,0,1,1,nil,tp) if #rg==0 then return end Duel.ConfirmCards(1-tp,rg) Duel.ShuffleHand(tp) local cc=rg:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil,cc:GetRace()) if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_GRAVE) and cc:IsDiscardable(REASON_EFFECT) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() if Duel.SendtoGrave(cc,REASON_EFFECT|REASON_DISCARD)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local hg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #hg>0 then Duel.SendtoHand(hg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,hg) end end end end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFlagEffect(tp,id)>0 end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Cannot be Normal Summoned/Set. Must be Special Summoned by a card effect during your Main Phase 1, cannot be Special Summoned by other ways, and cannot be Special Summoned if you have Special Summoned this turn. Twice per turn, this card cannot be destroyed by battle. Each turn, the turn player can only Special Summon a number of times up to their number of attacks conducted (and reached the Damage Step) this turn.
--放電ムスタンガン --Zap Mustung local s,id=GetID() function s.initial_effect(c) c:EnableUnsummonable() --splimit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(s.splimit) 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_COUNT) e2:SetCountLimit(2) e2:SetValue(s.valcon) 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,1) e3:SetTarget(s.limittg) c:RegisterEffect(e3) --counter local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_LEFT_SPSUMMON_COUNT) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetTargetRange(1,0) e4:SetCondition(s.countcon1) e4:SetValue(s.countval) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCondition(s.countcon2) e5:SetTargetRange(0,1) c:RegisterEffect(e5) end function s.splimit(e,se,sp,st) return se:IsHasType(EFFECT_TYPE_ACTIONS) and Duel.GetActivityCount(e:GetHandlerPlayer(),ACTIVITY_SPSUMMON)==0 and Duel.IsPhase(PHASE_MAIN1) and Duel.GetTurnPlayer()==e:GetHandlerPlayer() end function s.valcon(e,re,r,rp) return (r&REASON_BATTLE)~=0 end function s.limittg(e,c,tp) return Duel.IsTurnPlayer(tp) and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)>=Duel.GetBattledCount(tp) end function s.countcon1(e) return Duel.GetTurnPlayer()==e:GetHandlerPlayer() end function s.countcon2(e) return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() end function s.countval(e,re,tp) local t1=Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON) local t2=Duel.GetBattledCount(tp) if t1>=t2 then return 0 else return t2-t1 end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card's name becomes "Cyber Dragon" while on the field or in the GY. If you Normal or Special Summon "Cyber Dragon", except during the Damage Step: You can Special Summon this card from your hand in Defense Position. You can only use this effect of "Cyber Dragon Vier" once per turn. Each "Cyber Dragon" you control gains 500 ATK/DEF.
--サイバー・ドラゴン・フィーア --Cyber Dragon Vier --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) --code local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE|LOCATION_GRAVE) e1:SetValue(CARD_CYBER_DRAGON) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --atk/def local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(LOCATION_MZONE,0) e4:SetTarget(aux.TargetBoolFunction(Card.IsCode,CARD_CYBER_DRAGON)) e4:SetValue(500) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e5) end s.listed_names={CARD_CYBER_DRAGON} function s.cfilter(c,tp) return c:IsFaceup() and c:IsCode(CARD_CYBER_DRAGON) and c:IsSummonPlayer(tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,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 local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Warrior Tuner + 1+ non-Tuner "Six Samurai" monsters Once per turn, when your opponent activates a Spell/Trap Card (Quick Effect): You can negate the activation, and if you do, destroy it. If this card on the field would be destroyed by battle or card effect, you can destroy another "Six Samurai" monster you control instead.
--真六武衆-シエン --Legendary Six Samurai - Shi En local s,id=GetID() function s.initial_effect(c) --Synchro summon Synchro.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_WARRIOR),1,1,Synchro.NonTunerEx(Card.IsSetCard,SET_SIX_SAMURAI),1,99) c:EnableReviveLimit() --Negate activation local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCode(EVENT_CHAINING) e1:SetCondition(s.discon) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) --Destruction replacement local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DESTROY_REPLACE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetTarget(s.desreptg) e2:SetOperation(s.desrepop) c:RegisterEffect(e2) end s.listed_series={SET_SIX_SAMURAI} function s.discon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) end function s.distg(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.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end function s.repfilter(c,e) return c:IsFaceup() and c:IsSetCard(SET_SIX_SAMURAI) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED) end function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsOnField() and c:IsFaceup() and Duel.IsExistingMatchingCard(s.repfilter,tp,LOCATION_MZONE,0,1,c,e) end if Duel.SelectEffectYesNo(tp,c,96) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local g=Duel.SelectMatchingCard(tp,s.repfilter,tp,LOCATION_MZONE,0,1,1,c,e) e:SetLabelObject(g:GetFirst()) g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true) return true else return false end end function s.desrepop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() tc:SetStatus(STATUS_DESTROY_CONFIRMED,false) Duel.Destroy(tc,REASON_EFFECT|REASON_REPLACE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute this card; Special Summon 2 "Bujin" monsters of 2 different Types from the Deck in Defense Position, except "Bujin Torifune". When you Xyz Summon a "Bujin" Xyz Monster, while this card is in your GY: You can equip this card to it. Any monster destroyed by battle with that equipped monster is banished. You can only use each effect of "Bujin Torifune" once per turn.
--武神-トリフネ --Bujin Torifune --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Special summon 2 "Bujin" monsters from deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.SelfTribute) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Equip itself from GY to 1 "Bujin" Xyz monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.eqcon) e2:SetTarget(s.eqtg) e2:SetOperation(s.eqop) c:RegisterEffect(e2) --Banish any monster destroyed by the equipped monster local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT) e3:SetValue(LOCATION_REMOVED) c:RegisterEffect(e3) end --Lists "Bujin" archetype s.listed_series={SET_BUJIN} --Check for "Bujin" monsters, except "Bujin Torifune" function s.spfilter(c,e,tp) return c:IsSetCard(SET_BUJIN) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end --The 2 "Bujin" monsters have different types from each other function s.spcheck(sg,e,tp,mg) return sg:GetClassCount(Card.GetRace)==#sg end --Activation legality function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if e:GetHandler():GetSequence()<5 then ft=ft+1 end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) return ft>1 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and g:GetClassCount(Card.GetRace)>=2 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end --Special summon 2 "Bujin" monsters from deck function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp) if #g>=2 and g:GetClassCount(Card.GetRace)>=2 then local sg=aux.SelectUnselectGroup(g,e,tp,2,2,s.spcheck,1,tp,HINTMSG_SPSUMMON) if sg then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end end --Check if a "Bujin" Xyz mosnter was Xyz summoned function s.eqcfilter(c,tp) return c:IsSetCard(SET_BUJIN) and c:IsType(TYPE_XYZ) and c:IsXyzSummoned() and c:IsSummonPlayer(tp) end --If it ever happened function s.eqcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.eqcfilter,1,nil,tp) end --Activation legality function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if not eg then return false end local tc=eg:GetFirst() if chkc then return false end if chk==0 then return tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end --Equip itself from GY to 1 "Bujin" Xyz monster function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=eg:GetFirst() if tc:IsFaceup() and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then Duel.Equip(tp,c,tc,true) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) c:RegisterEffect(e1) end end function s.eqlimit(e,c) return c==e:GetLabelObject() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This Attack Position card cannot be destroyed by battle. If this card is attacked, change it to Defense Position at the end of the Damage Step. During the Standby Phase, if this card is in Defense Position: You can Special Summon 1 "Dinowrestler Capoeiraptor" from your Deck. You can only use this effect of "Dinowrestler Capoeiraptor" once per turn.
--ダイナレスラー・カポエラプトル --Dinowrestler Capoeiraptor --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Cannot be destroyed by battle local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCondition(s.indcond) e1:SetValue(1) c:RegisterEffect(e1) --Change battle position local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetCondition(s.poscon) e2:SetOperation(s.posop) c:RegisterEffect(e2) --Special Summon 1 "Dinowrestler Capoeiraptor" from the Deck local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_PHASE|PHASE_STANDBY) e3:SetCountLimit(1,id) e3:SetCondition(function(e) return e:GetHandler():IsDefensePos() end) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_names={id} function s.indcond(e) return e:GetHandler():IsAttackPos() end function s.poscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler()==Duel.GetAttackTarget() and e:GetHandler():IsRelateToBattle() end function s.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsAttackPos() then Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end end function s.spfilter(c,e,tp) return 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:
Target 1 face-up Level 4 or lower "Wind-Up" monster you control: Return that target to the hand (no matter its Level), then Special Summon 1 "Wind-Up" monster from the hand with the same Level as the returned monster's.
--発条の巻き戻し --Zenmairch local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetTarget(s.target) e1:SetOperation(s.activate) 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:IsLevelBelow(4) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spfilter(c,lv,e,tp) return c:IsSetCard(SET_WIND_UP) and c:IsLevel(lv) 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 and tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then Duel.ShuffleHand(tc:GetControler()) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,tc:GetLevel(),e,tp) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ "Gouki" monsters If a monster(s) this card points to is destroyed by battle or card effect: You can make this card gain 400 ATK. The turn player applies the following effect while this monster is on the field. ● During their Main Phase, they can Normal Summon 1 monster from their hand to their zone this card points to, in addition to their Normal Summon/Set. (They can only gain this effect once per turn.)
--剛鬼サンダー・オーガ --Gouki Thunder Ogre local s,id=GetID() function s.initial_effect(c) --link summon Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_GOUKI),2) c:EnableReviveLimit() --extra summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetDescription(aux.Stringid(id,0)) e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND) e1:SetValue(s.sumval) c:RegisterEffect(e1) --atk local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetRange(LOCATION_MZONE) e3:SetCondition(s.atkcon) e3:SetOperation(s.atkop) c:RegisterEffect(e3) end s.listed_series={SET_GOUKI} function s.sumval(e,c) if c:IsControler(e:GetHandlerPlayer()) then local sumzone=e:GetHandler():GetLinkedZone() local relzone=-(1<<e:GetHandler():GetSequence()) return 0,sumzone,relzone else local sumzone=e:GetHandler():GetLinkedZone(1-e:GetHandlerPlayer()) local relzone=-(1<<e:GetHandler():GetSequence()+16) return 0,sumzone,relzone end end function s.cfilter(c,tp,zone) local seq=c:GetPreviousSequence() if not c:IsPreviousControler(tp) then seq=seq+16 end return c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0 end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp,e:GetHandler():GetLinkedZone()) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetValue(400) e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE) c:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can either: Target 1 LIGHT Machine monster you control; equip this card to that target, OR: Unequip this card and Special Summon it. A monster equipped with this card is unaffected by your opponent's monster effects (except its own), also if the equipped monster would be destroyed by battle or card effect, destroy this card instead. If this card is sent from the field to the GY: You can add 1 other Union monster from your GY to your hand.
--A-アサルト・コア --A-Assault Core local s,id=GetID() function s.initial_effect(c) aux.AddUnionProcedure(c,s.unfilter) --immune local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetValue(s.efilter) c:RegisterEffect(e1) --to hand local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.thcon) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end function s.unfilter(c) return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) end function s.efilter(e,te) return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:GetOwner()~=e:GetOwner() and te:IsMonsterEffect() end function s.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.thfilter(c) return c:IsType(TYPE_UNION) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a Plant Normal Monster: You can Special Summon this card from your hand. You can banish this card from your GY, then target 1 linked Link-2 or lower "Sunavalon" or "Sunvine" monster you control; Special Summon 1 monster with the same name from your Extra Deck, but negate its effects, also you cannot Special Summon for the rest of this turn, except Plant monsters. You can only use each effect of "Sunseed Shadow" once per turn.
--聖種の影芽 --Sunseed Shadow --Scripted by Eerie Code, anime script by Playmaker 772211 and Larry126 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:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --special summon copy from extra local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,{id,1}) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.spextg) e2:SetOperation(s.spexop) c:RegisterEffect(e2) end function s.spfilter(c) return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsRace(RACE_PLANT) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_MZONE,0,1,nil) 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 not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.filter1(c,e,tp) return c:IsLinkMonster() and c:IsLinkBelow(2) and c:IsLinked() and c:IsSetCard({SET_SUNAVALON,SET_SUNVINE}) and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode()) end function s.filter2(c,e,tp,code) return c:IsLinkMonster() and c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spextg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter1(chkc,e,tp) end if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA) end function s.spexop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.GetLocationCountFromEx(tp)>0 then local code=tc:GetCode() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,code):GetFirst() if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT|RESETS_STANDARD) sc:RegisterEffect(e2) Duel.SpecialSummonComplete() end end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,2)) 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 function s.splimit(e,c,tp,sumtp,sumpos) return not c:IsRace(RACE_PLANT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is destroyed by battle with an opponent's monster: You can take control of that opponent's monster, and if you do, it becomes a Zombie monster, also its ATK/DEF become 0. When your Zombie monster is destroyed by battle with an opponent's monster, while this card is in your GY: You can banish this card; take control of that opponent's monster, and if you do, it becomes a Zombie monster, also its ATK/DEF become 0. You can only use this effect of "Devouring Sarcoughagus" once per turn.
--死製棺サルコファガス --Devouring Sarcoughagus --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Take control when self is destroyed by battle local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetCondition(s.ctcon) e1:SetTarget(s.cttg) e1:SetOperation(s.ctop) c:RegisterEffect(e1) --Take control when another Zombie is destroyed by battle local e2=e1:Clone() e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.gctcon) e2:SetCost(Cost.SelfBanish) c:RegisterEffect(e2) end function s.ctcon(e,tp,eg,ep,ev,re,r,rp) e:SetLabelObject(e:GetHandler()) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsStatus(STATUS_OPPO_BATTLE) and bc and bc:IsAbleToChangeControler() end function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk) local tc=e:GetLabelObject():GetReasonCard() if chk==0 then return tc:IsRelateToBattle() end Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0) end function s.ctop(e,tp,eg,ep,ev,re,r,rp) local dc=e:GetLabelObject() if not dc then return end local tc=dc:GetBattleTarget() if tc and tc:IsControler(1-tp) and Duel.GetControl(tc,tp) then --Treat as Zombie local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_RACE) e1:SetValue(RACE_ZOMBIE) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) --ATK/DEF becomes 0 local e2=e1:Clone() e2:SetCode(EFFECT_SET_ATTACK_FINAL) e2:SetValue(0) tc:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_SET_DEFENSE_FINAL) tc:RegisterEffect(e3) end end function s.ctconfilter(c,tp) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousRaceOnField()&RACE_ZOMBIE~=0 and c:IsStatus(STATUS_OPPO_BATTLE) and c:GetBattleTarget():IsAbleToChangeControler() end function s.gctcon(e,tp,eg,ep,ev,re,r,rp) if not eg or eg:IsContains(e:GetHandler()) then return false end local g=eg:Filter(s.ctconfilter,nil,tp) e:SetLabelObject(g:GetFirst()) return #g>0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is removed from play, you can send 1 card from your hand to the Graveyard to draw 1 card.
--サイバー・ウロボロス --Cyber Ouroboros 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:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_REMOVE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end 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:
If this card is in your GY: You can place 1 card from your hand on the top of the Deck; Special Summon this card in Defense Position. You can only use this effect of "Edge Imp Sabres" once per turn.
--エッジインプ・シザー --Edge Imp Sabres local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCountLimit(1,id) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoDeck(g,nil,SEQ_DECKTOP,REASON_COST) 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,POS_FACEUP_DEFENSE) 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 c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: Special Summon 1 "Ivy Token" (Plant-Type/EARTH/Level 1/ATK 0/DEF 0) in Defense Position to your opponent's side of the field. When this Token is destroyed, its controller takes 300 damage.
--アイヴィ・ウォール --Wall of Ivy local s,id=GetID() function s.initial_effect(c) --token local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetType(EFFECT_TYPE_FLIP+EFFECT_TYPE_SINGLE) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_names={30069399} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPES_TOKEN,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE,1-tp) then return end local token=Duel.CreateToken(tp,id+1) if Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_LEAVE_FIELD) e1:SetOperation(s.damop) token:RegisterEffect(e1,true) end Duel.SpecialSummonComplete() end function s.damop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsReason(REASON_DESTROY) then Duel.Damage(c:GetPreviousControler(),300,REASON_EFFECT) end e:Reset() 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 Graveyard. 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. ● If damage calculation is performed involving this card, at the end of the Battle Phase: You can inflict damage to your opponent equal to this card's original ATK. You can only use this effect of "Red-Eyes Black Flare Dragon" once per turn.
--真紅眼の黒炎竜 --Red-Eyes Black Flare Dragon local s,id=GetID() function s.initial_effect(c) Gemini.AddProcedure(c) --Inflict damage equal to ATK local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_PHASE|PHASE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) 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) return Gemini.EffectStatusCondition(e) and e:GetHandler():GetBattledGroupCount()>0 end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local atk=e:GetHandler():GetBaseAttack() Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) end function s.damop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then local atk=c:GetBaseAttack() Duel.Damage(1-tp,atk,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Level 7 "Red-Eyes" monster + 1 Level 6 Dragon monster If this card is Fusion Summoned: You can send 1 "Red-Eyes" monster from your hand or Deck to the GY, and if you do, inflict damage to your opponent equal to half the original ATK of that monster. If this card is sent from the Monster Zone to the GY: You can target 1 Normal Monster in your GY; Special Summon it.
--流星竜メテオ・ブラック・ドラゴン --Meteor Black Comet Dragon local s,id=GetID() function s.initial_effect(c) --fusion material Fusion.AddProcMix(c,true,true,s.mfilter1,s.mfilter2) c:EnableReviveLimit() --damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.damcon) e1:SetTarget(s.damtg) e1:SetOperation(s.damop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.material_setcode=SET_RED_EYES function s.mfilter1(c,fc,sumtype,tp) return c:IsSetCard(SET_RED_EYES,fc,sumtype,tp) and c:GetLevel()==7 end function s.mfilter2(c,fc,sumtype,tp) return c:IsRace(RACE_DRAGON,fc,sumtype,tp) and c:GetLevel()==6 end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsFusionSummoned() end function s.damfilter(c,fc,tp) return c:IsSetCard(SET_RED_EYES,fc,SUMMON_TYPE_FUSION,tp) and c:GetBaseAttack()>0 and c:IsAbleToGrave() end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.damfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e:GetHandler(),tp) end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end function s.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.damfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e:GetHandler(),tp) local tc=g:GetFirst() if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then Duel.Damage(1-tp,math.ceil(g:GetFirst():GetBaseAttack()/2),REASON_EFFECT) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) end function s.spfilter(c,e,tp) return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] During your Main Phase: You can Special Summon this card, then you can attach 1 DARK monster from your GY to this card as material. You can only use this effect of "Odd-Eyes Rebellion Xyz Dragon" once per turn. ---------------------------------------- [ Monster Effect ] 2 Level 7 Pendulum Monsters If you can Pendulum Summon Level 7, you can Pendulum Summon this face-up card from your Extra Deck. This card cannot be used as material for an Xyz Summon the turn it was Xyz Summoned. You can detach 1 material from this card, then target up to 2 monsters your opponent controls with 3000 or less ATK; destroy them. You can only use this effect of "Odd-Eyes Rebellion Xyz Dragon" once per turn. If this card in the Monster Zone is destroyed: You can place this card in your Pendulum Zone.
--覇王黒竜オッドアイズ・リベリオン・エクシーズ・ドラゴン --Odd-Eyes Rebellion Xyz Dragon --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() Pendulum.AddProcedure(c,false) --2 Level 7 Pendulum monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_PENDULUM),7,2) --Special Summon this card local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_LEAVE_GRAVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Cannot be used as Xyz material the turn it is Xyz Summoned local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) e2:SetCondition(s.matcon) e2:SetValue(1) c:RegisterEffect(e2) --Destroy up to 2 monsters with 3000 or less ATK local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCost(Cost.DetachFromSelf(1,1)) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) --Place this card in the Pendulum Zone local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCode(EVENT_DESTROYED) e4:SetCondition(s.pencon) e4:SetTarget(s.pentg) e4:SetOperation(s.penop) c:RegisterEffect(e4) end s.pendulum_level=7 function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetPossibleOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE) end function s.ovfilter(c,xc,tp) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsCanBeXyzMaterial(xc,tp,REASON_EFFECT) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.ovfilter),tp,LOCATION_GRAVE,0,nil,c,tp) if #g==0 or not Duel.SelectYesNo(tp,aux.Stringid(id,3)) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTACH) local og=g:Select(tp,1,1,nil) if #og>0 then Duel.BreakEffect() Duel.Overlay(c,og) end end function s.matcon(e) local c=e:GetHandler() return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsXyzSummoned() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() and chkc:IsAttackBelow(3000) end if chk==0 then return Duel.IsExistingTarget(aux.FaceupFilter(Card.IsAttackBelow,3000),tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.FaceupFilter(Card.IsAttackBelow,3000),tp,0,LOCATION_MZONE,1,2,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.GetTargetCards(e) if #g>0 then Duel.Destroy(g,REASON_EFFECT) end end function s.pencon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() end function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckPendulumZones(tp) end end function s.penop(e,tp,eg,ep,ev,re,r,rp) if not Duel.CheckPendulumZones(tp) then return end local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 4 monsters You can detach 1 material from this card; send the top 3 cards of your Deck to the GY, then draw cards equal to the number of "Lightsworn" cards sent to the GY by this effect. If this card is destroyed by battle, or if this card in its owner's possession is destroyed by an opponent's card effect: You can send the top 3 cards of your Deck to the GY, then you can destroy cards on the field up to the number of "Lightsworn" cards sent to the GY by this effect. You can only use each effect of "Minerva, the Exalted Lightsworn" once per turn.
--ライトロード・セイント ミネルバ --Minerva, the Exalted Lightsworn local s,id=GetID() function s.initial_effect(c) --xyz summon Xyz.AddProcedure(c,nil,4,2) c:EnableReviveLimit() --discard deck & draw local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DECKDES+CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.distg) e1:SetOperation(s.drop) c:RegisterEffect(e1) --discard deck & destroy local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DECKDES+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.descon) e2:SetTarget(s.distg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end s.listed_series={SET_LIGHTSWORN} function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(3) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) end function s.cfilter(c) return c:IsSetCard(SET_LIGHTSWORN) and c:IsLocation(LOCATION_GRAVE) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.DiscardDeck(p,d,REASON_EFFECT) local g=Duel.GetOperatedGroup() local ct=g:FilterCount(s.cfilter,nil) if ct>0 then Duel.BreakEffect() Duel.Draw(tp,ct,REASON_EFFECT) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_BATTLE) or (rp~=tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp)) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.DiscardDeck(p,d,REASON_EFFECT) local g=Duel.GetOperatedGroup() local ct=g:FilterCount(s.cfilter,nil) local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if ct~=0 and #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local sdg=dg:Select(tp,1,ct,nil) Duel.HintSelection(sdg) Duel.Destroy(sdg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card you control is destroyed by battle or card effect and sent to your Graveyard: You can Special Summon 1 "Yang Zing" monster from your Deck in Defense Position, except "Suanni, Fire of the Yang Zing". You can only use this effect of "Suanni, Fire of the Yang Zing" once per turn. Once per turn, during your opponent's Main Phase or Battle Phase, you can: Immediately after this effect resolves, Synchro Summon 1 Synchro Monster, using only "Yang Zing" monsters you control (this is a Quick Effect). A Synchro Monster that used this card as a Synchro Material gains 500 ATK and DEF.
--炎竜星-シュンゲイ --Suanni, Fire of the Yang Zing 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:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_TO_GRAVE) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --synchro effect local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetHintTiming(0,TIMING_BATTLE_START|TIMING_BATTLE_END) e2:SetCountLimit(1) e2:SetCondition(s.sccon) e2:SetTarget(s.sctg) e2:SetOperation(s.scop) c:RegisterEffect(e2) --effect gain local e3=Effect.CreateEffect(c) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_BE_MATERIAL) e3:SetCondition(s.atkcon) e3:SetOperation(s.atkop) c:RegisterEffect(e3) end s.listed_series={SET_YANG_ZING} s.listed_names={id} function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp) end function s.filter(c,e,tp) return c:IsSetCard(SET_YANG_ZING) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return 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.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end function s.sccon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) and (Duel.IsMainPhase() or Duel.IsBattlePhase()) end function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_YANG_ZING),tp,LOCATION_MZONE,0,nil) return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.scop(e,tp,eg,ep,ev,re,r,rp) local mg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsSetCard,SET_YANG_ZING),tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg) end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_SYNCHRO end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetReset(RESET_EVENT|RESETS_STANDARD) rc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) rc:RegisterEffect(e2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a Cyberse monster you control would be used as Link Material for a "Code Talker" monster, this card in your hand can also be used as material. If this card is sent from the hand or field to the GY as material for the Link Summon of a "Code Talker" monster: You can send 1 Cyberse monster with 1200 or less ATK from your Deck to the GY, or, if this card on the field was used as material, you can add that card to your hand instead. You can only use each effect of "Code Generator" once per turn.
--コード・ジェネレーター --Code Generator --Scripted by AlphaKretin, extra material by edo9300 local s,id=GetID() function s.initial_effect(c) --If a Cyberse monster you control would be used as Link Material for a "Code Talker" monster, this card in your hand can also be used as material local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_EXTRA_MATERIAL) e1:SetRange(LOCATION_HAND) e1:SetTargetRange(1,0) e1:SetOperation(s.extracon) e1:SetValue(s.extraval) c:RegisterEffect(e1) if s.flagmap==nil then s.flagmap={} end if s.flagmap[c]==nil then s.flagmap[c] = {} end --Send 1 Cyberse monster with 1200 or less ATK from your Deck to the GY, or, if this card on the field was used as material, you can add that card to your hand instead local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCountLimit(1,id) e2:SetCondition(s.tgcon) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end s.listed_series={SET_CODE_TALKER} function s.extrafilter(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) end function s.extracon(c,e,tp,sg,mg,lc,og,chk) return (sg+mg):Filter(s.extrafilter,nil,e:GetHandlerPlayer()):IsExists(Card.IsRace,1,og,RACE_CYBERSE) and sg:FilterCount(Card.HasFlagEffect,nil,id)<2 end function s.extraval(chk,summon_type,e,...) local c=e:GetHandler() if chk==0 then local tp,sc=... if summon_type~=SUMMON_TYPE_LINK or not sc:IsSetCard(SET_CODE_TALKER) or Duel.HasFlagEffect(tp,id) then return Group.CreateGroup() else table.insert(s.flagmap[c],c:RegisterFlagEffect(id,0,0,1)) return Group.FromCards(c) end elseif chk==1 then local sg,sc,tp=... if summon_type&SUMMON_TYPE_LINK==SUMMON_TYPE_LINK and #sg>0 then Duel.Hint(HINT_CARD,tp,id) Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1) end elseif chk==2 then for _,eff in ipairs(s.flagmap[c]) do eff:Reset() end s.flagmap[c]={} end end function s.tgcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_HAND|LOCATION_ONFIELD) and r==REASON_LINK and c:GetReasonCard():IsSetCard(SET_CODE_TALKER) end function s.tgfilter(c,tohand_chk) return c:IsRace(RACE_CYBERSE) and c:IsAttackBelow(1200) and (c:IsAbleToGrave() or (tohand_chk==1 and c:IsAbleToHand())) end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) local tohand_chk=e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,tohand_chk) end e:SetLabel(tohand_chk and 1 or 0) if not tohand_chk then Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) else Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local tohand_chk=e:GetLabel()==1 local hint_msg=(tohand_chk and aux.Stringid(id,1) or HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,hint_msg) local sc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel()):GetFirst() if not sc then return end if tohand_chk then aux.ToHandOrElse(sc,tp) else Duel.SendtoGrave(sc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 "Appliancer" monster Cannot be used as Link Material the turn it is Link Summoned. Can attack directly while it is not co-linked. You can send 1 card from your hand to the GY, then target 1 card your opponent controls; destroy it. If this card is co-linked: You can target 1 monster in your opponent's Main Monster Zone; destroy it. You can only use 1 "Appliancer Vacculephant" effect per turn, and only once that turn.
--掃除機塊バキューネシア --Appliancer Vacculephant --Anime version scripted by pyrQ, updated by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Link Summon c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_APPLIANCER),1) --Cannot be Link Material local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e1:SetCondition(s.lkcon) e1:SetValue(1) c:RegisterEffect(e1) --Can attack directly while it is not co-linked local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DIRECT_ATTACK) e2:SetCondition(s.dacon) c:RegisterEffect(e2) --Destroy monster if co-linked local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetCondition(s.descon) e3:SetTarget(s.destg1) e3:SetOperation(s.desop) c:RegisterEffect(e3) --Destroy 1 card the opponent controls local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_DESTROY) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,id) e4:SetCost(s.descost) e4:SetTarget(s.destg2) e4:SetOperation(s.desop) c:RegisterEffect(e4) end s.listed_series={SET_APPLIANCER} function s.lkcon(e) local c=e:GetHandler() return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsLinkSummoned() end function s.dacon(e) return e:GetHandler():GetMutualLinkedGroupCount()==0 end function s.descon(e,tp,eg,ep,ev,re,r,rp,chk) return e:GetHandler():GetMutualLinkedGroupCount()>0 end function s.destg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MMZONE) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MMZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MMZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,LOCATION_MZONE) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,LOCATION_ONFIELD) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Special Summon this card (from your hand) by sending 1 other monster from your hand to the GY, but this card loses 500 ATK. You can only Special Summon "Todoroki the Earthbolt Star" once per turn this way. During the Battle Phase (Quick Effect): You can pay 500 LP; Fusion Summon 1 Warrior Fusion Monster from your Extra Deck, using monsters from your hand or field as material. You can only use this effect of "Todoroki the Earthbolt Star" once per turn.
--地雷星トドロキ --Todoroki the Earthbolt Star --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special summon itself from the hand but decrease ATK by 500 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:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Fusion Summon 1 Warrior monster local params = {aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR)} local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) local TIMING_BATTLE_START_END=TIMING_BATTLE_START|TIMING_BATTLE_END e2:SetHintTiming(TIMING_BATTLE_START_END,TIMINGS_CHECK_MONSTER|TIMING_BATTLE_START_END) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function() return Duel.IsBattlePhase() end) e2:SetCost(Cost.PayLP(500)) e2:SetTarget(Fusion.SummonEffTG(table.unpack(params))) e2:SetOperation(Fusion.SummonEffOP(table.unpack(params))) c:RegisterEffect(e2) end function s.spfilter(c) return c:IsMonster() and c:IsAbleToGraveAsCost() end function s.spcon(e,c) if c==nil then return true end local tp=e:GetHandlerPlayer() local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,c) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #rg>0 and aux.SelectUnselectGroup(rg,e,tp,1,1,nil,0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local c=e:GetHandler() local g=nil local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND,0,c) local g=aux.SelectUnselectGroup(rg,e,tp,1,1,nil,1,tp,HINTMSG_TOGRAVE,nil,nil,true) if #g>0 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.SendtoGrave(g,REASON_COST) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-500) e1:SetReset(RESET_EVENT|(RESETS_STANDARD_DISABLE&~RESET_TOFIELD)) c:RegisterEffect(e1) g:DeleteGroup() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a Cyberse monster that was Special Summoned from the Extra Deck: You can Special Summon this card from your hand. If this card is Normal or Special Summoned: You can add 1 DARK Cyberse monster from your Deck to your hand, except "Backup @Ignister", then discard 1 card. You can only use each effect of "Backup @Ignister" once per turn.
--バックアップ@イグニスター --Backup @Ignister --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Add 1 DARK Cyberse monster from your Deck to your hand, except "Backup @Ignister", then discard 1 card local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) end s.listed_names={id} function s.spconfilter(c) return c:IsRace(RACE_CYBERSE) and c:IsSummonLocation(LOCATION_EXTRA) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,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 function s.thfilter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_CYBERSE) and not c:IsCode(id) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if sc and Duel.SendtoHand(sc,nil,REASON_EFFECT)>0 and sc:IsLocation(LOCATION_HAND) then Duel.ConfirmCards(1-tp,sc) Duel.ShuffleHand(tp) Duel.BreakEffect() Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target Synchro Summoned monster gains 500 ATK for each Synchro Material Monster used to Summon it, until the End Phase.
--シンクロ・ストライク --Synchro Strike 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:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(aux.StatChangeDamageStepCondition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c) return c:IsFaceup() and c:IsSynchroSummoned() and c:GetMaterialCount()~=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_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and s.filter(tc) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e1:SetValue(tc:GetMaterialCount()*500) tc:RegisterEffect(e1) 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 having 5 or more LIGHT monsters with different names in your Graveyard. Once per turn: You can banish 1 LIGHT monster from your Graveyard, then target 1 Set card your opponent controls; reveal that target, then place that target on either the top or bottom of the Deck.
--ライトレイ ディアボロス --Lightray Diabolos 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) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TODECK) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCost(s.tdcost) e2:SetTarget(s.tdtg) e2:SetOperation(s.tdop) c:RegisterEffect(e2) end function s.spcon(e,c) if c==nil then return true end if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end local g=Duel.GetMatchingGroup(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_LIGHT) local ct=g:GetClassCount(Card.GetCode) return ct>4 end function s.cfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.tdcost(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 g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.filter(c) return c:IsFacedown() and c:IsAbleToDeck() end function s.tdtg(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 Duel.IsExistingTarget(s.filter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFacedown() then Duel.ConfirmCards(tp,tc) local opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) Duel.SendtoDeck(tc,nil,opt,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When your opponent Special Summons 2 or more face-up monsters at the same time: Send those monsters to the Graveyard, then send all monsters in the opponent's hand and Deck to the Graveyard that have the same name as the monsters sent to the Graveyard by this effect.
--落とし大穴 --Darkfall local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c,sp,e) return c:IsFaceup() and c:GetSummonPlayer()==sp and (not e or c:IsRelateToEffect(e)) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(s.cfilter,2,nil,1-tp) end local g=eg:Filter(s.cfilter,nil,1-tp) Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(s.cfilter,nil,1-tp,e) Duel.SendtoGrave(g,REASON_EFFECT) local exg=Group.CreateGroup() local g1=Duel.GetOperatedGroup() local tc=g1:GetFirst() for tc in aux.Next(g1) do if tc:IsLocation(LOCATION_GRAVE) then local fg=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_DECK|LOCATION_HAND,nil,tc:GetCode()) exg:Merge(fg) end end Duel.BreakEffect() Duel.SendtoGrave(exg,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 6 monsters While this card has no materials, if it battles a monster, any battle damage it inflicts to your opponent is doubled. You can only use each of the following effects of "Transcendosaurus Drillygnathus" once per turn. You can detach 1 material from this card, then target 1 of your banished Dinosaur monsters; Special Summon it. If this card is destroyed: You can shuffle 1 Normal Monster from your GY into the Deck, then you can Special Summon this card.
--超越竜ドリルグナトゥス --Transcendosaurus Drillygnathus --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon procedure Xyz.AddProcedure(c,nil,6,2) --Double damage when it doesn't have Xyz materials local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e1:SetCondition(s.damcon) e1:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE)) c:RegisterEffect(e1) --Special Summon 1 Dinosaur monster that is banished local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetCost(Cost.DetachFromSelf(1,1,nil)) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Shuffle 1 Normal Monster from your GY into the Deck and Special Summon this card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,{id,1}) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) end function s.damcon(e) local c=e:GetHandler() return c:GetOverlayCount()==0 and c:GetBattleTarget() end function s.spfilter(c,e,tp) return c:IsRace(RACE_DINOSAUR) and c:IsFaceup() 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) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,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 function s.tdfilter(c) return c:IsType(TYPE_NORMAL) and c:IsAbleToDeck() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) if #g==0 then return end Duel.HintSelection(g,true) local c=e:GetHandler() if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_DECK) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.BreakEffect() 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:
During each Standby Phase, if you control a "Borrel" Link Monster: You can target 1 "Rokket" monster in your GY; Special Summon it, but destroy it during the End Phase. You can only use this effect of "Borrel Supplier" once per turn.
--ヴァレル・サプライヤー --Borrel Supplier --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) --Special Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_PHASE|PHASE_STANDBY) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.listed_series={SET_BORREL,SET_ROKKET} function s.cfilter(c) return c:IsFaceup() and c:IsLinkMonster() and c:IsSetCard(SET_BORREL) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.spfilter(c,e,tp) return c:IsSetCard(SET_ROKKET) 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 c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetLabelObject(tc) e1:SetCondition(s.descon) e1:SetOperation(s.desop) tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) Duel.RegisterEffect(e1,tp) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:GetFlagEffect(id)~=0 then return true else e:Reset() return false end 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:
This card becomes an Equip Card, and equips to 1 monster you control. Once per turn, when you inflict damage to your opponent with a card effect, the equipped monster gains 1000 ATK until the End Phase.
--サディスティック・ポーション --Brutal Potion local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCost(aux.RemainFieldCost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsLocation(LOCATION_SZONE) and not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Equip(tp,c,tc) --draw local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_DAMAGE) e1:SetRange(LOCATION_SZONE) e1:SetOperation(s.damop) e1:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e1) --Atkup local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(1000) e2:SetCondition(s.atkcon) e2:SetReset(RESET_EVENT|RESETS_STANDARD) c: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:SetLabelObject(tc) e3:SetReset(RESET_EVENT|RESETS_STANDARD) c:RegisterEffect(e3) else c:CancelToGrave(false) end end function s.eqlimit(e,c) return c==e:GetLabelObject() end function s.atkcon(e) return e:GetHandler():GetFlagEffect(id)~=0 end function s.damop(e,tp,eg,ep,ev,re,r,rp) if r&REASON_EFFECT~=0 and ep~=tp and rp==tp then e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_DISABLE_PHASE_END,0,1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ monsters with the same Type Once per turn, during the Standby Phase: You can target 1 face-up monster this card points to; Special Summon 1 Level 4 or lower monster with the same Type as that monster from your hand to your zone this card points to. At the start of the Battle Phase: You can target 1 card your opponent controls; destroy it. You can only use this effect of "Ra'ten, the Heavenly General" once per turn.
--羅天神将 --Ra'ten, the Heavenly General local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure: 2+ monsters with the same Type Link.AddProcedure(c,nil,2,99,s.lcheck) --Special Summon 1 Level 4 or lower monster with the same Type as a targeted monster from your hand to your zone this card points to 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_CARD_TARGET) e1:SetCode(EVENT_PHASE|PHASE_STANDBY) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Destroy 1 card your opponent controls local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_PHASE|PHASE_BATTLE_START) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) end function s.lcheck(g,lc,sumtype,tp) return g:CheckSameProperty(Card.GetRace,lc,sumtype,tp) end function s.spfilter1(c,e,tp,lg,zone) return c:IsFaceup() and lg:IsContains(c) and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp,c:GetRace(),zone) end function s.spfilter2(c,e,tp,rc,zone) return c:IsLevelBelow(4) and c:IsRace(rc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local lg=e:GetHandler():GetLinkedGroup() local zone=e:GetHandler():GetLinkedZone(tp) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.spfilter1(chkc,e,tp,lg) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 and Duel.IsExistingTarget(s.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,lg,zone) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lg,zone) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tg=Duel.GetFirstTarget() if not c:IsRelateToEffect(e) or not tg:IsRelateToEffect(e) or tg:IsFacedown() then return end local zone=e:GetHandler():GetLinkedZone(tp) if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp,tg:GetRace(),zone):GetFirst() if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone) end end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card can only be placed on the field by the effect of "Destiny Board".
--死のメッセージ「H」 --Spirit Message "L" local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_SSET) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_SPSUMMON_COST) e2:SetCost(s.spcost) c:RegisterEffect(e2) end function s.spcost(e,c,tp,sumtype) return sumtype==SUMMON_TYPE_SPECIAL+181 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, during your Main Phase 1: You can pay 800 LP; this card can attack your opponent directly this turn.
--機動砦のギア・ゴーレム --Gear Golem the Moving Fortress local s,id=GetID() function s.initial_effect(c) --direct attack local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.condition) e1:SetCost(Cost.PayLP(800)) e1:SetOperation(s.operation) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsPhase(PHASE_MAIN1) and e:GetHandler():GetEffectCount(EFFECT_DIRECT_ATTACK)==0 end function s.operation(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) e:GetHandler():RegisterEffect(e1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ Link Monsters If this card is Link Summoned: Draw cards equal to the number of "World Chalice" monsters this card points to. You can only use this effect of "Ningirsu the World Chalice Warrior" once per turn. Once per turn: You can send 1 card from each player's field to the GYs. If this card is sent from the field to the GY: You can Special Summon 1 "World Chalice" monster from your hand.
--星杯戦士ニンギルス --Ningirsu the World Chalice Warrior local s,id=GetID() function s.initial_effect(c) --link summon c:EnableReviveLimit() Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsType,TYPE_LINK),2) --draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCountLimit(1,id) e1:SetCondition(s.drcon) e1:SetTarget(s.drtg) e1:SetOperation(s.drop) c:RegisterEffect(e1) --to grave local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) --spsummon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,2)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_TO_GRAVE) e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetCondition(s.spcon2) e5:SetTarget(s.sptg2) e5:SetOperation(s.spop2) c:RegisterEffect(e5) end s.listed_series={SET_WORLD_CHALICE} function s.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsLinkSummoned() end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local gc=e:GetHandler():GetLinkedGroup():FilterCount(aux.FaceupFilter(Card.IsSetCard,SET_WORLD_CHALICE),nil) Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,gc) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local gc=e:GetHandler():GetLinkedGroup():FilterCount(aux.FaceupFilter(Card.IsSetCard,SET_WORLD_CHALICE),nil) if gc>0 then Duel.Draw(p,gc,REASON_EFFECT) end end function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,0,0) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0 or Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g1=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g2=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) g1:Merge(g2) Duel.SendtoGrave(g1,REASON_EFFECT) end function s.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function s.spfilter2(c,e,tp) return c:IsSetCard(SET_WORLD_CHALICE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.spop2(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.spfilter2,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:
You can Ritual Summon this card with "Black Magic Ritual".
--マジシャン・オブ・ブラックカオス --Magician of Black Chaos local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() end s.listed_names={76792184}
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute 1 other face-up "Gravekeeper's" monster to target 1 card your opponent controls; destroy that target.
--墓守の末裔 --Gravekeeper's Descendant 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_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_GRAVEKEEPERS} function s.costfilter(c) return c:IsFaceup() and c:IsSetCard(SET_GRAVEKEEPERS) end function s.filter(c,e) return c:IsCanBeEffectTarget(e) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local dg=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_ONFIELD,nil,e) if chk==0 then return Duel.CheckReleaseGroupCost(tp,s.costfilter,1,false,aux.ReleaseCheckTarget,e:GetHandler(),dg) end local sg=Duel.SelectReleaseGroupCost(tp,s.costfilter,1,1,false,aux.ReleaseCheckTarget,e:GetHandler(),dg) Duel.Release(sg,REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,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:
Cannot be Normal Summoned/Set. Must be Special Summoned by its own effect. During your opponent's turn (Quick Effect): You can send 1 face-up "Meklord" monster you control to the GY; Special Summon this card from your hand. You can only use this effect of "Meklord Emperor Wisel - Synchro Absorption" once per turn. If this card is Special Summoned: You can target 1 monster your opponent controls; it cannot attack for the rest of this turn. When a card or effect is activated that would destroy a card(s) on the field (Quick Effect): You can Tribute this card; negate the activation, and if you do, destroy that card.
--機皇帝ワイゼル∞-S・アブソープション --Meklord Emperor Wisel - Synchro Absorption --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) 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) e1:SetValue(0) c:RegisterEffect(e1) --Special summon itself from hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetCost(s.spcost) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Make 1 of opponen'ts monsters unable to attack local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetTarget(s.atktg) e3:SetOperation(s.atkop) c:RegisterEffect(e3) --Negate activation local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_CHAINING) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e4:SetRange(LOCATION_MZONE) e4:SetCondition(s.negcon) e4:SetCost(Cost.SelfTribute) e4:SetTarget(s.negtg) e4:SetOperation(s.negop) c:RegisterEffect(e4) end s.listed_series={SET_MEKLORD} function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(1-tp) end function s.cfilter(c,ft) return c:IsFaceup() and c:IsSetCard(SET_MEKLORD) and c:IsAbleToGraveAsCost() and (ft>0 or c:GetSequence()<5) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,ft) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,0,1,1,nil,ft) Duel.SendtoGrave(g,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,true,true) 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,true,false,POS_FACEUP)~0 then c:CompleteProcedure() end end 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) local g=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 tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then --Cannot attack local e1=Effect.CreateEffect(c) e1:SetDescription(3206) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end function s.negcon(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end if re:IsHasCategory(CATEGORY_NEGATE) and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) return ex and tg~=nil and (tc+tg:FilterCount(Card.IsOnField,nil)-#tg)>0 end function s.negtg(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.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a Level 3 monster other than "Psychic Tracker", you can Special Summon this card (from your hand) in Defense Position. You can only Special Summon "Psychic Tracker" once per turn this way. A Synchro Monster that used this card as material gains 600 ATK.
--サイコトラッカー --Psychic Tracker --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM) e1:SetRange(LOCATION_HAND) e1:SetTargetRange(POS_FACEUP_DEFENSE,0) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCondition(s.spcon) c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(s.atkcon) e2:SetOperation(s.atkop) c:RegisterEffect(e2) end s.listed_names={id} function s.spfilter(c) return c:IsFaceup() and c:IsLevel(3) and not c:IsCode(id) end function s.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return r==REASON_SYNCHRO end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local sync=c:GetReasonCard() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(600) e1:SetReset(RESET_EVENT|RESETS_STANDARD) sync:RegisterEffect(e1) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card must attack if able. When this face-up Attack Position card is selected as an attack target, change it to Defense Position. When this card is Normal Summoned, add 1 "Karakuri" card from your Deck to your hand.
--カラクリ商人 壱七七 --Karakuri Merchant mdl 177 "Inashichi" local s,id=GetID() function s.initial_effect(c) --must attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_MUST_ATTACK) c:RegisterEffect(e1) --to defense local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_POSITION) e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e3:SetCode(EVENT_BE_BATTLE_TARGET) e3:SetCondition(s.poscon) e3:SetOperation(s.posop) 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_TRIGGER_F+EFFECT_TYPE_SINGLE) e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetTarget(s.tg) e4:SetOperation(s.op) c:RegisterEffect(e4) end s.listed_series={SET_KARAKURI} function s.poscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsAttackPos() end function s.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end end function s.filter(c) return c:IsSetCard(SET_KARAKURI) and c:IsAbleToHand() end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.op(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:
When this card is activated: You can Special Summon 1 "Helios - The Primordial Sun" from your hand or Deck. While this card is face-up on the field, any card sent to the GY is banished instead.
--マクロコスモス --Macro Cosmos local s,id=GetID() function s.initial_effect(c) --When this card is activated: You can Special Summon 1 "Helios - The Primordial Sun" from your hand or Deck 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:SetTarget(s.target) e1:SetOperation(s.activate) e1:SetHintTiming(0,TIMING_STANDBY_PHASE|TIMING_MAIN_END|TIMING_BATTLE_START|TIMINGS_CHECK_MONSTER_E) c:RegisterEffect(e1) --While this card is face-up on the field, any card sent to the GY is banished instead local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCode(EFFECT_TO_GRAVE_REDIRECT) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(0xff,0xff) e2:SetValue(LOCATION_REMOVED) c:RegisterEffect(e2) end s.listed_names={54493213} --"Helios - The Primordial Sun" function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK) end function s.spfilter(c,e,tp) return c:IsCode(54493213) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND|LOCATION_DECK,0,nil,e,tp) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) if #sg>0 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This monster can only be Ritual Summoned with the Ritual Spell Card, "Hamburger Recipe". You must also offer monsters whose total Level Stars equal 6 or more as a Tribute from the field or your hand.
--ハングリーバーガー --Hungry Burger local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() end s.listed_names={80811661}
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 revealing 3 other "Cubic" cards in your hand with different names, and cannot be Special Summoned by other ways. Unaffected by other monsters' activated effects, whose original ATK is 3000 or less. When this attacking card destroys a monster by battle: You can activate this effect; this card can make a second attack during this Battle Phase. During your End Phase: Each player takes 3000 damage. You can only use this effect of "Crimson Nova the Dark Cubic Lord" once per turn.
--暗黒方界神クリムゾン・ノヴァ --Crimson Nova the Dark Cubic Lord local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Must be special Summon by its own method local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(aux.FALSE) c:RegisterEffect(e1) --Special summon procedure (from hand) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Unaffected by activated monster effects, whose original ATK is 3000 or less 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:SetValue(s.immval) c:RegisterEffect(e3) --Make it be able to make a second attack local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_BATTLE_DESTROYING) e4:SetCondition(s.atkcon) e4:SetTarget(s.atktg) e4:SetOperation(s.atkop) c:RegisterEffect(e4) --Inflict 3000 damage to both players local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,1)) e5:SetCategory(CATEGORY_DAMAGE) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e5:SetCode(EVENT_PHASE+PHASE_END) e5:SetRange(LOCATION_MZONE) e5:SetCountLimit(1,id) e5:SetCondition(s.damcon) e5:SetTarget(s.damtg) e5:SetOperation(s.damop) c:RegisterEffect(e5) end s.listed_series={SET_CUBIC} function s.spcfilter(c) return c:IsSetCard(SET_CUBIC) and not c:IsPublic() end function s.rescon(sg,e,tp,mg) return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:GetClassCount(Card.GetCode)==#sg,sg:GetClassCount(Card.GetCode)~=#sg end function s.spcon(e,c) local c=e:GetHandler() if c==nil then return true end local tp=c:GetControler() local hg=Duel.GetMatchingGroup(s.spcfilter,tp,LOCATION_HAND,0,c) return aux.SelectUnselectGroup(hg,e,tp,3,3,s.rescon,0) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local c=e:GetHandler() local hg=Duel.GetMatchingGroup(s.spcfilter,tp,LOCATION_HAND,0,c) local g=aux.SelectUnselectGroup(hg,e,tp,3,3,s.rescon,1,tp,HINTMSG_CONFIRM,nil,nil,true) if #g>0 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.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) g:DeleteGroup() end function s.immval(e,te) return te:GetOwner()~=e:GetHandler() and te:IsMonsterEffect() and te:IsActivated() and te:GetOwner():GetBaseAttack()<=3000 and te:GetOwner():GetBaseAttack()>=0 end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker()==e:GetHandler() and aux.bdcon(e,tp,eg,ep,ev,re,r,rp) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsRelateToBattle() and not e:GetHandler():IsHasEffect(EFFECT_EXTRA_ATTACK) end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToBattle() then return end --Can make a second attack local e1=Effect.CreateEffect(c) e1:SetDescription(3201) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetValue(1) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE) c:RegisterEffect(e1) end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsTurnPlayer(tp) end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,3000) end function s.damop(e,tp,eg,ep,ev,re,r,rp) Duel.Damage(tp,3000,REASON_EFFECT,true) Duel.Damage(1-tp,3000,REASON_EFFECT,true) Duel.RDComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card cannot be destroyed by battle with a Level 4 or higher monster.
--氷弾使いレイス --Reese the Ice Mistress local s,id=GetID() function s.initial_effect(c) --indes local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(s.indes) c:RegisterEffect(e1) end function s.indes(e,c) return c:IsLevelAbove(4) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target up to 3 cards in any GY(s); banish them, then discard 1 Fiend monster. During your Main Phase, except the turn this card was sent to the GY: You can banish this card from your GY, then target 1 of your banished Fiend monsters; add it to your hand. You can only activate 1 "Dark World Puppetry" per turn.
--暗黒界の傀儡 --Dark World Puppetry --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Banish up to 3 cards local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE+CATEGORY_HANDES) 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.rmtg) e1:SetOperation(s.rmop) c:RegisterEffect(e1) --Add 1 banished Fiend monster to the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCondition(aux.exccon) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end function s.rmfilter(c,tp) return c:IsAbleToRemove(tp) and aux.SpElimFilter(c,false) end function s.tgfilter(c) return c:IsRace(RACE_FIEND) and c:IsDiscardable(REASON_EFFECT) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local loc=LOCATION_GRAVE|LOCATION_MZONE if chkc then return chkc:IsLocation(loc) and s.rmfilter(chkc,tp) end if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,loc,loc,1,nil,tp) and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.rmfilter,tp,loc,loc,1,3,nil,tp) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) if #tg>0 and Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 and tg:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local dg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND,0,1,1,nil) if #dg>0 then Duel.BreakEffect() Duel.SendtoGrave(dg,REASON_EFFECT|REASON_DISCARD) end end end function s.thfilter(c) return c:IsFaceup() and c:IsRace(RACE_FIEND) 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_REMOVED) and s.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2+ "Gouki" monsters Once per turn (Quick Effect): You can return to the hand any number of "Gouki" monsters you control that this card points to, then target the same number of face-up cards your opponent controls; they have their effects negated until the end of this turn. This card can attack all monsters your opponent controls, once each. If your opponent controls a face-up monster(s), this card can only target their monster with the highest ATK for attacks (your choice, if tied).
--剛鬼ザ・マスター・オーガ --Gouki The Master Ogre -- local s,id=GetID() function s.initial_effect(c) --link summon Link.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsSetCard,SET_GOUKI),2) c:EnableReviveLimit() --disable local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetCountLimit(1) e1:SetCost(s.discost) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) --attack all local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ATTACK_ALL) e2:SetValue(1) c:RegisterEffect(e2) --attack limit local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET) e3:SetCondition(s.atcon) e3:SetValue(s.atlimit) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e4:SetCondition(s.atcon) c:RegisterEffect(e4) end s.listed_series={SET_GOUKI} function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) return true end function s.costfilter(c,g) return c:IsFaceup() and c:IsSetCard(SET_GOUKI) and g:IsContains(c) and c:IsAbleToHandAsCost() end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local lg=e:GetHandler():GetLinkedGroup() if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsNegatable() end if chk==0 then if e:GetLabel()==1 then e:SetLabel(0) return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE,0,1,nil,lg) and Duel.IsExistingTarget(Card.IsNegatable,tp,0,LOCATION_ONFIELD,1,nil) else return false end end e:SetLabel(0) local rt=Duel.GetTargetCount(Card.IsNegatable,tp,0,LOCATION_ONFIELD,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local cg=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE,0,1,rt,nil,lg) local ct=#cg Duel.SendtoHand(cg,nil,REASON_COST) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,Card.IsNegatable,tp,0,LOCATION_ONFIELD,ct,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0) end function s.disfilter(c,e) return ((c:IsFaceup() and not c:IsDisabled()) or c:IsType(TYPE_TRAPMONSTER)) and c:IsRelateToEffect(e) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(s.disfilter,nil,e) local tc=g:GetFirst() for tc in aux.Next(g) do Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESETS_STANDARD_PHASE_END) 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 end end function s.atcon(e) return Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil) end function s.atlimit(e,c) local g=Duel.GetMatchingGroup(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,nil) local tg=g:GetMaxGroup(Card.GetAttack) return not tg:IsContains(c) or c:IsFacedown() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can activate 1 of these effects; ● Banish up to 1 LIGHT and up to 1 DARK monster from your hand and/or GY; increase or decrease this card's Level by the exact number banished, until the end of this turn. ● Target up to 2 of your banished monsters (1 LIGHT and/or 1 DARK); return them to the GY, and if you do, increase or decrease this card's Level by the exact number returned, until the end of this turn. You can only use this effect of "Mental Tuner" once per turn.
--メンタル・チューナー --Mental Tuner --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Change this card's level local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetTarget(s.lvtg) e1:SetOperation(s.lvop) c:RegisterEffect(e1) end function s.rmfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_HAND) or aux.SpElimFilter(c,true)) end function s.tgfilter(c,e) return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) and c:IsCanBeEffectTarget(e) end function s.attrescon(sg) return sg:GetClassCount(Card.GetAttribute)==#sg end function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local rmg=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_MZONE|LOCATION_HAND|LOCATION_GRAVE,0,c) local tgg=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_REMOVED,0,nil,e) if chk==0 then return c:HasLevel() and (#rmg>0 or #tgg>0) end e:SetCategory(0) e:SetProperty(0) local op=Duel.SelectEffect(tp, {#rmg>0,aux.Stringid(id,1)}, {#tgg>0,aux.Stringid(id,2)}) if op==1 then local rg=aux.SelectUnselectGroup(rmg,e,tp,1,2,s.attrescon,1,tp,HINTMSG_REMOVE) Duel.Remove(rg,POS_FACEUP,REASON_COST) local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_REMOVED) e:SetLabel(op,ct) elseif op==2 then e:SetCategory(CATEGORY_TOGRAVE) e:SetProperty(EFFECT_FLAG_CARD_TARGET) local tg=aux.SelectUnselectGroup(tgg,e,tp,1,2,s.attrescon,1,tp,HINTMSG_TOGRAVE) Duel.SetTargetCard(tg) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,#tg,0,0) e:SetLabel(2) end end function s.lvop(e,tp,eg,ep,ev,re,r,rp) local op,ct=e:GetLabel() if op==2 then local tg=Duel.GetTargetCards(e) if #tg>0 then ct=Duel.SendtoGrave(tg,REASON_EFFECT|REASON_RETURN) end elseif op~=1 then return end if not ct or ct==0 then return end local c=e:GetHandler() if not (c:IsRelateToEffect(e) and c:IsFaceup() and c:HasLevel()) then return end local b1=c:IsLevelAbove(ct+1) local b2=true local lvop=Duel.SelectEffect(tp, {b1,aux.Stringid(id,3)}, {b2,aux.Stringid(id,4)}) if lvop then c:UpdateLevel(lvop==1 and ct or -ct,RESETS_STANDARD_DISABLE_PHASE_END) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can remove from play 1 Reptile-Type "Worm" monster in your Graveyard to allow this card to attack twice during the same Battle Phase.
--ワーム・テンタクルス --Worm Tentacles local s,id=GetID() function s.initial_effect(c) --multi atk 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.mtcon) e1:SetCost(s.mtcost) e1:SetTarget(s.mttg) e1:SetOperation(s.mtop) c:RegisterEffect(e1) end s.listed_series={SET_WORM} function s.mtcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() end function s.costfilter(c) return c:IsSetCard(SET_WORM) and c:IsRace(RACE_REPTILE) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true) end function s.mtcost(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()) 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()) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK)==0 end end function s.mtop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EXTRA_ATTACK) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal Summoned: During your Main Phase this turn, you can Normal Summon 1 "Laval" monster, in addition to your Normal Summon/Set (you can only gain this effect once per turn). If this card is in your GY: You can target 1 FIRE monster you control; destroy it, and if you do, Special Summon this card in Defense Position, but banish it when it leaves the field, also you cannot Special Summon monsters for the rest of this turn, except FIRE monsters. You can only use this effect of "Laval Archer" once per turn.
--ラヴァル・アーチャー --Laval Archer --Logical Nonsense --Substitute ID local s,id=GetID() function s.initial_effect(c) --Gain an extra normal summon for "Laval" monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetOperation(s.sumop) c:RegisterEffect(e1) --Special summon itself from GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end --Lists "Laval" archetype s.listed_series={SET_LAVAL} --Gain an extra normal summon for "Laval" monsters function s.sumop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetTargetRange(LOCATION_HAND|LOCATION_MZONE,0) e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e1:SetTarget(s.estg) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.estg(e,c) return c:IsSetCard(SET_LAVAL) end --Check for FIRE monsters function s.filter(c,ft) return c:IsFaceup() and c:IsMonster() and c:IsAttribute(ATTRIBUTE_FIRE) and (ft>0 or c:GetSequence()<5) end --Activation legality function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,ft) end if chk==0 then return ft>-1 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,ft) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,ft) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end --Destroy 1 FIRE monster, and if you do, special summon itself from GY function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) --Banish it if it leaves the field local e1=Effect.CreateEffect(c) e1:SetDescription(3300) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESET_EVENT|RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end Duel.SpecialSummonComplete() --Cannot special summon for rest of turn, except FIRE monsters local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e2:SetTargetRange(1,0) e2:SetTarget(s.splimit) e2:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e2,tp) aux.RegisterClientHint(e:GetHandler(),nil,tp,1,0,aux.Stringid(id,3),nil) end --Restricted to FIRE monsters function s.splimit(e,c,sump,sumtype,sumpos,targetp) return not c:IsAttribute(ATTRIBUTE_FIRE) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Your opponent takes no battle damage from attacks involving this card. Once per turn: You can target 1 Effect Monster in your GY; banish that target, and if you do, until the End Phase, this card's name and original ATK become that monster's name and original ATK, and replace this effect with that monster's original effects.
--ファントム・オブ・カオス --Phantom of Chaos local s,id=GetID() function s.initial_effect(c) --Banish a monster and this card's name/original ATK become that monster's, and replace this effect with that monster's original effects local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Your opponent takes no battle damage from attacks involving this card local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_NO_BATTLE_DAMAGE) c:RegisterEffect(e2) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not e:GetHandler():HasFlagEffect(id) end e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end function s.filter(c) return c:IsType(TYPE_EFFECT) and c:IsAbleToRemove() and aux.SpElimFilter(c,true) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE|LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 and c:IsFaceup() and c:IsRelateToEffect(e) then local code=tc:GetOriginalCode() local atk=tc:GetBaseAttack() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetValue(code) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_SET_BASE_ATTACK) e2:SetValue(atk) e2:SetLabelObject(e1) e2:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e2) local cid=c:CopyEffect(code,RESETS_STANDARD_PHASE_END,1) --Reset the effects manually (to handle interactions with mandatory effects) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetLabel(cid) e3:SetLabelObject(e1) e3:SetOperation(s.resettop) e3:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e3) end end function s.resettop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local cid=e:GetLabel() c:ResetEffect(cid,RESET_COPY) c:ResetEffect(RESET_DISABLE,RESET_EVENT) local e1=e:GetLabelObject() e1:Reset() Duel.HintSelection(Group.FromCards(c)) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This monster gets the following effect(s) while there is a monster(s) with the following Attribute(s) on the field: ● FIRE: This card gains 500 ATK. ● WIND: If this card destroyed your opponent's monster by battle, it can attack once again in a row.
--エレメント・ドラゴン --Element Dragon local s,id=GetID() function s.initial_effect(c) --atk local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetCondition(s.atkcon) c:RegisterEffect(e1) --chain attack local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(s.atcon) e2:SetOperation(s.atop) c:RegisterEffect(e2) end function s.atkcon(e) return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_FIRE),0,LOCATION_MZONE,LOCATION_MZONE,1,nil) end function s.atcon(e,tp,eg,ep,ev,re,r,rp) return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():CanChainAttack() and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsAttribute,ATTRIBUTE_WIND),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end function s.atop(e,tp,eg,ep,ev,re,r,rp) Duel.ChainAttack() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Tribute this card; Special Summon 2 "Dark Beast Tokens" (Fiend/DARK/Level 2/ATK 1000/DEF 500). If this card is banished from the hand or GY: You can Special Summon 2 "Light Beast Tokens" (Fairy/Tuner/LIGHT/Level 2/ATK 500/DEF 1000). You can only use 1 "Chaos Witch" effect per turn, and only once that turn, also you cannot Special Summon monsters from the Extra Deck, except LIGHT or DARK Synchro Monsters, the turn you activate either effect.
--カオス・ウィッチ-混沌の魔女 --Chaos Witch --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Special Summon 2 "Black Beast Tokens" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetLabel(id+1,0,TYPES_TOKEN,1000,500,2,RACE_FIEND,ATTRIBUTE_DARK) e1:SetCost(s.tkcost) e1:SetTarget(s.tktg) e1:SetOperation(s.tkop) c:RegisterEffect(e1) --Special Summon 2 "White Beast Tokens" local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_REMOVE) e2:SetCountLimit(1,id) e2:SetLabel(id+2,0,TYPES_TOKEN+TYPE_TUNER,500,1000,2,RACE_FAIRY,ATTRIBUTE_LIGHT) e2:SetCondition(function(e) return e:GetHandler():IsPreviousLocation(LOCATION_HAND|LOCATION_GRAVE) end) e2:SetCost(s.tkcost) e2:SetTarget(s.tktg) e2:SetOperation(s.tkop) c:RegisterEffect(e2) --Count Special Summoned monsters Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.ctfilter) end s.listed_names={id+1,id+2} function s.synfilter(c) return c:IsType(TYPE_SYNCHRO) and c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) end function s.ctfilter(c) return not c:IsSummonLocation(LOCATION_EXTRA) or s.synfilter(c) end function s.tkcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local blk=(e:GetLabel())==id+1 if chk==0 then if Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)>0 then return false end return not blk or c:IsReleasable() end if blk then Duel.Release(c,REASON_COST) end --Cannot Special Summon monsters from the Extra Deck, except LIGHT or DARK Synchro monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(function(_,c) return c:IsLocation(LOCATION_EXTRA) and not s.synfilter(c) end) Duel.RegisterEffect(e1,tp) --Clock Lizard check aux.addTempLizardCheck(c,tp,s.lizfilter) end function s.lizfilter(e,c) return not c:IsOriginalType(TYPE_SYNCHRO) or not c:IsAttribute(ATTRIBUTE_LIGHT|ATTRIBUTE_DARK) end function s.tktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1 and not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.IsPlayerCanSpecialSummonMonster(tp,e:GetLabel()) end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0) end function s.tkop(e,tp,eg,ep,ev,re,r,rp) if s.tktg(e,tp,eg,ep,ev,re,r,rp,0) then local c=e:GetHandler() local tk=e:GetLabel() for _=1,2 do local token=Duel.CreateToken(tp,tk) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) end end Duel.SpecialSummonComplete() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
FLIP: You can target 1 monster on the field; destroy it. If this card is sent to the GY by a card effect: You can send 1 "Shaddoll" card from your Deck to the GY, except "Shaddoll Squamata". You can only use 1 "Shaddoll Squamata" effect per turn, and only once that turn.
--シャドール・リザード --Shaddoll Squamata local s,id=GetID() function s.initial_effect(c) --flip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --tograve local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(s.tgcon) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) end s.listed_series={SET_SHADDOLL} s.listed_names={id} function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,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.Destroy(tc,REASON_EFFECT) end end function s.tgcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) end function s.filter(c) return c:IsSetCard(SET_SHADDOLL) and not c:IsCode(id) and c:IsAbleToGrave() end function s.tgtg(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_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Ritual Summon this card with any "Gishki" Ritual Spell Card. Once per turn: You can declare 1 Monster Type and Attribute; look at 1 random card in your opponent's hand, and if it is a monster of the declared Type and Attribute, shuffle it into the Deck. Otherwise, return it to the hand.
--イビリチュア・プシュケローネ --Gishki Psychelone local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Look at 1 random card and shuffle it into the Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TODECK) 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_GISHKI} function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE) local rc=Duel.AnnounceRace(tp,1,RACE_ALL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE) local at=Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL) e:SetLabel(rc,at) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local tc=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,1):GetFirst() Duel.ConfirmCards(tp,tc) local rc,at=e:GetLabel() if tc:IsRace(rc) and tc:IsAttribute(at) then Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) else Duel.ShuffleHand(1-tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
During your Main Phase 1, FIRE Dragon monsters you control are unaffected by your opponent's activated effects. During your Main Phase: You can add 1 "Tenpai Dragon" monster from your Deck to your hand, then discard 1 card. You can only use this effect of "Sangen Summoning" once per turn. If this card is destroyed during the Battle Phase: You can target 1 Dragon Synchro Monster you control; double its ATK.
--盃満ちる燦幻荘 --Sangen Summoning --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) --FIRE Dragon monsters you control are unaffected by your opponent's activated effects during your Main Phase 1 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetTargetRange(LOCATION_MZONE,0) e2:SetRange(LOCATION_FZONE) e2:SetCondition(function(e) return Duel.IsTurnPlayer(e:GetHandlerPlayer()) and Duel.IsPhase(PHASE_MAIN1) end) e2:SetTarget(function(e,c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_DRAGON) end) e2:SetValue(s.immval) c:RegisterEffect(e2) --Search 1 "Tenpai Dragon" monster from your Deck to your hand, then discard 1 card local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1,id) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) --Double the ATK of 1 Dragon Synchro Monster you control local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_ATKCHANGE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_DESTROYED) e4:SetCondition(function() return Duel.IsBattlePhase() end) e4:SetTarget(s.atktg) e4:SetOperation(s.atkop) c:RegisterEffect(e4) end s.listed_series={SET_TENPAI_DRAGON} function s.immval(e,te) return te:GetOwnerPlayer()==1-e:GetHandlerPlayer() and te:IsActivated() end function s.thfilter(c) return c:IsSetCard(SET_TENPAI_DRAGON) and c:IsMonster() 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) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,tp,1) 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 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) Duel.BreakEffect() Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT|REASON_DISCARD,nil) end end function s.atkfilter(c) return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO) 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.atkfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKDEF) local tc=Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,tc,1,tp,tc:GetFirst():GetAttack()) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then --Its ATK becomes doubled local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(tc:GetAttack()*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:
Activate 1 of these effects. ● Target 1 "Bujin" monster in your GY; add that target to your hand. ● Target 1 of your banished "Bujin" monsters; return that target to the GY. * The above text is unofficial and describes the card's functionality in the OCG.
--剣現する武神 --Bujin Regalia - The Sword 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) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) -- local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetTarget(s.target2) e2:SetOperation(s.activate2) c:RegisterEffect(e2) end s.listed_series={SET_BUJIN} function s.filter(c) return c:IsSetCard(SET_BUJIN) and c:IsMonster() and c:IsAbleToHand() end function s.target(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) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.activate(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.filter2(c) return c:IsFaceup() and c:IsSetCard(SET_BUJIN) and c:IsMonster() end function s.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and s.filter2(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter2,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.SelectTarget(tp,s.filter2,tp,LOCATION_REMOVED,0,1,1,nil) end function s.activate2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoGrave(tc,REASON_EFFECT|REASON_RETURN) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 monster in either GY; destroy 1 WATER monster on the target's owner's field, and if you do, Special Summon that target to that field in Defense Position. If this card is in your GY, except the turn it was sent there: You can banish this card, then target 1 WATER monster in either GY; destroy 1 monster on the targeted monster's owner's field, and if you do, Special Summon that targeted monster to that field in Defense Position. You can only use 1 "Hydor, the Base of All Things" effect per turn, and only once that turn.
--万物の始源-「水」 --Hydor, the Base of All Things --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Special Summon 1 monster from either GY local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg(false)) e1:SetOperation(s.spop(false)) c:RegisterEffect(e1) --Special Summon 1 WATER monster from either GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) e2:SetCondition(aux.exccon) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.sptg(true)) e2:SetOperation(s.spop(true)) c:RegisterEffect(e2) end function s.spfilter(c,e,tp,water) return (not water or c:IsAttribute(ATTRIBUTE_WATER)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and Duel.IsExistingMatchingCard(s.desfilter,c:GetOwner(),LOCATION_MZONE,0,1,nil,water) end function s.desfilter(c,water) return Duel.GetMZoneCount(c:GetControler(),c)>0 and (water or (c:IsAttribute(ATTRIBUTE_WATER) and c:IsFaceup())) end function s.sptg(water) return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,water) end if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,water) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp,water) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,0) end end function s.spop(water) return function(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,s.desfilter,tc:GetOwner(),LOCATION_MZONE,0,1,1,nil,water) if #g==0 then return end Duel.HintSelection(g) if Duel.Destroy(g,REASON_EFFECT)>0 then Duel.SpecialSummon(tc,0,tp,tc:GetControler(),false,false,POS_FACEUP_DEFENSE) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a "Utopia" monster: Destroy the 1 face-up monster your opponent controls that has the lowest ATK (your choice, if tied), and if you do, inflict damage to your opponent equal to the destroyed monster's ATK on the field.
--ホープ・バスター --Utopia Buster local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_UTOPIA} function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(SET_UTOPIA) 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) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local tg=g:GetMinGroup(Card.GetAttack) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) if #g>0 then local tc=nil local tg=g:GetMinGroup(Card.GetAttack) if #tg>1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local sg=tg:Select(tp,1,1,nil) Duel.HintSelection(sg) tc=sg:GetFirst() else tc=tg:GetFirst() end local atk=tc:GetAttack() if Duel.Destroy(tc,REASON_EFFECT)>0 then Duel.Damage(1-tp,atk,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Level 4 or lower Cyberse monster If this card is sent to the GY as material for a Cyberse Link Monster with 2300 or more original ATK: You can Special Summon this card, but banish it when it leaves the field. You can only use this effect of "Link Decoder" once per turn.
--リンク・デコーダー --Link Decoder --Scripted by Larry126 local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure Link.AddProcedure(c,s.matfilter,1,1) --Special Summon itself 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_DELAY) e1:SetCode(EVENT_BE_MATERIAL) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.matfilter(c,lc,sumtype,tp) return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE,lc,sumtype,tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and rc:IsRace(RACE_CYBERSE) and rc:GetBaseAttack()>=2300 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) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then --Banish it if 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:SetReset(RESET_EVENT|RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card can attack directly. You can only use each of the following effects of "T.G. Drill Fish" once per turn. ● If all monsters you control are "T.G." monsters (min. 1): You can Special Summon this card from your hand. ● When a "T.G." monster you control inflicts battle damage to your opponent: You can target 1 monster your opponent controls; destroy it.
--TG ドリル・フィッシュ --T.G. Drill Fish local s,id=GetID() function s.initial_effect(c) --Direct attack local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e1) --Special summon itself from the hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Destroy 1 monster local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) end s.listed_series={SET_TG} function s.spcon(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) return #g>0 and g:FilterCount(aux.FaceupFilter(Card.IsSetCard,SET_TG),nil)==#g end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.descon(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(SET_TG) end function s.destg(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.desop(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:
2 Level 7 Dragon monsters If this card is Xyz Summoned: You can target 1 Level 4 or lower "Dragon Ruler" monster in your GY or banishment; Special Summon 1 Level/Rank 7 "Dragon Ruler" monster that is mentioned on that targeted monster from your Deck or banishment, then shuffle the targeted monster into the Deck. When your opponent activates a Spell/Trap Card or effect (Quick Effect): You can detach 2 materials from this card; negate the activation, and if you do, banish that card. You can only use each effect of "Eclipse, Dragon Ruler of Catastrophes" once per turn.
--凶征竜-エクレプシス --Eclipse, Dragon Ruler of Catastrophes --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Xyz Summon procedure: 2 Level 7 Dragon monsters Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),7,2) --Special Summon 1 Level/Rank 7 "Dragon Ruler" monster mentioned on a target from your Deck or banishment, then shuffle that target into the Deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Negate the activation of an opponent's Spell/Trap Card or effect, and if you do, banish it local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_CHAINING) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.negcon) e2:SetCost(Cost.DetachFromSelf(2,2,nil)) e2:SetTarget(s.negtg) e2:SetOperation(s.negop) c:RegisterEffect(e2) end s.listed_series={SET_DRAGON_RULER} function s.tdfilter(c,e,tp) return c:IsSetCard(SET_DRAGON_RULER) and c:IsLevelBelow(4) and c:IsAbleToDeck() and c:IsFaceup() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_REMOVED,0,1,nil,e,tp,c) end function s.spfilter(c,e,tp,tc) return c:IsSetCard(SET_DRAGON_RULER) and (c:IsLevel(7) or c:IsRank(7)) and tc:ListsCode(c:GetCode()) and (c:IsLocation(LOCATION_DECK) or c:IsFaceup()) 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|LOCATION_REMOVED) and chkc:IsControler(tp) and s.tdfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE|LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK|LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK|LOCATION_REMOVED,0,1,1,nil,e,tp,tc) if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and tc:IsRelateToEffect(e) then Duel.BreakEffect() Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end function s.negcon(e,tp,eg,ep,ev,re,r,rp) return ep==1-tp and re:IsSpellTrapEffect() and Duel.IsChainNegatable(ev) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) end function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) local rc=re:GetHandler() local relation=rc:IsRelateToEffect(re) if chk==0 then return rc:IsAbleToRemove(tp) or (not relation and Duel.IsPlayerCanRemove(tp)) end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if relation then Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,rc:GetControler(),rc:GetLocation()) else Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,0,rc:GetPreviousLocation()) end end function s.negop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, during the End Phase, if your Level 2 or lower Normal Monster(s) was destroyed by battle this turn: Special Summon Level 2 or lower Normal Monsters from your Deck, equal to the number of your Level 2 or lower Normal Monsters destroyed by battle this turn.
--人海戦術 --Human-Wave Tactics 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_END_PHASE) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) aux.GlobalCheck(s,function() s[0]=0 s[1]=0 local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_BATTLED) ge1:SetOperation(s.checkop) Duel.RegisterEffect(ge1,0) aux.AddValuesReset(function() s[0]=0 s[1]=0 end) end) end function s.checkop(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() if a:IsStatus(STATUS_BATTLE_DESTROYED) and a:IsType(TYPE_NORMAL) and a:IsLevelBelow(2) then s[a:GetControler()]=s[a:GetControler()]+1 end if d and d:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsType(TYPE_NORMAL) and d:IsLevelBelow(2) then s[d:GetControler()]=s[d:GetControler()]+1 end end function s.filter(c,e,tp) return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local ct=s[tp] if chk==0 then return ct>0 and (ct==1 or not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local ct=s[tp] Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,ct,ct,nil,e,tp) if #g==0 then return end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end if ft<=0 then Duel.SendtoGrave(g,REASON_EFFECT) elseif ft>=#g then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,ft,ft,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) g:Sub(sg) Duel.SendtoGrave(g,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is Normal or Special Summoned: You can add 1 "Tistina" monster from your Deck to your hand, except "Miasma Dragon Tistina", also for the rest of this turn, LIGHT "Tistina" monsters you control gain 1000 ATK. If this card is sent to the GY, and a card is in the Field Zone: You can Special Summon this card, also you cannot Special Summon from the hand or GY for the rest of this turn, except "Tistina" monsters. You can only use each effect of "Miasma Dragon Tistina" once per turn.
--結瘴龍ティスティナ --Miasma Dragon Tistina --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Add 1 "Tistina" monster from your Deck to your hand, except "Miasma Dragon Tistina" local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SUMMON_SUCCESS) e1: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:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) end s.listed_names={id} s.listed_series={SET_TISTINA} function s.thfilter(c) return c:IsSetCard(SET_TISTINA) and c:IsMonster() and not c:IsCode(id) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_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 local c=e:GetHandler() --For the rest of this turn, LIGHT "Tistina" monsters you control gain 1000 ATK 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:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(SET_TISTINA) 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)) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetFieldGroupCount(0,LOCATION_FZONE,LOCATION_FZONE)>0 and 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 --You cannot Special Summon from the hand or GY for the rest of this turn, except "Tistina" monsters local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,3)) 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_HAND|LOCATION_GRAVE) and not c:IsSetCard(SET_TISTINA) 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:
If you control a Level 2 or lower "Flower Cardian" monster: You can Special Summon this card from your hand, also you cannot Normal or Special Summon monsters for the rest of this turn, except "Flower Cardian" monsters. Once per turn: You can Tribute 1 "Flower Cardian" monster; draw 1 card, and if you do, show it, then, if it is a "Flower Cardian" monster, you can take 1 "Flower Cardian" monster from your Deck, except "Flower Cardian Cherry Blossom", and either add it to your hand or Special Summon it. Otherwise, send the card you drew to the GY.
--花札衛-桜- --Flower Cardian Cherry Blossom --Scripted by AlphaKretin local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Draw 1 card, and if you do, show it, then, if it is a "Flower Cardian" monster, you can take 1 "Flower Cardian" monster from your Deck, except "Flower Cardian Cherry Blossom", and either add it to your hand or Special Summon it local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCost(s.drcost) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) end s.listed_names={id} s.listed_series={SET_FLOWER_CARDIAN} function s.spconfilter(c) return c:IsLevelBelow(2) and c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsFaceup() end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,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 --You cannot Normal or Special Summon monsters for the rest of this turn, except "Flower Cardian" 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_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(function(e,c) return not c:IsSetCard(SET_FLOWER_CARDIAN) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) Duel.RegisterEffect(e2,tp) end function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,Card.IsSetCard,1,false,nil,nil,SET_FLOWER_CARDIAN) end local g=Duel.SelectReleaseGroupCost(tp,Card.IsSetCard,1,1,false,nil,nil,SET_FLOWER_CARDIAN) Duel.Release(g,REASON_COST) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end function s.thspfilter(c,e,tp,mmz_chk) return c:IsSetCard(SET_FLOWER_CARDIAN) and c:IsMonster() and not c:IsCode(id) and (c:IsAbleToHand() or (mmz_chk and c:IsCanBeSpecialSummoned(e,0,tp,false,false))) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.Draw(p,d,REASON_EFFECT)>0 then local dc=Duel.GetOperatedGroup():GetFirst() Duel.ConfirmCards(1-tp,dc) if dc:IsSetCard(SET_FLOWER_CARDIAN) and dc:IsMonster() then local mmz_chk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local g=Duel.GetMatchingGroup(s.thspfilter,tp,LOCATION_DECK,0,nil,e,tp,mmz_chk) if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=g:Select(tp,1,1,nil):GetFirst() Duel.BreakEffect() aux.ToHandOrElse(sc,tp, function() return mmz_chk and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) end, function() return Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) end, aux.Stringid(id,4) ) end else Duel.BreakEffect() Duel.SendtoGrave(dc,REASON_EFFECT) end Duel.ShuffleHand(tp) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
This card is used to Ritual Summon "Prediction Princess Tarotrei". You must also Tribute monsters from your hand or field whose total Levels equal 9 or more. During your Main Phase, except the turn this card was sent to the GY: You can banish this card from your GY; add 1 "Prediction Princess" monster from your Deck to your hand.
--聖占術の儀式 --Prediction Ritual local s,id=GetID() function s.initial_effect(c) Ritual.AddProcGreaterCode(c,9,nil,94997874) --to hand local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_GRAVE) e1:SetCondition(aux.exccon) e1:SetCost(Cost.SelfBanish) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) end s.listed_series={SET_PREDICTION_PRINCESS} function s.thfilter(c) return c:IsSetCard(SET_PREDICTION_PRINCESS) and c:IsMonster() 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:
If a monster Special Summoned from the Extra Deck is on the field: You can Special Summon this card from your hand. If this card is Special Summoned from the hand: You can make each player send 1 monster from their Extra Deck to the GY. If this card is sent to the GY: You can target 1 "Dogmatika" card in your GY, except "Dogmatika Chaplain"; add it to your hand. You can only use each effect of "Dogmatika Chaplain" once per turn.
--教導の死徒 --Dogmatika Chaplain --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon this card from your hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCondition(function() return Duel.IsExistingMatchingCard(Card.IsSummonLocation,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,LOCATION_EXTRA) end) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Make each player send 1 monster from their Extra Deck to the GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,{id,1}) e2:SetCondition(function(e) return e:GetHandler():IsSummonLocation(LOCATION_HAND) end) e2:SetTarget(s.tgtg) e2:SetOperation(s.tgop) c:RegisterEffect(e2) --Add 1 "Dogmatika" card from your GY to your hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,{id,2}) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_series={SET_DOGMATIKA} s.listed_names={id} 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 function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_EXTRA,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,PLAYER_ALL,LOCATION_EXTRA) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) local sg=Group.CreateGroup() for p=0,1 do Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOGRAVE) local sc=Duel.SelectMatchingCard(p,Card.IsAbleToGrave,p,LOCATION_EXTRA,0,1,1,nil):GetFirst() if sc then sg:AddCard(sc) end end if #sg>0 then Duel.SendtoGrave(sg,REASON_EFFECT) end end function s.thfilter(c) return c:IsSetCard(SET_DOGMATIKA) and c:IsAbleToHand() and not c:IsCode(id) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.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) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, if a monster(s) you control is destroyed by battle or card effect: You can Special Summon 1 "Yang Zing" monster from your Deck. You cannot Special Summon monsters from the Extra Deck, except Synchro Monsters.
--竜星の具象化 --Yang Zing Creation local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Synchro Summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --Special Summon Limitation local e3=Effect.CreateEffect(c) e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_SZONE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetTargetRange(1,0) e3:SetTarget(s.sumlimit) c:RegisterEffect(e3) --ClockLizard check aux.addContinuousLizardCheck(c,LOCATION_SZONE,s.lizfilter) end s.listed_series={SET_YANG_ZING} function s.cfilter(c,tp) return c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.filter(c,e,tp) return c:IsSetCard(SET_YANG_ZING) 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 not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.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 function s.sumlimit(e,c,sump,sumtype,sumpos,targetp) return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_SYNCHRO) end function s.lizfilter(e,c) return not c:IsOriginalType(TYPE_SYNCHRO) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal Summoned, you can add 1 Level 3 "Genex" Effect Monster from your Deck to your hand.
--ジェネクス・パワー・プランナー --Genex Power Planner local s,id=GetID() function s.initial_effect(c) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) end s.listed_series={SET_GENEX} function s.filter(c) return c:GetLevel()==3 and c:IsSetCard(SET_GENEX) and c:IsType(TYPE_EFFECT) 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:
If this card is Summoned: You can target 1 monster your opponent controls; destroy it. After damage calculation, if this card battled: You can target 1 Continuous Spell in your GY; add it to your hand. You can only use each effect of "Valkyrie Zweite" once per turn.
--ワルキューレ・ツヴァイト --Valkyrie Zweite --scripted by AlphaKretin 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:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) --Add to hand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_BATTLED) e4:SetCountLimit(1,{id,1}) e4:SetTarget(s.thtg) e4:SetOperation(s.thop) c:RegisterEffect(e4) end function s.destg(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(nil,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,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) then Duel.Destroy(tc,REASON_EFFECT) end end function s.thfilter(c) return c:IsSpell() and c:IsType(TYPE_CONTINUOUS) 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_RTOHAND) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control the same number of monsters as your opponent, switch control of all those monsters.
--スウィッチヒーロー --Switcheroroo local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_CONTROL) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c) return not c:IsAbleToChangeControler() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) local g1=g:Filter(Card.IsControler,nil,tp) local g2=g:Filter(Card.IsControler,nil,1-tp) if chk==0 then return #g>0 and #g1<6 and #g1==#g2 and g:FilterCount(s.filter,nil)==0 end Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,#g,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g1=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) local g2=Duel.GetFieldGroup(tp,0,LOCATION_MZONE) Duel.SwapControl(g1,g2) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Choose 1 of these effects; apply that effect, but skip your next Battle Phase. ● Target 1 Effect Monster your opponent controls; negate its effects (until the end of this turn), then banish the top 3 cards of your opponent's Deck. ● Special Summon 1 "Runick" monster from your Extra Deck to the Extra Monster Zone. You can only activate 1 "Runick Freezing Curses" per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--凍てつく呪いの神碑 --Runick Freezing Curses --Scripted by Hatter local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateMysteruneQPEffect(c,id,CATEGORY_DISABLE,s.negtg,s.negop,3,EFFECT_FLAG_CARD_TARGET) c:RegisterEffect(e1) end s.listed_series={SET_RUNICK} function s.negfilter(c) return c:IsType(TYPE_EFFECT) and c:IsNegatableMonster() end function s.negtg(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.negfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.negfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE) local g=Duel.SelectTarget(tp,s.negfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) end function s.negop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsDisabled() and not tc:IsImmuneToEffect(e) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local c=e:GetHandler() --Negate effects local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=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) return true end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] Each time you take effect damage while you control a Fairy Monster Card in your other Pendulum Zone, place 1 Resonance Counter on this card. Monsters your opponent controls lose 100 ATK for each Resonance Counter on your field. ---------------------------------------- [ Monster Effect ] If this card is in your hand: You can discard 1 other card; take 1 "Angello Vaalmonica" from your Deck, and place this card and that card in your Pendulum Zones. During your Main Phase, if this card was Normal or Special Summoned this turn: You can banish 1 "Vaalmonica" Normal Spell/Trap from your GY; apply whichever effect on that card includes taking damage. You can only use each effect of "Dimonno Vaalmonica" once per turn.
--悪魔の聲 --Dimonno Vaalmonica --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Pendulum procedure Pendulum.AddProcedure(c) --Can place Resonance Counters on it c:EnableCounterPermit(COUNTER_RESONANCE,LOCATION_PZONE) --Place 1 Resonance Counter on this card each time you take effect damage local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_DAMAGE) e1:SetRange(LOCATION_PZONE) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ep==tp and r&REASON_EFFECT>0 and Duel.IsExistingMatchingCard(Card.IsOriginalRace,tp,LOCATION_PZONE,0,1,e:GetHandler(),RACE_FAIRY) end) e1:SetOperation(s.ctop) c:RegisterEffect(e1) --Opponent's monsters lose 100 ATK for each Resonance Counter on your field local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_PZONE) e2:SetTargetRange(0,LOCATION_MZONE) e2:SetValue(function(e) return Duel.GetCounter(e:GetHandlerPlayer(),LOCATION_ONFIELD,0,COUNTER_RESONANCE)*-100 end) c:RegisterEffect(e2) --Place both this card and 1 "Angello Vaalmonica" from your Deck in your Pendulum Zone local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_HAND) e3:SetCountLimit(1,{id,0}) e3:SetCost(s.pzcost) e3:SetTarget(s.pztg) e3:SetOperation(s.pzop) c:RegisterEffect(e3) --Apply the damage-inflicting effect of 1 "Vaalmonica" Normal Spell/Trap local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,{id,1}) e4:SetCondition(function(e) return e:GetHandler():HasFlagEffect(id) end) e4:SetCost(s.cpcost) e4:SetTarget(s.cptg) e4:SetOperation(s.cpop) c:RegisterEffect(e4) --Register flag on summon aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) ge1:SetCode(EVENT_SUMMON_SUCCESS) ge1:SetLabel(id) ge1:SetOperation(aux.sumreg) Duel.RegisterEffect(ge1,0) local ge2=ge1:Clone() ge2:SetCode(EVENT_SPSUMMON_SUCCESS) Duel.RegisterEffect(ge2,0) end) end s.listed_names={3048768} --"Angello Vaalmonica" s.listed_series={SET_VAALMONICA} s.counter_place_list={COUNTER_RESONANCE} function s.ctop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not Duel.IsChainSolving() then s.addcounter(e,tp,eg,ep,ev,re,r,rp) else --Place 1 Resonance Counter on this card at the end of the Chain Link local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_CHAIN_SOLVED) e1:SetRange(LOCATION_PZONE) e1:SetOperation(s.addcounter) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_CHAIN) c:RegisterEffect(e1) --Reset "e1" at the end of the Chain Link local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetOperation(function() e1:Reset() end) e2:SetReset(RESET_CHAIN) Duel.RegisterEffect(e2,tp) end end function s.addcounter(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() c:AddCounter(COUNTER_RESONANCE,1) Duel.RaiseEvent(c,EVENT_CUSTOM+39210885,e,0,tp,tp,1) end function s.pzcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,c) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST|REASON_DISCARD,c) end function s.pzfilter(c) return c:IsCode(3048768) and not c:IsForbidden() end function s.pztg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) and Duel.CheckLocation(tp,LOCATION_PZONE,1) and Duel.IsExistingMatchingCard(s.pzfilter,tp,LOCATION_DECK,0,1,nil) end end function s.pzop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not (Duel.CheckLocation(tp,LOCATION_PZONE,0) and Duel.CheckLocation(tp,LOCATION_PZONE,1) and c:IsRelateToEffect(e)) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local tc=Duel.SelectMatchingCard(tp,s.pzfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if not tc then return end Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end function s.cpcost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) return true end function s.cpfilter(c) return c:IsSetCard(SET_VAALMONICA) and (c:IsNormalSpell() or c:IsNormalTrap()) and c:IsAbleToRemoveAsCost() --and c:CheckActivateEffect(false,true,false) end function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if e:GetLabel()==0 then return false end e:SetLabel(0) return Duel.IsExistingMatchingCard(s.cpfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tc=Duel.SelectMatchingCard(tp,s.cpfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst() Duel.Remove(tc,POS_FACEUP,REASON_COST) e:SetLabelObject(tc) end function s.cpop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if not tc then return end local eff=tc:GetActivateEffect() local op=eff:GetOperation() --Additional parameter checked in the script of "Vaalmonica" Normal Spells/Traps to correctly apply the damage-inflicting effect if op then op(e,tp,eg,ep,ev,re,r,rp,2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Reveal 1 Level 5 or higher "Ancient Gear" monster from your hand, then banish a number of "Ancient Gear" monsters from your Graveyard, whose combined Levels are double the revealed monster's, and if you do, if you Normal Summon the revealed monster this turn, you must Normal Summon it without Tributing.
--古代の機械工場 --Ancient Gear Factory 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.operation) c:RegisterEffect(e1) end s.listed_series={SET_ANCIENT_GEAR} function s.filter(c,g) return c:GetLevel()>4 and c:IsSetCard(SET_ANCIENT_GEAR) and g:CheckWithSumEqual(Card.GetLevel,c:GetLevel()*2,1,99) end function s.rfilter(c) return c:HasLevel() and c:IsSetCard(SET_ANCIENT_GEAR) and c:IsAbleToRemove() and aux.SpElimFilter(c,true) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND,0,1,nil,rg) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local rg=Duel.GetMatchingGroup(s.rfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1)) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,rg) local tc=g:GetFirst() if tc then Duel.ConfirmCards(1-tp,tc) Duel.ShuffleHand(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg=rg:SelectWithSumEqual(tp,Card.GetLevel,tc:GetLevel()*2,1,99) Duel.Remove(sg,POS_FACEUP,REASON_EFFECT) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,0)) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SUMMON_PROC) e1:SetCondition(s.ntcon) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) end end function s.ntcon(e,c,minc) if c==nil then return true end return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
2 Level 2 monsters You can detach 1 material from this card; add 1 "Melffy" card from your Deck to your hand. If another face-up "Melffy" monster you control returns to your hand (except during the Damage Step): You can target 1 face-up monster your opponent controls; it cannot attack, also negate its effects. You can only use each effect of "Melffy of the Forest" once per turn. * The above text is unofficial and describes the card's functionality in the OCG.
--森のメルフィーズ --Melffy of the Forest --Scripted by ahtelel local s,id=GetID() function s.initial_effect(c) --Must be properly summoned before reviving c:EnableReviveLimit() --Xyz summon procedure Xyz.AddProcedure(c,nil,2,2) --Add 1 "Melffy" card from deck local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(Cost.DetachFromSelf(1)) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Opponent's targeted monster cannot attack, also negate its effect local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_HAND) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCondition(s.discon) e2:SetTarget(s.distg) e2:SetOperation(s.disop) c:RegisterEffect(e2) end s.listed_series={SET_MELFFY} function s.thfilter(c) return c:IsSetCard(SET_MELFFY) 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.rtfilter(c,e,tp) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(SET_MELFFY) and c:GetPreviousControler()==tp and c:IsControler(tp) and c~=e:GetHandler() end function s.discon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.rtfilter,1,nil,e,tp) end function s.disfilter(c) return c:IsFaceup() 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 s.disfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.disfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT) local g=Duel.SelectTarget(tp,s.disfilter,tp,0,LOCATION_MZONE,1,1,nil) end function s.disop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) --Negate its effects 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:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) --Cannot attack local e3=Effect.CreateEffect(e:GetHandler()) e3:SetDescription(3206) e3:SetProperty(EFFECT_FLAG_CLIENT_HINT) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_ATTACK) e3:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e3) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Target 1 "Gravekeeper's" monster in your GY; Special Summon that target. This card's activation and effect are unaffected by "Necrovalley".
--降霊の儀式 --Rite of Spirit local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --immune to necro valley local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_NECRO_VALLEY_IM) c:RegisterEffect(e2) end s.listed_series={SET_GRAVEKEEPERS} function s.filter(c,e,tp) return c:IsSetCard(SET_GRAVEKEEPERS) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(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.activate(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:
You can substitute this card for any 1 Fusion-Material Monster. When you do this, the other Fusion-Material Monster(s) must be the correct one(s).
--イリュージョン・シープ --Mystical Sheep #1 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:
Place 1 "Obsidim, the Ashened City" from your Deck, face-up in either Field Zone, then if your opponent controls a card in their Field Zone, you can add 1 Level 5 or higher DARK Pyro monster from your Deck to your hand. For the rest of this turn after this card resolves, you cannot Special Summon from the Deck or Extra Deck, except Pyro monsters. You can only activate 1 "Awakening of Veidos" per turn.
--ヴェイドスの目覚め --Awakening of Veidos --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_MAIN_END|TIMINGS_CHECK_MONSTER_E) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_names={CARD_OBSIDIM_ASHENED_CITY} function s.plfilter(c) return c:IsCode(CARD_OBSIDIM_ASHENED_CITY) and c:IsFieldSpell() and not c:IsForbidden() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thfilter(c) return c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_PYRO) and c:IsAbleToHand() end function s.activate(e,tp,eg,ep,ev,re,r,rp) if e:IsHasType(EFFECT_TYPE_ACTIVATE) then --Cannot Special Summon from the Deck or Extra Deck, except Pyro monsters local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) 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_DECK|LOCATION_EXTRA) and not c:IsRace(RACE_PYRO) end) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() if not sc then return end local op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3)) local target_p=op==0 and tp or 1-tp local fc=Duel.GetFieldCard(target_p,LOCATION_FZONE,0) if fc then Duel.SendtoGrave(fc,REASON_RULE) Duel.BreakEffect() end if Duel.MoveToField(sc,tp,target_p,LOCATION_FZONE,POS_FACEUP,true) and Duel.GetFieldCard(1-tp,LOCATION_FZONE,0) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,4)) 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 return end Duel.BreakEffect() 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:
Neither player can banish cards.
--王宮の鉄壁 --Imperial Iron Wall 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,TIMINGS_CHECK_MONSTER_E) c:RegisterEffect(e1) --cannot remove local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_CANNOT_REMOVE) e2:SetRange(LOCATION_SZONE) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetTargetRange(1,1) c:RegisterEffect(e2) --id chk local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(id) e3:SetRange(LOCATION_SZONE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetTargetRange(1,1) c:RegisterEffect(e3) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate 1 of these effects: ● Draw 1 card. ● Activate only if your opponent controls a face-up Spirit monster. Draw 2 cards.
--八汰烏の骸 --Legacy of Yata-Garasu local s,id=GetID() function s.initial_effect(c) --Draw 1 card or 2 if the opponent controls a Spirit monster 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:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_card_types={TYPE_SPIRIT} function s.filter(c) return c:IsType(TYPE_SPIRIT) and c:IsFaceup() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end local d=1 if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 and Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1))==1 then d=2 end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(d) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,d) 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 Fish, Sea Serpent, or Aqua-Type monster you control attacks a Defense Position monster, inflict piercing battle damage to your opponent.
--ウミノタウルス --Uminotaurus local s,id=GetID() function s.initial_effect(c) --pierce local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_PIERCE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(s.target) c:RegisterEffect(e1) end function s.target(e,c) return c:IsRace(RACE_FISH|RACE_SEASERPENT|RACE_AQUA) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When a monster's attack is negated that targeted a face-up Attack Position monster: Inflict damage to your opponent equal to the difference in ATK between the 2 monsters.
--反発力 --Counterforce local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCategory(CATEGORY_DAMAGE) e1:SetCode(EVENT_ATTACK_DISABLED) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() local t=Duel.GetAttackTarget() return a:IsLocation(LOCATION_MZONE) and t and t:IsLocation(LOCATION_MZONE) and t:IsPosition(POS_FACEUP_ATTACK) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local a=Duel.GetAttacker() local t=Duel.GetAttackTarget() local g=Group.FromCards(a,t) local dam=math.abs(a:GetAttack()-t:GetAttack()) Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(dam) Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,dam) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards(e) if #g<2 then return end local c1=g:GetFirst() local c2=g:GetNext() if c1:IsFaceup() and c2:IsFaceup() then local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local dam=math.abs(c1:GetAttack()-c2:GetAttack()) Duel.Damage(p,dam,REASON_EFFECT) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When you Ritual Summon a monster, you can banish this card from your GY as 1 of the monsters required for the Ritual Summon. The monster Ritual Summoned using this card is unaffected by Trap effects.
--儀式魔人ディザーズ --Djinn Disserere of Rituals local s,id=GetID() function s.initial_effect(c) --Can be used for a Ritual Summon while it is in the GY local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_EXTRA_RITUAL_MATERIAL) e1:SetRange(LOCATION_GRAVE) e1:SetCondition(s.con) e1:SetValue(1) c:RegisterEffect(e1) --A ritual monster using this card is unaffected by traps local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(s.condition) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.con(e) return not Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),CARD_SPIRIT_ELIMINATION) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return r==REASON_RITUAL end function s.operation(e,tp,eg,ep,ev,re,r,rp) for rc in eg:Iter() do if rc:GetFlagEffect(id)==0 then --Unaffected by traps local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(3103) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetReset(RESET_EVENT|RESETS_STANDARD) e1:SetValue(s.efilter) rc:RegisterEffect(e1,true) rc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1) end end end function s.efilter(e,te) return te:IsTrapEffect() end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Special Summoned from the Graveyard by the effect of a Zombie-Type monster: You can target 1 face-up Zombie-Type monster you control; detach 1 Xyz Material from a monster on the field, and if you do, increase the targeted monster's Level by 1 and its ATK by 300 (even if the targeting conditions are no longer correct).
--紅血鬼 --Red-Headed Oni local s,id=GetID() function s.initial_effect(c) --Detach 1 Xyz Material from a monster on the field, increase the level of a monster monster's Level by 1 and its ATK by 300 local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_LVCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) 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():IsPreviousLocation(LOCATION_GRAVE) and re:GetHandler():IsRace(RACE_ZOMBIE) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and not c:IsType(TYPE_XYZ) 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.CheckRemoveOverlayCard(tp,1,1,1,REASON_EFFECT) and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.RemoveOverlayCard(tp,1,1,1,1,REASON_EFFECT)==0 then return end local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(1) e1:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(300) e2:SetReset(RESET_EVENT|RESETS_STANDARD) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If a "Raidraptor" monster you control is destroyed by battle: Target 1 "Raidraptor" monster in your Graveyard; add it to your hand. If a face-up "Raidraptor" monster(s) you control is destroyed by card effect: You can banish this card from your Graveyard; add 1 "Raidraptor" card from your Deck to your hand. You can only use this effect of "Raidraptor - Return" once per turn.
--RR-リターン --Raidraptor - Return local s,id=GetID() function s.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_BATTLE_DESTROYED) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --search local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1,id) e2:SetCondition(s.thcon) e2:SetCost(Cost.SelfBanish) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) end s.listed_series={SET_RAIDRAPTOR} function s.cfilter1(c,tp) return c:IsSetCard(SET_RAIDRAPTOR) and c:IsPreviousControler(tp) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter1,1,nil,tp) end function s.filter(c) return c:IsSetCard(SET_RAIDRAPTOR) and c:IsMonster() and c:IsAbleToHand() 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) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end function s.cfilter2(c,tp) return c:IsSetCard(SET_RAIDRAPTOR) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) end function s.thcon(e,tp,eg,ep,ev,re,r,rp) if eg:IsContains(e:GetHandler()) then return false end return eg:IsExists(s.cfilter2,1,nil,tp) end function s.thfilter(c) return c:IsSetCard(SET_RAIDRAPTOR) 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:
Equip only to a "Lightsworn" monster. It gains 700 ATK. When this card is sent from your Deck to the Graveyard: You can target 1 "Lightsworn" monster you control; equip this card to that target.
--ライトロード・レイピア --Lightsworn Sabre local s,id=GetID() function s.initial_effect(c) aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsSetCard,SET_LIGHTSWORN)) --Atk up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(700) c:RegisterEffect(e2) --equip local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_EQUIP) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(s.eqcondtion) e4:SetTarget(s.eqtarget) e4:SetOperation(s.operation) c:RegisterEffect(e4) end s.listed_series={SET_LIGHTSWORN} function s.filter(c) return c:IsFaceup() and c:IsSetCard(SET_LIGHTSWORN) end function s.eqcondtion(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetPreviousLocation()==LOCATION_DECK end function s.eqtarget(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.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if e:GetHandler():IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Equip(tp,e:GetHandler(),tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Inflict 500 damage to your opponent each time a monster(s) is Special Summoned from either player's Deck.
--スパルタクァの呪術師 --Witch Doctor of Sparta local s,id=GetID() function s.initial_effect(c) --recover local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.con) e1:SetTarget(s.tg) e1:SetOperation(s.op) c:RegisterEffect(e1) end function s.cfilter(c) return c:GetPreviousLocation()==LOCATION_DECK end function s.con(e,tp,eg,ep,ev,re,r,rp) return not eg:IsContains(e:GetHandler()) and eg:IsExists(s.cfilter,1,nil) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsRelateToEffect(e) end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.op(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) or e:GetHandler():IsFacedown() then return end 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:
Pay 800 LP; excavate the top 4 cards of your Deck and Special Summon all excavated Level 3 or lower Normal Monsters, also, shuffle the rest back into your Deck. * The above text is unofficial and describes the card's functionality in the OCG.
--魔の試着部屋 --Enchanting Fitting Room local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCost(Cost.PayLP(800)) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(3) 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.GetFieldGroupCount(tp,LOCATION_DECK,0)>3 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK) end function s.activate(e,tp,eg,ep,ev,re,r,rp) Duel.ConfirmDecktop(tp,4) local g=Duel.GetDecktopGroup(tp,4):Filter(s.filter,nil,e,tp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end if #g>0 then if ft<=0 then Duel.SendtoGrave(g,REASON_EFFECT) elseif ft>=#g then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,ft,ft,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) g:Sub(sg) Duel.SendtoGrave(g,REASON_EFFECT) end end Duel.ShuffleDeck(tp) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
[ Pendulum Effect ] During your Main Phase, if this card was activated this turn: You can target 1 other face-up card in the Spell & Trap Zone; destroy it. You can only use this effect of "Predaplant Spider Orchid" once per turn. ---------------------------------------- [ Monster Effect ] During the End Phase, if this card was Normal or Special Summoned this turn: You can discard 1 Plant monster; add 1 Level 4 or lower Plant monster from your Deck to your hand. You can only use this effect of "Predaplant Spider Orchid" once per turn.
--捕食植物スパイダー・オーキッド --Predaplant Spider Orchid --Scripted by Eerie Code local s,id=GetID() function s.initial_effect(c) --Pendulum attributes Pendulum.AddProcedure(c,false) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(1160) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetCost(s.reg) c:RegisterEffect(e1) --Destroy a Spell/Trap local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_PZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id) e2:SetCondition(s.descon) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) --Search local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetOperation(s.regop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) end function s.reg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end e:GetHandler():RegisterFlagEffect(id,RESET_PHASE|PHASE_END,EFFECT_FLAG_OATH,1) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(id)~=0 end function s.desfilter(c) return c:IsFaceup() and c:GetSequence()<5 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:GetSequence()<5 and chkc:IsFaceup() and chkc~=c end if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,c) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1,{id,1}) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) e1:SetReset(RESET_EVENT|RESET_TOGRAVE|RESET_REMOVE|RESET_TOHAND|RESET_TODECK|RESET_TOFIELD|RESET_PHASE|PHASE_END) e:GetHandler():RegisterEffect(e1) end function s.cfilter(c) return c:IsRace(RACE_PLANT) and c:IsDiscardable() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST|REASON_DISCARD) end function s.filter(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) 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:
If this card is in your hand: You can destroy 2 other monsters in your hand and/or face-up field, including an EARTH monster, and if you do, Special Summon this card, and if you do that, and both destroyed monsters were EARTH, you can also look at your opponent's Extra Deck and banish up to 3 monsters from it with different names. If this card is destroyed by card effect: You can Special Summon 1 non-EARTH Wyrm monster from your GY. You can only use each effect of "True King Lithosagym, the Disaster" once per turn.
--真竜皇リトスアジムD --True King Lithosagym, the Disaster local CARD_TRUE_KING_CALAMITIES=88581108 local s,id=GetID() function s.initial_effect(c) --Special summon itself from hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Special summon a monster from the graveyard 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(function(e) return e:GetHandler():IsReason(REASON_EFFECT) end) e2:SetTarget(s.sptg2) e2:SetOperation(s.spop2) c:RegisterEffect(e2) end function s.desfilter(c) return c:IsMonster() and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup()) or c:IsLocation(LOCATION_HAND)) end function s.locfilter(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) end function s.rescon(sg,e,tp,mg) return sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,sg)>0 end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local opp_mzone=Duel.IsPlayerAffectedByEffect(tp,CARD_TRUE_KING_CALAMITIES) and LOCATION_MZONE or 0 --True King of All Calamities local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE|LOCATION_HAND,opp_mzone,c) if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and #g>=2 and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end if (#g==2 and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)==1) or not g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,tp,0) else Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,tp,LOCATION_MZONE|LOCATION_HAND) 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() local opp_mzone=Duel.IsPlayerAffectedByEffect(tp,CARD_TRUE_KING_CALAMITIES) and LOCATION_MZONE or 0 --True King of All Calamities local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_MZONE|LOCATION_HAND,opp_mzone,c) if #g<2 or not g:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH) then return end local dg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_DESTROY) if #dg<2 then return end local rmv_chk=dg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_EARTH)==2 and true or false if Duel.Destroy(dg,REASON_EFFECT)==2 and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and rmv_chk then local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil) if rmv_chk and #rg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.ConfirmCards(tp,rg) local rmv_g=aux.SelectUnselectGroup(rg,e,tp,1,3,aux.dncheck,1,tp,HINTMSG_REMOVE) if #rmv_g>0 then Duel.Remove(rmv_g,POS_FACEUP,REASON_EFFECT) end Duel.ShuffleExtra(1-tp) end end end function s.thfilter(c,e,tp) return c:IsAttributeExcept(ATTRIBUTE_EARTH) and c:IsRace(RACE_WYRM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spop2(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.thfilter,tp,LOCATION_GRAVE,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 a Fusion Monster(s) on the field is destroyed by battle or card effect and sent to the Graveyard: You can target 1 of the Fusion Materials in your Graveyard that was used for its Fusion Summon; Special Summon it.
--ブランチ --Branch! 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) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_TO_GRAVE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_SZONE) e2:SetCondition(s.condition) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) end function s.filter(c) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) and c:IsType(TYPE_FUSION) and c:IsFusionSummoned() end function s.condition(e,tp,eg,ep,ev,re,r,rp,chk) return eg:IsExists(s.filter,1,nil) end function s.spfilter(c,eg,e,tp) return c:IsReason(REASON_FUSION) and eg:IsContains(c:GetReasonCard()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,eg,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,eg,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,eg,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end 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:
Equip only to a Cyberse monster you control. It gains 300 ATK, it is unaffected by your opponent's card effects, also the first time it would be destroyed by battle each turn, it is not destroyed. If this face-up card on the field is destroyed and sent to the GY: You can activate this effect; Cyberse monsters you currently control cannot be destroyed by battle or card effects until the end of this turn.
--グリッド・ロッド --Grid Rod --scripted by Larry126 and AlphaKretin local s,id=GetID() function s.initial_effect(c) --equip aux.AddEquipProcedure(c,0,aux.FilterBoolFunction(Card.IsRace,RACE_CYBERSE)) --atk up local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_EQUIP) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(300) c:RegisterEffect(e1) --immune local e2=e1:Clone() e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetValue(s.efilter) c:RegisterEffect(e2) --indes local e3=e1:Clone() e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e3:SetCountLimit(1) e3:SetValue(s.indct) c:RegisterEffect(e3) --to grave local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_DESTROYED) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCondition(s.indcon) e4:SetTarget(s.indtg) e4:SetOperation(s.indop) c:RegisterEffect(e4) end function s.efilter(e,re) return e:GetHandlerPlayer()~=re:GetOwnerPlayer() end function s.indct(e,re,r,rp) return r&REASON_BATTLE~=0 end function s.indcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousPosition(POS_FACEUP) and c:IsLocation(LOCATION_GRAVE) end function s.indtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsRace,RACE_CYBERSE),tp,LOCATION_MZONE,0,1,nil) end end function s.indop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsRace,RACE_CYBERSE),tp,LOCATION_MZONE,0,nil) if #g==0 then return end for tc in aux.Next(g) do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) e1:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) tc:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Activate only if you have no cards in your hand. Select 1 "Infernity" monster in your Graveyard. Special Summon it, and destroy all face-up monsters on the field with ATK lower than the Special Summoned monster's ATK. You cannot conduct your Battle Phase during the same turn you activate this card.
--ZERO-MAX --ZERO-MAX local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end s.listed_series={SET_INFERNITY} function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCurrentPhase()~=PHASE_MAIN2 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_BP) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE|PHASE_END) Duel.RegisterEffect(e1,tp) end function s.filter(c,e,tp) return c:IsSetCard(SET_INFERNITY) 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) local tc=g:GetFirst() local dg=Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,tc,tc:GetAttack()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0) end function s.dfilter(c,atk) return c:IsFaceup() and c:GetAttack()<atk end function s.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then Duel.BreakEffect() local dg=Duel.GetMatchingGroup(s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,tc,tc:GetAttack()) if #dg>0 then Duel.Destroy(dg,REASON_EFFECT) end end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this card is Normal or Special Summoned: You can send 1 "Noble Arms" Equip Spell Card from your Deck to the Graveyard. During either player's turn: You can target 1 "Noble Arms" Equip Spell Card and 1 appropriate monster on the field; equip that Equip Spell Card to that appropriate monster. This effect can only be used once while this card is face-up on the field.
--聖騎士ベディヴィエール --Noble Knight Bedwyr local s,id=GetID() function s.initial_effect(c) --send to grave local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --equip change local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET+EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetTarget(s.eqtg) e3:SetOperation(s.eqop) c:RegisterEffect(e3) end s.listed_series={SET_NOBLE_ARMS} function s.filter(c) return c:IsType(TYPE_EQUIP) and c:IsSetCard(SET_NOBLE_ARMS) and c:IsAbleToGrave() 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_TOGRAVE,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end function s.eqfilter1(c) return c:IsSetCard(SET_NOBLE_ARMS) and c:GetEquipTarget() and Duel.IsExistingTarget(s.eqfilter2,0,LOCATION_MZONE,LOCATION_MZONE,1,c:GetEquipTarget(),c) end function s.eqfilter2(c,ec) return c:IsFaceup() and ec:CheckEquipTarget(c) end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.eqfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g1=Duel.SelectTarget(tp,s.eqfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil) local tc=g1:GetFirst() e:SetLabelObject(tc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g2=Duel.SelectTarget(tp,s.eqfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,tc:GetEquipTarget(),tc) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetLabelObject() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc=g:GetFirst() if tc==ec then tc=g:GetNext() end if ec:IsFaceup() and ec:IsRelateToEffect(e) and ec:CheckEquipTarget(tc) and tc:IsFaceup() and tc:IsRelateToEffect(e) then Duel.Equip(tp,ec,tc) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Other cards you control cannot be destroyed by your opponent's card effects. You can only use each of the following effects of "Blue-Eyes Jet Dragon" once per turn, and can only activate them while "Blue-Eyes White Dragon" is on your field or in your GY. If a card(s) on the field is destroyed by battle or card effect: You can Special Summon this card from the GY (if it was there when the card was destroyed) or hand (even if not). At the start of the Damage Step, if this card battles: You can target 1 card your opponent controls; return it to the hand.
--ブルーアイズ・ジェット・ドラゴン --Blue-Eyes Jet Dragon --Scripted by Larry126 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:SetRange(LOCATION_HAND|LOCATION_GRAVE) e1:SetCode(EVENT_DESTROYED) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --Indes local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e2:SetTargetRange(LOCATION_ONFIELD,0) e2:SetRange(LOCATION_MZONE) e2:SetTarget(function(e,c) return c~=e:GetHandler() end) e2:SetValue(aux.indoval) c:RegisterEffect(e2) --Return to hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BATTLE_START) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1,{id,1}) e3:SetCondition(s.condition) e3:SetTarget(s.thtg) e3:SetOperation(s.thop) c:RegisterEffect(e3) end s.listed_names={CARD_BLUEEYES_W_DRAGON} function s.filter(c) return c:IsCode(CARD_BLUEEYES_W_DRAGON) and (c:IsFaceup() and c:IsOnField() or c:IsLocation(LOCATION_GRAVE)) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD|LOCATION_GRAVE,0,1,nil) end function s.spcfilter(c) return c:IsReason(REASON_BATTLE|REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.spcfilter,1,nil) and s.condition(e,tp,eg,ep,ev,re,r,rp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and ((c:IsLocation(LOCATION_GRAVE) and not eg:IsContains(c)) or (c:IsLocation(LOCATION_HAND))) 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 not c:IsRelateToEffect(e) then return end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,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
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 Level 4 or lower LIGHT Beast monster If this card is Special Summoned: You can place 1 "Yummy" Field Spell from your hand or Deck, face-up on your field, also you cannot Link Summon Link-3 or higher Link Monsters for the rest of this turn. You can only use this effect of "Yummy★Snatchy" once per turn. Once per Chain, during the Main Phase or your opponent's Battle Phase (Quick Effect): You can pay 100 LP; immediately after this effect resolves, Synchro Summon using monsters you control as material, including a "Yummy" monster.
--ヤミー★スナッチー --Yummy★Snatchy --scripted by Naim local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() --Link Summon procedure: 1 Level 4 or lower LIGHT Beast monster Link.AddProcedure(c,s.matfilter,1,1) --Place 1 "Yummy" Field Spell from your hand or Deck face-up on your field local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetTarget(s.pltg) e1:SetOperation(s.plop) c:RegisterEffect(e1) --Immediately after this effect resolves, Synchro Summon 1 Synchro Monster, using monsters you control as material, including a "Yummy" monster 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_MZONE) e2:SetHintTiming(0,TIMING_MAIN_END|TIMING_BATTLE_START|TIMING_BATTLE_END|TIMINGS_CHECK_MONSTER) e2:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN) e2:SetCondition(function(e,tp) return Duel.IsMainPhase() or (Duel.IsTurnPlayer(1-tp) and Duel.IsBattlePhase()) end) e2:SetCost(Cost.PayLP(100)) e2:SetTarget(s.synchtg) e2:SetOperation(s.synchop) c:RegisterEffect(e2) end s.listed_series={SET_YUMMY} function s.matfilter(c,lc,sumtype,tp) return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_LIGHT,lc,sumtype,tp) and c:IsRace(RACE_BEAST,lc,sumtype,tp) end function s.plfilter(c) return c:IsSetCard(SET_YUMMY) and c:IsFieldSpell() and not c:IsForbidden() end function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil) end end function s.plop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil):GetFirst() if sc then local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) if fc then Duel.SendtoGrave(fc,REASON_RULE) Duel.BreakEffect() end Duel.MoveToField(sc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) end --You cannot Link Summon Link-3 or higher Link Monsters for the rest of this turn local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE|PHASE_END) e1:SetTarget(function(e,c,tp,sumtyp,sumpos) return c:IsLinkAbove(3) and c:IsLinkMonster() and (sumtyp&SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK end) Duel.RegisterEffect(e1,tp) end function s.synchrocheck(tp,sg,sc) return sg:IsExists(Card.IsSetCard,1,nil,SET_YUMMY) end function s.synchtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then Synchro.CheckAdditional=s.synchrocheck local res=Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil) Synchro.CheckAdditional=nil return res end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.synchop(e,tp,eg,ep,ev,re,r,rp) Synchro.CheckAdditional=s.synchrocheck local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil) if #g>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sc=g:Select(tp,1,1,nil):GetFirst() Duel.SynchroSummon(tp,sc) else Synchro.CheckAdditional=nil end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a Fusion Monster that must be Special Summoned with "Dark Fusion", you can Special Summon this card (from your hand). You can only Special Summon "Evil HERO Dead-End Prison" once per turn this way. You can send 1 "HERO" monster from your Deck to the GY; if you Fusion Summon a "HERO" monster this turn, this face-up card can be used as a substitute for 1 material mentioned by name, but all other Fusion Materials must be correct. You can only use this effect of "Evil HERO Dead-End Prison" once per turn.
--E-HERO デス・プリズン --Evil HERO Dead-End Prison --scripted by Naim local s,id=GetID() function s.initial_effect(c) --Special Summon this card (from your hand) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1: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) --Make this card a Fusion substitute monster for any 1 material that is mentioned on a "HERO" Fusion Monster local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,{id,1}) e2:SetCost(s.fsubcost) e2:SetOperation(s.fsubop) c:RegisterEffect(e2) end s.listed_series={SET_HERO} s.listed_names={CARD_DARK_FUSION} function s.spconfilter(c) return c.dark_calling and c:IsType(TYPE_FUSION) and c:IsFaceup() end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spconfilter,tp,LOCATION_MZONE,0,1,nil) end function s.fsubcostfilter(c) return c:IsSetCard(SET_HERO) and c:IsMonster() and c:IsAbleToGraveAsCost() end function s.fsubcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.fsubcostfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.fsubcostfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function s.fsubop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then --If you Fusion Summon a "HERO" monster this turn, this card can be used as a substitute for any 1 Fusion Material whose name is mentioned on it local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,2)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_FUSION_SUBSTITUTE) e1:SetValue(function(e,fc) return fc:IsSetCard(SET_HERO) end) e1:SetReset(RESETS_STANDARD_PHASE_END) c:RegisterEffect(e1) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If exactly 1 monster you control (and no other cards) is destroyed by a card effect: Target that monster; Special Summon that target.
--リボーン・パズル --Puzzle Reborn local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_DESTROYED) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) 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 tc=eg:GetFirst() if chkc then return chkc==tc end if chk==0 then return #eg==1 and tc:IsPreviousControler(tp) and tc:IsPreviousLocation(LOCATION_MZONE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsLocation(LOCATION_GRAVE|LOCATION_REMOVED) and tc:IsReason(REASON_EFFECT) and tc:IsCanBeEffectTarget(e) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetTargetCard(tc) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0) end function s.activate(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:
You can send 1 face-up Spell/Trap you control to the GY, then target 1 Level 4 or lower Insect monster in your GY; Special Summon that Insect monster in Defense Position. You can only use this effect of "Beetron" once per turn.
--カブトロン --Beetron 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:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1,id) e1:SetRange(LOCATION_MZONE) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) end function s.cfilter(c,ft) return c:IsFaceup() and c:IsSpellTrap() and c:IsAbleToGraveAsCost() and (ft>0 or (c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5)) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil,ft) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil,ft) Duel.SendtoGrave(g,REASON_COST) end function s.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsRace(RACE_INSECT) 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:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 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,chk) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If you control a Rank 6 or higher Xyz Monster: Destroy all Set cards your opponent controls.
--エクシーズ・バースト --Xyz Burst 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:SetCondition(s.condition) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.cfilter(c) return c:IsFaceup() and c:IsRankAbove(6) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end function s.filter(c) return c:IsFacedown() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_ONFIELD,1,nil) end local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.filter,tp,0,LOCATION_ONFIELD,nil) Duel.Destroy(g,REASON_EFFECT) end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
You can Special Summon this card (from your hand) by discarding 1 card. If this card is Normal or Special Summoned: You can add 1 "Dark Magician" from your Deck to your hand. During damage calculation, if your other DARK Spellcaster monster battles an opponent's monster (Quick Effect): You can send this card from your hand or face-up field to the GY; that monster you control gains 2000 ATK/DEF during that damage calculation only.
--幻想の見習い魔導師 --Apprentice Illusion Magician local s,id=GetID() function s.initial_effect(c) --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) --search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --atkup local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,1)) e4:SetCategory(CATEGORY_ATKCHANGE) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e4:SetRange(LOCATION_HAND|LOCATION_MZONE) e4:SetCondition(s.atkcon) e4:SetCost(Cost.SelfToGrave) e4:SetOperation(s.atkop) c:RegisterEffect(e4) end s.listed_names={CARD_DARK_MAGICIAN} function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local rg=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,e:GetHandler()) return aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),0,c) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local rg=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,e:GetHandler()) local g=aux.SelectUnselectGroup(rg,e,tp,1,1,aux.ChkfMMZ(1),1,tp,HINTMSG_DISCARD,nil,nil,true) if #g>0 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.SendtoGrave(g,REASON_DISCARD|REASON_COST) g:DeleteGroup() end function s.filter(c) return c:IsCode(CARD_DARK_MAGICIAN) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=Duel.GetAttackTarget() if not c then return false end if c:IsControler(1-tp) then c=Duel.GetAttacker() end e:SetLabelObject(c) return c and c~=e:GetHandler() and c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRelateToBattle() end function s.atkop(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetLabelObject() if c:IsFaceup() and c:IsRelateToBattle() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL) e1:SetValue(2000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) end end
Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
1 "Nordic Beast" Tuner + 2+ non-Tuner monsters Once per turn: You can negate the effects of all face-up monsters your opponent currently controls, until the end of this turn. Once per turn, during the End Phase, if this face-up card you controlled was destroyed by your opponent's card and sent to your GY this turn: You can banish 1 "Nordic Beast" Tuner from your GY; Special Summon this card. When you do: You can inflict 800 damage to your opponent. * The above text is unofficial and describes the card's functionality in the OCG.
--極神皇トール --Thor, Lord of the Aesir local s,id=GetID() function s.initial_effect(c) --synchro summon Synchro.AddProcedure(c,s.tfilter,1,1,Synchro.NonTuner(nil),2,99) c:EnableReviveLimit() --negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetTarget(s.distg) e1:SetOperation(s.disop) c:RegisterEffect(e1) --special summon 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) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1) e3:SetCondition(s.spcon) e3:SetCost(s.spcost) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) --damage local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_DAMAGE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCondition(s.damcon) e4:SetTarget(s.damtg) e4:SetOperation(s.damop) c:RegisterEffect(e4) end s.listed_series={SET_NORDIC_BEAST} function s.tfilter(c,scard,sumtype,tp) return c:IsSetCard(SET_NORDIC_BEAST,scard,sumtype,tp) or c:IsHasEffect(EFFECT_SYNSUB_NORDIC) end function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local tc=g:GetFirst() local c=e:GetHandler() for tc in aux.Next(g) do 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:SetReset(RESETS_STANDARD_PHASE_END) tc:RegisterEffect(e2) end end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local pos=c:GetPreviousPosition() if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end if rp~=tp and c:IsPreviousControler(tp) and c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD) and (pos&POS_FACEUP)~=0 then c:RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) end end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(id)~=0 end function s.cfilter(c,tp) return c:IsSetCard(SET_NORDIC_BEAST) and c:IsType(TYPE_TUNER) 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.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,1,1,nil,tp) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,1,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) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),1,tp,tp,false,false,POS_FACEUP) end end function s.damcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1 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(800) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800) 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:
Only 1 monster can attack during each Battle Phase.
--暗黒の扉 --The Dark Door 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) --cannot attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetCondition(s.atkcon) e2:SetTarget(s.atktg) c:RegisterEffect(e2) --check local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_SZONE) e3:SetOperation(s.checkop) e3:SetLabelObject(e2) c:RegisterEffect(e3) end function s.atkcon(e) return e:GetHandler():GetFlagEffect(id)~=0 end function s.atktg(e,c) return c:GetFieldID()~=e:GetLabel() end function s.checkop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():GetFlagEffect(id)~=0 then return end local fid=eg:GetFirst():GetFieldID() e:GetHandler():RegisterFlagEffect(id,RESETS_STANDARD_PHASE_END,0,1) e:GetLabelObject():SetLabel(fid) end